-
-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(linter): inherit
rules
via the extended config files
- Loading branch information
Showing
14 changed files
with
324 additions
and
15 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 @@ | ||
console.log("test"); |
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 @@ | ||
{} |
3 changes: 3 additions & 0 deletions
3
apps/oxlint/fixtures/extends_config/extends_invalid_config.json
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,3 @@ | ||
{ | ||
"extends": ["./invalid_config.json"] | ||
} |
3 changes: 3 additions & 0 deletions
3
apps/oxlint/fixtures/extends_config/extends_rules_config.json
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,3 @@ | ||
{ | ||
"extends": ["./rules_config.json"] | ||
} |
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,3 @@ | ||
{ | ||
invalid | ||
} |
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,7 @@ | ||
{ | ||
"rules": { | ||
"no-debugger": "off", | ||
"no-console": "error", | ||
"unicorn/no-null": "error" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
apps/oxlint/fixtures/extends_config/rules_multiple/allow_all.json
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,9 @@ | ||
{ | ||
"rules": { | ||
"no-console": "off", | ||
"no-var": "off", | ||
"oxc/approx-constant": "off", | ||
"unicorn/no-null": "off", | ||
"unicorn/no-array-for-each": "off" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
apps/oxlint/fixtures/extends_config/rules_multiple/deny_all.json
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,9 @@ | ||
{ | ||
"rules": { | ||
"no-console": "error", | ||
"no-var": "error", | ||
"oxc/approx-constant": "error", | ||
"unicorn/no-null": "error", | ||
"unicorn/no-array-for-each": "error" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
apps/oxlint/fixtures/extends_config/rules_multiple/warn_all.json
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,9 @@ | ||
{ | ||
"rules": { | ||
"no-console": "warn", | ||
"no-var": "warn", | ||
"oxc/approx-constant": "warn", | ||
"unicorn/no-null": "warn", | ||
"unicorn/no-array-for-each": "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
20 changes: 20 additions & 0 deletions
20
...pshots/fixtures__extends_config_--config extends_rules_config.json console.js@oxlint.snap
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,20 @@ | ||
--- | ||
source: apps/oxlint/src/tester.rs | ||
--- | ||
########## | ||
arguments: --config extends_rules_config.json console.js | ||
working directory: fixtures/extends_config | ||
---------- | ||
|
||
x ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-console.html\eslint(no-console)]8;;\: eslint(no-console): Unexpected console statement. | ||
,-[console.js:1:1] | ||
1 | console.log("test"); | ||
: ^^^^^^^^^^^ | ||
`---- | ||
help: Delete this console statement. | ||
Found 0 warnings and 1 error. | ||
Finished in <variable>ms on 1 file with 101 rules using 1 threads. | ||
---------- | ||
CLI result: LintFoundErrors | ||
---------- |
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
Oops, something went wrong.