Search code examples
tslintreact-scripts

Is it possible to disable TSLint in tslint.json?


I use react-scripts-ts to generate React App and it supplies TSLint.

It seems like there's no option to tell react-scripts-ts to exclude TSLint from the build pipeline. Is it possible to disable TSLint via tslint.json?

P.S.

It's possible to disable it by adding comment to the file, but I don't want to add such comment to every TS file in the project.


Solution

  • If you don't want any TSLint rules to be enforced and are prepared to edit the tslint.json file, you can just set its content to:

    {}
    

    With no rules defined, you will see this message written to the console:

    No valid rules have been specified
    

    But the TSLint process with terminate with an exit code of 0 and should not interfere with your build pipeline.

    Or, if the message bugs you, define a single rule that's switched off:

    { "rules": { "no-var-keyword": false } }