简体   繁体   中英

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.

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 配置注释修改整个文件的规则

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM