在.eslintrc
配置文件中设置规则。如果使用的是.eslintrc.js
、.eslintrc.json
或类似的配置文件,可以将no-unexpected-multiline
和no-multi-spaces
规则设置为"off"
或0
。
module.exports = {
"rules": {
// 关闭不期望的多行间隔
"no-unexpected-multiline": "off",
// 关闭不期望的多个空格
"no-multi-spaces": "off",
// 其他的ESLint规则保持默认或你自己的配置
}
};
如果是在命令行中运行ESLint,并希望临时关闭这些规则,可以在命令中使用--rules
选项:
eslint --rules '{"no-unexpected-multiline": "off", "no-multi-spaces": "off"}' yourfile.js