How can I disable all ESLint rule checking temporarily?

Viewed 26

Existing answers about disabling ESLint answer the question "How can I disable ESLint in one file, a pattern of files, or a directory of files?" Is there an easy way to just stop a project from checking ESLint at all?

My goal here is to run a Cypress test with a debugger; command and possibly many other syntax errors due to temporary commenting out. I want to be able to test partially complete code and then toggle type checking back on. Bonus points if the solution stops TypeScript checking as well.

Things I tried that didn't work:

  • adding /* eslint-disable */ to cypress/support/e2e.js
  • launching cypress open with DISABLE_ESLINT_PLUGIN=true

My app is using create-react-app.

1 Answers

As a workaround for this, you can disable the no-debugger rule in development but leave it on in production, as per https://stackoverflow.com/a/62592912/733092:

    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn'

Another workaround is to put the per-file disable text in a PyCharm Live Template so you can auto-type

/* eslint-disable */
// @ts-nocheck 

at the top of the file you're in.

Related