From bc05ba170bcc0ca16984ab1150221fd2bc76ab99 Mon Sep 17 00:00:00 2001 From: dosisod <39638017+dosisod@users.noreply.github.com> Date: Mon, 7 Mar 2022 19:34:59 -0800 Subject: [PATCH 1/3] docs: Add clarification about eslint-enable rule: See #15662 --- docs/user-guide/configuring/rules.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/user-guide/configuring/rules.md b/docs/user-guide/configuring/rules.md index c33a64ad4f2..111a543b716 100644 --- a/docs/user-guide/configuring/rules.md +++ b/docs/user-guide/configuring/rules.md @@ -144,6 +144,8 @@ console.log('bar'); /* eslint-enable no-alert, no-console */ ``` +**Note:** `/* esline-enable */` without any specific rules will cause all errors to be re-enabled. You will have to re-specify the errors you wish to keep disabled. + To disable rule warnings in an entire file, put a `/* eslint-disable */` block comment at the top of the file: ```js @@ -160,6 +162,14 @@ You can also disable or enable specific rules for an entire file: alert('foo'); ``` +To ensure that a rule is never applied (regardless of any future enable/disable lines): + +```js +/* eslint no-alert: "off" */ + +alert('foo'); +``` + To disable all rules on a specific line, use a line or block comment in one of the following formats: ```js From ef669d45b57ae1d0f32dda79d708e1113ac10f35 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Tue, 8 Mar 2022 17:32:56 -0800 Subject: [PATCH 2/3] Update docs/user-guide/configuring/rules.md --- docs/user-guide/configuring/rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/configuring/rules.md b/docs/user-guide/configuring/rules.md index 111a543b716..a8ed22a0321 100644 --- a/docs/user-guide/configuring/rules.md +++ b/docs/user-guide/configuring/rules.md @@ -144,7 +144,7 @@ console.log('bar'); /* eslint-enable no-alert, no-console */ ``` -**Note:** `/* esline-enable */` without any specific rules will cause all errors to be re-enabled. You will have to re-specify the errors you wish to keep disabled. +**Note:** `/* esline-enable */` without any specific rules listed will cause all disabled rules to be re-enabled. To disable rule warnings in an entire file, put a `/* eslint-disable */` block comment at the top of the file: From aa1e5713399d57038a3bbdeb98ca4ee73905f3a1 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Wed, 9 Mar 2022 12:29:52 +0100 Subject: [PATCH 3/3] Update docs/user-guide/configuring/rules.md --- docs/user-guide/configuring/rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/configuring/rules.md b/docs/user-guide/configuring/rules.md index a8ed22a0321..205a5f11995 100644 --- a/docs/user-guide/configuring/rules.md +++ b/docs/user-guide/configuring/rules.md @@ -144,7 +144,7 @@ console.log('bar'); /* eslint-enable no-alert, no-console */ ``` -**Note:** `/* esline-enable */` without any specific rules listed will cause all disabled rules to be re-enabled. +**Note:** `/* eslint-enable */` without any specific rules listed will cause all disabled rules to be re-enabled. To disable rule warnings in an entire file, put a `/* eslint-disable */` block comment at the top of the file: