How to use the same rules for js and ts in TSLint

I want to use the same style in .js and .ts files. I know that tslint.json has a jsRules property, but I see two problems with it:

  • Copy ant paste exactly the same rules
  • When expanding some configurations, for example. tslint-react, you will not get the rules in jsRules, which means that you need to go to the source code of the ruleset and copy it manually.

Any other way to have the same code style without having to support both eslint and tslint?

+5
source share
1 answer

eslint has several plugins to support Typescript linting. Although they are not as mature as tslint , I have used them in Javascript + Keywordsscript projects in the past:

This way you can use eslint exclusively as your linter.

0
source

Source: https://habr.com/ru/post/1272723/


All Articles