Skip to content

Commit 1472147

Browse files
committed
feat(linter): move no-unused-expressions to correctness (#14099)
- closes #13796 Moves `no-unused-expressions` rule to be `correctness` and run by default. Also updates the config to have a JSON schema so that we can show the auto-generate the config options on the website.
1 parent 07a0c86 commit 1472147

File tree

52 files changed

+245
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+245
-180
lines changed

apps/oxlint/src/snapshots/_--ignore-path fixtures__linter__.customignore --no-ignore [email protected]

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ arguments: --ignore-path fixtures/linter/.customignore --no-ignore fixtures/lint
66
working directory:
77
----------
88

9+
! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-expressions.html\eslint(no-unused-expressions)]8;;\: Expected expression to be used
10+
,-[fixtures/linter/nan.js:1:1]
11+
1 | 123 == NaN;
12+
: ^^^^^^^^^^^
13+
`----
14+
help: Consider using this expression or removing it
15+
916
! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/use-isnan.html\eslint(use-isnan)]8;;\: Requires calls to isNaN() when checking for NaN
1017
,-[fixtures/linter/nan.js:1:8]
1118
1 | 123 == NaN;
1219
: ^^^
1320
`----
1421
help: Use the isNaN function to compare with NaN.
1522

16-
Found 1 warning and 0 errors.
17-
Finished in <variable>ms on 1 file with 88 rules using 1 threads.
23+
Found 2 warnings and 0 errors.
24+
Finished in <variable>ms on 1 file with 89 rules using 1 threads.
1825
----------
1926
CLI result: LintSucceeded
2027
----------

apps/oxlint/src/snapshots/_--ignore-pattern _____.js --ignore-pattern _____.vue [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --ignore-pattern **/*.js --ignore-pattern **/*.vue fixtures/linter
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 0 files with 88 rules using 1 threads.
9+
Finished in <variable>ms on 0 files with 89 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--import-plugin -A all -D no-cycle [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --import-plugin -A all -D no-cycle fixtures/flow/
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 2 files with 90 rules using 1 threads.
9+
Finished in <variable>ms on 2 files with 91 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--import-plugin [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --import-plugin fixtures/flow/index.mjs
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 90 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 91 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--vitest-plugin -c fixtures__eslintrc_vitest_replace__eslintrc.json [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ working directory:
2323
help: Remove the appending `.skip`
2424
2525
Found 1 warning and 1 error.
26-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
26+
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
2727
----------
2828
CLI result: LintFoundErrors
2929
----------

apps/oxlint/src/snapshots/_-D correctness [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory:
1414
help: Remove the debugger statement
1515
1616
Found 0 warnings and 1 error.
17-
Finished in <variable>ms on 1 file with 88 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 89 rules using 1 threads.
1818
----------
1919
CLI result: LintFoundErrors
2020
----------

apps/oxlint/src/snapshots/_-W correctness -A no-debugger [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: -W correctness -A no-debugger fixtures/linter/debugger.js
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 87 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 88 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_-W no-undef -c fixtures__eslintrc_env__eslintrc_no_env.json [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ working directory:
1313
`----
1414
1515
Found 1 warning and 0 errors.
16-
Finished in <variable>ms on 1 file with 89 rules using 1 threads.
16+
Finished in <variable>ms on 1 file with 90 rules using 1 threads.
1717
----------
1818
CLI result: LintSucceeded
1919
----------

apps/oxlint/src/snapshots/_-W no-undef -c fixtures__no_undef__eslintrc.json [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ working directory:
1313
`----
1414
1515
Found 1 warning and 0 errors.
16-
Finished in <variable>ms on 1 file with 89 rules using 1 threads.
16+
Finished in <variable>ms on 1 file with 90 rules using 1 threads.
1717
----------
1818
CLI result: LintSucceeded
1919
----------

apps/oxlint/src/snapshots/_-c fixtures__config_ignore_patterns__ignore_extension__eslintrc.json [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ working directory:
1212
help: Delete this file or add some code to it.
1313
1414
Found 1 warning and 0 errors.
15-
Finished in <variable>ms on 1 file with 88 rules using 1 threads.
15+
Finished in <variable>ms on 1 file with 89 rules using 1 threads.
1616
----------
1717
CLI result: LintSucceeded
1818
----------

0 commit comments

Comments
 (0)