Closed mkosir closed 2 years ago
Thanks! Please show the command you're using. Also, check this: https://github.com/okonet/lint-staged/issues/468#issuecomment-605102567
I'm running this command on staged files "tsc-files --noEmit -p tsconfig.dev.json src/types/images.d.ts"
.
Error happens in this repo, since .jsx
files are used. In order to reproduce it, try to commit .tsx file (works as expected) and then try to commit one of the .jsx files, in which case error is thrown.
Edit: I guess the reason is related to this 🤔
With lint-staged, you could filter and run different commands based on file extension. So you could add a section into your package.json
similar to below:
{
"lint-staged": {
"**/*.ts": "tsc-files --noEmit",
"**/*.tsx": "tsc-files --noEmit",
"**/*.js": <command to run>,
"**/*.jsx": <command to run>,
}
}
@AndrewWUw thx 🙇♂️ , this approach makes much sense 👍
Thanks for an awesome tool 🚀
I'm having an issue, if I try to commit
.js
/.jsx
type of file, error is thrown:error TS5042: Option 'project' cannot be mixed with source files on a command line.
It works as expected for all other type of files. In tsconfig
allowJs
is set totrue
.