Appearance
disallow ESLint directive-comments
Abuse of directive-comments may cause to overlook bugs or upset of coding style. This rule disallows a use of directive-comments.
Examples of 👎 incorrect code for this rule:
You can specify allowed directive-comments.
{ "@eslint-community/eslint-comments/no-use": ["error", {"allow": []}] }
allow
"eslint"
"eslint-disable"
"eslint-disable-line"
"eslint-disable-next-line"
"eslint-enable"
"eslint-env"
"exported"
"global"
"globals"
This rule cannot prevent the following case:
/* eslint @eslint-community/eslint-comments/no-use: off */
Because ESLint addresses the directive-comment before parsing.
@eslint-community/eslint-comments/no-use
Abuse of directive-comments may cause to overlook bugs or upset of coding style. This rule disallows a use of directive-comments.
Rule Details
Examples of 👎 incorrect code for this rule:
Options
You can specify allowed directive-comments.
allow
option is an array to allow specified directive-comments. The value of the array is some of the following strings:"eslint"
"eslint-disable"
"eslint-disable-line"
"eslint-disable-next-line"
"eslint-enable"
"eslint-env"
"exported"
"global"
"globals"
Known Limitations
This rule cannot prevent the following case:
Because ESLint addresses the directive-comment before parsing.