Skip to content

Directive No Use

Suggestion
small-rules/directive-no-use

Disallow block ESLint/Oxlint directive comments.

Diagnostic Messages

disallow
Unexpected ESLint directive comment.

Configuration

This rule accepts one options object after the severity.

allowOptional

Directive kinds that are still allowed in block comments.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/directive-no-use": [
"error",
{
"allow": [
"oxlint-disable"
]
}
]
}
}

Examples

Disallow block directive comments
/* oxlint-disable no-console */
const x = 1;
Allow configured directive comment
/* oxlint-disable no-console */
const x = 1;