motleyagency / eslint-config-motley

Motley (https://motley.fi) JavaScript/Typescript guidelines as ESLint rules with Prettier autoformatting
https://motley.fi
MIT License
6 stars 0 forks source link

Add TypeScript extension rules #86

Open petetnt opened 3 years ago

petetnt commented 3 years ago

We probably should have TypeScript extension rules enabled, for example:

https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js

https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#i-am-using-a-rule-from-eslint-core-and-it-doesnt-work-correctly-with-typescript-code

I am using a rule from ESLint core, and it doesn't work correctly with TypeScript code

This is a pretty common thing because TypeScript adds new features that ESLint doesn't know about.

The first step is to check our list of "extension" rules here. An extension rule is simply a rule which extends the base ESLint rules to support TypeScript syntax. If you find it in there, give it a go to see if it works for you. You can configure it by disabling the base rule, and turning on the extension rule. Here's an example with the semi rule:

{
 "rules": {
   "semi": "off",
  "@typescript-eslint/semi": "error"
 }
}

If you don't find an existing extension rule, or the extension rule doesn't work for your case, then you can go ahead and check our issues. The contributing guide outlines the best way to raise an issue.

We release a new version our tooling every week. Please ensure that you check our the latest list of "extension" rules before filing an issue.