-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(linter): allow eslintrc to add rule when overriding (#1984)
Fix a bug introduced in #1966. Ideally, the rules in eslintrc should be merged into final rules as described: > The rules will start with the categories we apply, and then merge all the configurations stated in the rules field. > > For example, if we begin with -D correctness with 80 rules, then > > "no-empty-file": "off" will remove the rule, yielding 79 rules > "no-empty": "error" (restriction) will add the rule, yield 81 rules > ""no-empty": ["error", { "allowEmptyCatch": true }]` add the rule's configuration However, the implementation did not include the newly added rules in the eslintrc. As a test case and example, I added a new fixture to `crates/oxc_cli/fixtures/no_undef`. No warn or deny will be found without this PR. This is my first Rust PR ever. Any nitpicking suggestions are welcome. Thanks! 😊
- Loading branch information
Showing
5 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"no-undef": "warn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters