allow option is an array to allow specified directive-comments. The value of the array is some of the following strings or one of the strings in additionalDirectives:
"eslint"
"eslint-disable"
"eslint-disable-line"
"eslint-disable-next-line"
"eslint-enable"
"eslint-env"
"exported"
"global"
"globals"
additionalDirectives - By default, only the above-mentioned ESLint-based comments are prohibited when not in the allow array. If you wish to prohibit other comments, e.g., istanbul or c8 for coverage, you can add them to this string array. Note that it is possible we may not be able to detect comments for some non-JavaScript languages.
@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.
allowoption is an array to allow specified directive-comments. The value of the array is some of the following strings or one of the strings inadditionalDirectives:"eslint""eslint-disable""eslint-disable-line""eslint-disable-next-line""eslint-enable""eslint-env""exported""global""globals"additionalDirectives- By default, only the above-mentioned ESLint-based comments are prohibited when not in theallowarray. If you wish to prohibit other comments, e.g.,istanbulorc8for coverage, you can add them to this string array. Note that it is possible we may not be able to detect comments for some non-JavaScript languages.Known Limitations
This rule cannot prevent the following case:
Because ESLint addresses the directive-comment before parsing.