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.jsoncontaining 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 PluginandPrettier - Code formatter. - Enable 'Editor: Format on Save' setting.
- Use the
Typescript: Select Typescript Versioncommand 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
Author
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:
{ "quotemark": [true, "double"], "jsx-no-lambda": false }