yarn add prettier tslint tslint-config-prettier tslint-react typescript-tslint-plugin
- Add the following to
tsconfig.json
:"plugins": [ { "name": "typescript-tslint-plugin" } ]
- Create
tslint.json
containing the following:{ "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"], "linterOptions": { "exclude": [ "node_modules/**/*.ts", ] }, "rules": { // your custom rules here } }
- In Visual Studio Code:
- Install extensions:
TypeScript TSLint Plugin
andPrettier - Code formatter
. - Enable 'Editor: Format on Save' setting.
- Use the
Typescript: Select Typescript Version
command to selectUse Workspace Version
. - Restart Visual Studio Code.
- Install extensions:
Last active
December 23, 2018 19:51
-
-
Save doxxx/be29aee5e414e7ac424c77cd62afaef5 to your computer and use it in GitHub Desktop.
Steps to add TSLint to create-react-app project using the Typescript compiler plugin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Custom TSLint rules that I like to use: