-
Notifications
You must be signed in to change notification settings - Fork 889
Unclear how to enable type checking after removing --type-check
#3399
Comments
We are removing type checking as a feature of TSLint, that's why we deprecated the CLI flag. Type checking errors should be reported by the compiler, not the linter. |
Ah! I was unaware of that large change. It seems like that change of functionality should be very clearly communicated. Am I safe to assume that type checking will continue to work at least until the next major version? |
I don't consider it a huge change... we are still allowing rules to use the type checker in their implementations. See here for more info #3322 (comment) Yeah, we can call it out more loudly in future release notes. |
Yep but this change's completely killed |
@nervebassmaster That means you are probably using the wrong tool. Use |
@ajafff And what is the best way to do the same if I use ts-node instead of tsc |
I guess I see. I found the issue in my script. |
To anyone subscribed into this issue who is still interested in a way to have type errors as part of the linter output: |
I was considering using |
I understand the design decision from technical perspective to remove typechecking from tslint. However as Miguel pointed out it has negative usability effect. More devs will be bumping into this when they remove the deprecating So if I want to do both typechecking and linting using npm scripts I need to do something like:
and then I can just: This is slower and much more script code than before... I wouldn't be surprised if someone will write a wrapper or fork that does both. |
So basically, I can't use |
See https://github.com/Microsoft/typescript-tslint-plugin for a (n experimental, for now) VS Code plugin that works with typed rules. |
I really hope that the maintainers listen to their community on this one. |
@kasvtv in case you missed it, TSLint is deprecated now: #4534. You'll want to switch to https://typescript-eslint.io. I hear your point and agree with the pain point, but at this point your best bet is to switch tools anyway. |
Bug Report
TypeScript code being linted
// code snippet
with
tslint.json
configuration:Actual behavior
No type checking happens.
The latest tslint recommends removing
--type-check
. I now runtslint --project tsconfig.json --config tslint.json
. Even though I havetypeCheck: true
in mytslint.json
, no type checking is performed if I remove the deprecated--type-check
.Is there a new config I am supposed to specify beyond adding typeCheck: true?
Expected behavior
Type checking happens
The text was updated successfully, but these errors were encountered: