[英]Modify an ESLint rule for a single line
I'm aware of the single-line syntax to disable an ESLint rule for the current or next line.我知道禁用当前行或下一行的 ESLint 规则的单行语法。
What I would like to know is if there is something similar to modify a rule for a specific line.我想知道的是是否有类似的东西可以修改特定行的规则。
Eg:例如:
// eslint-modify-next-line yoda: ["error", "never", {"exceptRange": true}]
if (0 < count && count <= max) {
// do something
}
据我所知,您不能修改单行的规则,但您可以使用ESLint 配置注释修改整个文件的规则
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.