microsoft / vscode-typescript-tslint-plugin

VS Code extension that provides TSLint support using the typescript-tslint-plugin
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
MIT License
188 stars 34 forks source link

Change default of "tslint.jsEnable" to true (?) #39

Closed glen-84 closed 1 year ago

glen-84 commented 5 years ago

Or, better yet, base it on the presence of jsRules in tslint.json.

It's somewhat surprising that if you:

... there is still no linting in JS files.

SharakPL commented 5 years 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.

glen-84 commented 5 years ago

@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).

SharakPL commented 5 years ago

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.

glen-84 commented 5 years ago

@SharakPL,

  1. Remove jsRules if you don't want tslint to lint JavaScript files.
  2. Set checkJs to true in tsconfig.json if you want TypeScript to check all JavaScript files.

PS. This is off-topic.

mjbvz commented 1 year ago

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