Disable One ESLint Rule Globally in Typescript

janac
Jun 21, 2021

In your Typescript project, you should have your ESlint configs in either .eslintrc (more likely), or package.json (less likely).

To disable an ESLint rule on a single rule, you can do this:

// eslint-disable-next-line no-console
console.error(error);

To disable that same rule project-wide, you can do this in your .eslintrc file:

module.exports = {
parserOptions: {
project: './tsconfig.json',
},
rules: {
'no-console': 'off',
},
};

--

--

janac

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am senior software consultant at LazerTechnologies.com.