Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable multiple rules for eslint nextline

People also ask

How do I disable the ESLint rule in a folder?

0+ use "ignorePatterns": []. You can tell ESLint to ignore specific files and directories using ignorePatterns in your config files.


If you want to disable multiple ESLint errors, you can do the following (note the commas):

  • For the next line:
// eslint-disable-next-line no-return-assign, no-param-reassign
( your code... )
  • For this line:
( your code... ) // eslint-disable-line no-return-assign, no-param-reassign
  • Or alternatively for an entire code block (note that this only works with multi-line comment syntax):
/* eslint-disable no-return-assign, no-param-reassign */
( your code... )
/* eslint-enable no-return-assign, no-param-reassign */

See the Configuring Rules section of the ESLint documentation.

(Though it might be a better choice to simply disable these errors in your .eslintrc file if you can't follow certain rules all the time.)


You should use commas instead.

/* eslint-disable-next-line no-return-assign, no-param-reassign */
const subTotal = orderInfo.details.reduce((acc, cv) => acc += Number(cv.price) * Number(cv.quantity), 0);