Skip to content

Commit 43af24a

Browse files
nzakassnitin315
andauthored
docs: Add explanation of when to use 'warn' severity (#16882)
* docs: Add explanation of when to use 'warn' severity Fixes #16696 Closes #16753 * Update docs/src/use/configure/rules.md Co-authored-by: Nitin Kumar <[email protected]> --------- Co-authored-by: Nitin Kumar <[email protected]>
1 parent 71f6f0d commit 43af24a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/src/use/configure/rules.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ To change a rule's severity, set the rule ID equal to one of these values:
2020
* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
2121
* `"error"` or `2` - turn the rule on as an error (exit code is 1 when triggered)
2222

23+
Rules are typically set to `"error"` to enforce compliance with the rule during continuous integration testing, pre-commit checks, and pull request merging because doing so causes ESLint to exit with a non-zero exit code.
24+
25+
If you don't want to enforce compliance with a rule but would still like ESLint to report the rule's violations, set the severity to `"warn"`. This is typically used when introducing a new rule that will eventually be set to `"error"`, when a rule is flagging something other than a potential buildtime or runtime error (such as an unused variable), or when a rule cannot determine with certainty that a problem has been found (when a rule might have false positives and need manual review).
26+
2327
### Using configuration comments
2428

2529
To configure rules inside of a file using configuration comments, use a comment in the following format:

0 commit comments

Comments
 (0)