-
-
Notifications
You must be signed in to change notification settings - Fork 456
Closed
Description
Description
lint-staged ignores tsconfig.json when it called through husky hooks (see "Steps to reproduce")
Steps to reproduce
Create these files (test.js, tsconfig, package.json):
test.ts
export class Test {
static get observedAttributes() {
return ['foo'];
}
}
tsconfig.json
{
"compilerOptions": {
"target": "ESNEXT"
}
}package.json
{
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,ts}": [
"tsc --noEmit"
]
}
}Then on command line write:
// everything works fine (it uses tsconfig.json)!
tsc --noEmit
// throw an error because it ignores tsconfig.json
git commit // error TS1056: Accessors are only available when targeting ECMAScript 5 and higher
Environment
- OS: macOS Catalina
- Node.js: v13
lint-staged: v10.1.0
AhmadrezaHK, bryan-hoang, vitalets, gentlee, murilogok and 16 more
Metadata
Metadata
Assignees
Labels
No labels