Skip to content

Commit db8b963

Browse files
committed
docs: mention best practice for disabling a rule for an entire file
1 parent 57dac84 commit db8b963

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/rules/disable-enable-pair.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,9 @@ var foo = bar()
7272
var fizz = buzz()
7373
/*eslint-enable no-unused-vars */
7474
" />
75+
76+
Note however that if your goal is to disable a rule for an entire file, it's better practice and more effective to use the following comment style instead (which actually disables the rule for the entire file instead of just starting after the `eslint-disable` comment):
77+
78+
<eslint-playground type="good" code="/*eslint no-undef:"off" */
79+
var foo = bar()
80+
" />

0 commit comments

Comments
 (0)