Closed glen-84 closed 1 year ago
What is "tslint.jsEnable": true
suppose to do anyway? I have typescript and tslint installed globally (tslint@5.12.0, typescript@3.2.2) and have this extension installed in my vscode. I expected for typescript linting to work without the need for // @ts-check
in my js files, but it doesn't.
@SharakPL,
It tells this VS Code extension to lint the file. However, tslint
itself won't lint the file unless you set jsRules
to true
in your tslint.json/yaml
file (where true
could also be a list of JS-compatible rules).
I used tslint --init
in my terminal to create tslint.json file, then changed "jsRules": {}
to "jsRules": true
and I think tslint.jsEnable
should stay false by default, because it's messing with eslint rules that are more commonly used in .js files. I guess it's better to keep those two separate.
What I would like is simple type checking in js files without the need for // @ts-check
in each files and let eslint do the linting.
@SharakPL,
jsRules
if you don't want tslint
to lint JavaScript files.checkJs
to true
in tsconfig.json
if you want TypeScript to check all JavaScript files.PS. This is off-topic.
Closing as TSLint has been deprecated in favor of ESLint and this extension is no longer being maintained
Please look into migrating to use ESLint and the ESLint VS Code extension
Or, better yet, base it on the presence of
jsRules
intslint.json
.It's somewhat surprising that if you:
allowJs
totrue
intsconfig.json
, andjsRules
totrue
(or to a non-empty object) intslint.json
... there is still no linting in JS files.