create-react-app-typescript icon indicating copy to clipboard operation
create-react-app-typescript copied to clipboard

tslint reference

Open Kaffiend opened this issue 7 years ago • 4 comments

project root tslint.json should take precedence over packaged tslint.json to change any rules you have to dig through node_modules and change the package tslint.json

Edit: even though the editor doesnt complain when coding, the build still fails.

Kaffiend avatar Mar 05 '18 05:03 Kaffiend

Run into same problem. Changing project tslint.json doesn't seem to have any effect

I didn't even manage to find location of packaged tslint.json... @Kaffiend where did you find it?

boyangwang avatar Mar 17 '18 08:03 boyangwang

@boyangwang Its in the libs directory under your node_modules you have to dig through there and change it instead of the generated project tslint.json

Kaffiend avatar Mar 17 '18 16:03 Kaffiend

Hi, I got it working. After some digging , I found that tslint.json is being used correctly. But, if you are seeing error from js files, then you need to add jsRules in tslint.json, parallel to rules... and then override whichever rules to suppress errors/warnings

boyangwang avatar Mar 17 '18 17:03 boyangwang

by default tslint.json doesn't have the rules property. Adding it solved it for me.

{
  "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
  "rules": {
    "interface-name": false,
    "no-empty-interface": false,
    "ordered-imports": false,
    "interface-over-type-literal": false
  },
  "linterOptions": {
    "exclude": [
      "config/**/*.js",
      "node_modules/**/*.ts"
    ]
  }
}

hanorine avatar May 13 '18 17:05 hanorine