Если вы не хотите go файл за файлом, добавляя эти директивы, вы можете использовать ESLint overrides . В .eslintrc
:
{
/*
Main set of properties here
...
*/
overrides: [
{
files: [
/*
List of glob patterns matching files that should have
some rules overwritten
*/
],
rules: [
/*
Add the common rules here, otherwise they'll be overwritten.
After that, add the ones you want to disable:
*/
no-param-reassign: 0,
]
},
],
}
В противном случае, если вы хотите отключить правило в одной строке, вам просто нужно сделать так:
// eslint-disable-nex-line <rule name>
Наконец, если вы хотите чтобы отключить правило во многих строках кода, вы можете использовать:
// eslint-disable <rule name>
// Code on which the rule shouldn't be applied
// ...
// eslint-enable <rule name>