Releases: oxc-project/oxc
oxlint v0.1.2
Try it out!
- Run
npx --yes oxlint@latest
from your terminal - Install the Vscode extension https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
- Read the usage guide
Svelte support
<script>
tag is linted by default.
Features
- feat(linter): <script> part of svelte file by @Boshen in #1918
- feat(linter): disable no-unused-labels for svelte by @Boshen in #1919
Fixes
- fix(linter): change no-var to restriction bb6128b
- chore: add some useful informantion log by @IWANABETHATGUY in #1912
- fix(linter) fix eslint config for filename case by @camc314 in #1913
Full Changelog: oxlint_v0.1.1...oxlint_v0.1.2
oxlint v0.1.1
Try it out!
- Run
npx --yes oxlint@latest
from your terminal - Install the Vscode extension https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
- Read the usage guide
Vue support
<script>
and <script setup>
are linted by default.
Astro support
Frontmatter component script ---
and all <script>
tags are linted by default.
Configuration files (experimental)
-c ./eslintrc.json
will use the rules
field for rule configuration, as documented in ESLint's documentation.
Unfortunately, only the json
format is supported right now.
The extends
field will not take effect; normal -D
and -A
flags still apply.
New Rules
Correctness
- deepscan: bad object literal comparison by @camc314 in #1844
- oxc: erasing op by @camc314 in #1834
- oxc: only used in recursion by @camc314 in #1833
- eslint: no irregular whitespace by @DeividAlmeida in #1877
- eslint: no-unused-private-class-members rule by @Dunqing in #1820
- eslint: no-var by @zhangrunzhao in #1890
- eslint-plugin-react: jsx-no-undef for by @XantreGodlike in #1862
- eslint-plugin-jsx-a11y: aria-role by @msdlisper in #1849
- eslint-plugin-jsx-a11y: lang by @msdlisper in #1812
- eslint-plugin-jsx-a11y: media-has-caption by @poteboy in #1822
- eslint-plugin-jsx-a11y: mouse-events-have-key-events(correctness) by @Ken-HH24 in #1867
- eslint-plugin-jsx-a11y: prefer-tag-over-role rule by @yossydev in #1831
- eslint-plugin-jsx-a11y: aria-unsupported-elements by @re-taro in #1855
- eslint-plugin-jsx-a11y: html_has_lang by @msdlisper in #1843
Suspicious
Restriction
Fixes
- fix(linter): ignore anonymous functional components in arrays for eslint-plugin-react(jsx-key) by @maurice in #1858
- Prioritize ignored paths when linting by @clarkf in #1878
- feat(linter): handle more cases for
const-comparisons
by @camc314 in #1817 - feat(semantic): allow reserved keyword defined in ts module block by @Dunqing in #1907
- fix(parser): error on source larger than 4 GiB by @overlookmotel in #1860
- fix(parser): fix incorrectly identified directives by @overlookmotel in #1885
- fix(parser): terminate parsing if an EmptyParenthesizedExpression error occurs by @Dunqing in #1874
- fix(semantic): remove duplicate errors in ModuleDeclaration::ImportDeclaration by @Dunqing in #1846
- perf(linter): reduce the number of diagnostics for no_sparse_arrays by @camc314 in #1895
New Contributors
- @maurice made their first contribution in #1858
- @re-taro made their first contribution in #1855
- @DeividAlmeida made their first contribution in #1835
- @XantreGodlike made their first contribution in #1862
- @Qix- made their first contribution in #1861
- @yossydev made their first contribution in #1831
- @clarkf made their first contribution in #1878
- @zhangrunzhao made their first contribution in #1890
Full Changelog: oxlint_v0.0.22...oxlint_v0.1.1
oxlint v0.0.22
What's Changed
New Rules
Reports errors when a comparison is redundant, or impossible.
A redundant check would be foo > 5 && foo > 10
An impossible check would be foo > 5 && foo < 5
https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_comparisons
https://rust-lang.github.io/rust-clippy/master/index.html#/impossible
https://rust-lang.github.io/rust-clippy/master/index.html#/double_comparisons
- deepscan: bad char at comparison by @camc314 in #1750
- deepscan: bad replace all arg by @camc314 in #1749
- eslint-plugin-jsx-a11y: aria-props by @poteboy in #1797
- eslint-plugin-jsx-a11y: no-aria-hidden-on-focusable by @poteboy in #1795
- eslint-plugin-jsx-a11y: no-distracting-elements rule by @tapanprakasht in #1767
Performance
10 - 20% faster than the previous version.
Sampling from an internal codebase (119900 files) - Before 12.8s vs 11.2s after.
- precompute
rule.name()
by @Boshen in #1759 - reduce the
RuleEnum
enum size from 168 to 16 bytes by @Boshen in #1783
Improvements
- vscode: don't lint files in .gitignore and .eslintignore by @IWANABETHATGUY in #1765
- improve span for
no useless catch
by @camc314 in #1731 - no-cond-assign: span points to the operator by @Dunqing in #1739
- no-useless-escape support auto fix by @Dunqing in #1743
- improve span for
no-unneccessary-await
by @camc314 in #1732 - improve span of
bad-remove-event-listener
, merge rules by @camc314 in #1734 - shrink span for
prefer-string-starts-with-ends-with
by @camc314 in #1730 - improve the help message for const-comparisons by @Boshen in #1764
- use simd (memchr) for no-useless-escape search by @Boshen in #1766
Fixes
- skip run lint when
--rules
is passed by @camc314 in #1747 - conflict between
--import-plugin
and-D correctness
by @camc314 in #1729 - support read the third item in config file by @mysteryven in #1771
- correct example and docs url for number_arg_out_of_range by @legend80s in #1737
- false positives for empty brace spaces by @camc314 in #1742
- fix incorrect report in
prefer-string-replace-all
by @camc314 in #1796 - fix a typo in no_redeclare message by @modderme123 in #1789
- eslint/no-obj-calls: correctly resolves the binding name by @Dunqing in #1738
parser
- refactor(ast): introduce
ThisParameter
by @magic-akari in #1728 - refactor(parser): report
this
parameter error by @magic-akari in #1788
New Contributors
- @legend80s made their first contribution in #1737
- @tapanprakasht made their first contribution in #1767
- @modderme123 made their first contribution in #1789
- @poteboy made their first contribution in #1795
- @overlookmotel made their first contribution in #1801
Full Changelog: oxlint_v0.0.21...oxlint_v0.0.22
oxlint v0.0.21
What's Changed
Features
Read eslint JSON configuration (experimental)
Added the configuration flag -c .eslintrc.json
.
Oxlint will override all the enabled rules to what's specified in rules
, e.g.
{
"rules": {
"eqeqeq": "off",
"curly": "error",
"quotes": ["error", "double"]
}
}
- Parse eslint configuration by @camc314 in #1146
- Read jsx-a11y settings by @msdlisper in #1668
New Rules
- eslint-plugin-jsx-a11y: no-access-key (correctness) by @yoshi2no in #1708
- eslint-plugin-jsx-a11y: tabindex-no-positive (correctness) by @yoshi2no in #1677
- eslint-plugin-import: export rule (nursery) by @mysteryven in #1654
- eslint-plugin-unicorn: no-null (style) by @Ken-HH24 in #1705
- eslint-plugin-unicorn: prefer-dom-node-text-content (style) by @Ken-HH24 in #1658
- eslint-plugin-unicorn: prefer-prototype-methods (pedantic) by @haocheng6 in #1660
vscode
- use icon to represent enabled status by @IWANABETHATGUY in #1675
- add option to control enable/disable oxc linter by @IWANABETHATGUY in #1665
- report problem more accurately by @IWANABETHATGUY in #1681
Fixes
- fix(parser): false postive for "Missing initializer in const declaration" in declare + namespace by @Boshen in #1724
- convert catch error name to a warning by @camc314 in #1700
- Don't check for multiple bits at once. by @AndyA in #1688
- Fix false positives in prefer string start, ends with, port more test cases by @camc314 in #1689
- Panic in prefer string starts, ends with by @camc314 in #1684
- excape_case by @RiESAEX in #1673
- false positive in jsx key by @camc314 in #1686
- improve diagnostic for no useless spread by @camc314 in #1698
- perf(linter): find class node by symbols in get_parent_es6_component by @Dunqing in #1657
- refactor(linter): make some jest rules report more detailed by @mysteryven in #1666
New Contributors
- @HerringtonDarkholme made their first contribution in #1680
- @yoshi2no made their first contribution in #1677
- @fireairforce made their first contribution in #1682
- @AndyA made their first contribution in #1688
Full Changelog: oxlint_v0.0.20...oxlint_v0.0.21
oxlint v0.0.20
What's Changed
- eslint-plugin-unicorn: prefer-modern-dom-apis (style) by @Ken-HH24 in #1646
- eslint-plugin-react: react-in-jsx-scope by @camc314 in #1025
- eslint plugin unicorn: prefer array flat by @camc314 in #1650
- vscode: add a option to control oxc lint timing by @IWANABETHATGUY in #1659
- improve span for no accumulating spread by @camc314 in #1644
Full Changelog: oxlint_v0.0.19...oxlint_v0.0.20
oxlint v0.0.19
Try it out!
- Run
npx --yes oxlint@latest
from your terminal - Install the Vscode extension https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
New Rules
Performance
This is a new category turned off by default. See it in action with
npx --yes oxlint@latest -D perf
Did you know that the reudce
+ ...spread
combo is an O(n^2)
operation?
Read https://prateeksurana.me/blog/why-using-object-spread-with-reduce-bad-idea/ for detailed explaination.
noAccumulatingSpread
is also part of Biome since v1.
Correctness
- eslint-plugin-unicorn: no-useless-length check by @radu2147 in #1541
- eslint-plugin-unicorn: no-useless-spread by @camc314 in #1638
- eslint-plugin-unicorn: prefer-set-size by @camc314 in #1508
- eslint-plugin-jsx-a11y: anchor-is-valid for by @msdlisper in #1477
- eslint-plugin-jsx-a11y: heading-has-content for by @Ken-HH24 in #1501
- eslint-plugin-jsx-a11y: iframe-has-title rule by @Shinyaigeek in #1589
- eslint-plugin-jsx-a11y: img-redundant-alt by @Shinyaigeek in #1571
- eslint-plugin-jsx-a11y: no-autofocus by @msdlisper in #1641
- eslint-plugin-jsx-a11y: scope by @Shinyaigeek in #1609
- eslint-plugin-react: no-is-mounted for by @Ken-HH24 in #1550
Pedantic
- eslint-plugin-unicorn: prefer-native-coercion-functions (pedantic) by @camc314 in #1507
- eslint-plugin-unicorn: no-unreadable-iife by @haocheng6 in #1572
- eslint-plugin-unicorn: escape-case by @RiESAEX in #1495
- eslint-plugin-unicorn: explicit-length-check by @RiESAEX in #1617
Suspicious
Restriction
- eslint-plugin-unicorn: no-array-foreach by @camc314 in #1613
- eslint-plugin-unicorn: no-array-reduce by @camc314 in #1610
- eslint-plugin-unicorn: prefer number properties by @camc314 in #1614
Style
- eslint-plugin-unicorn: no-await-expression-member by @Ken-HH24 in #1569
- eslint-plugin-unicorn: no-unreadable-array-destructuring (style) by @Ken-HH24 in #1594
- eslint-plugin-unicorn: numeric-separators-style (style) by @sirreal in #1490
- eslint-plugin-unicorn: prefer-node-protocol by @IWANABETHATGUY in #1618
- eslint-plugin-unicorn: prefer-reflect-apply(style) by @Ken-HH24 in #1628
- eslint-plugin-unicorn: require-array-join-separator(style) by @Ken-HH24 in #1608
Fixes
- feat(ast): implement new proposal-import-attributes by @magic-akari in #1476
- fix(linter): fix panic in no hex escape by @camc314 in #1540
New Contributors
- @JonaAnders made their first contribution in #1496
- @Shinyaigeek made their first contribution in #1571
- @milesj made their first contribution in #1510
Full Changelog: oxlint_v0.0.18...oxlint_v0.0.19
oxlint v0.0.18
Try it out!
- Run
npx --yes oxlint@latest
from your terminal - Install the Vscode extension https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
oxlint has 78 correctness rules turned on by default, with 164 rules in total.
What's Changed
Features
- Add
--deny-warnings
flag by @shannonrothe in #1452
If you wish to fail CI with exit code 1, pin oxlint
to a version and use the --deny-warnings
flag:
npx [email protected] --deny-warnings
Notice $?
prints 1
.
New Rules
Correctness
- eslint-plugin-unicorn: no document cookie by @camc314 in #1255
- eslint-plugin-unicorn: prefer string starts ends with by @camc314 in #1246
- eslint-plugin-jsx-a11y: anchor-has-content by @msdlisper in #1431
- eslint-plugin-jsx-a11y: html-has-lang for by @Ken-HH24 in #1436
Pedantic
- eslint-plugin-unicorn: no lonely if by @camc314 in #1252
- eslint-plugin-unicorn: no negated condition by @camc314 in #1253
- eslint-plugin-unicorn: no this assignment by @camc314 in #1250
- eslint-plugin-unicorn: no typeof undefined by @camc314 in #1251
- eslint-plugin-unicorn: no useless promise resolve reject by @camc314 in #1254
- eslint-plugin-unicorn: prefer array some by @camc314 in #1467
- eslint-plugin-unicorn: prefer dom node append by @camc314 in #1256
- eslint-plugin-unicorn: prefer dom node dataset by @camc314 in #1257
- eslint-plugin-unicorn: prefer dom node remove by @camc314 in #1472
- eslint-plugin-unicorn: prefer event target by @camc314 in #1465
- eslint-plugin-unicorn: prefer math trunc by @camc314 in #1466
- eslint-plugin-unicorn: prefer string replace all by @camc314 in #1248
- eslint-plugin-unicorn: no useless switch case by @camc314 in #1463
- eslint-plugin-unicorn: no-hex-escape by @RiESAEX in #1410
Restriction
- eslint: no-regex-spaces by @ivov in #1129
- eslint-plugin-unicorn: no-abusive-eslint-disable by @haocheng6 in #1125
- eslint-plugin-unicorn: no-nested-ternary by @haocheng6 in #1417
Style
- eslint plugin unicorn: empty-brace-spaces by @radu2147 in #1249
- eslint plugin unicorn: no zero fractions by @camc314 in #1464
- eslint plugin unicorn: prefer includes by @camc314 in #1471
- eslint-plugin-unicorn: prefer string slice by @camc314 in #1247
- eslint-plugin-unicorn: number-literal-case by @haocheng6 in #1271
- eslint-plugin-jest: max_expects by @eryue0220 in #1239
- eslint-plugin-jest: no-deprecated-function by @eryue0220 in #1316
Fixes
- eslint(for-direction): add check for condition in reverse order by @ild0tt0re in #1418
- Fix catch error name with parenthesis by @camc314 in #1242
- Fix no instanceof array with parenthesis by @camc314 in #1243
- Fix no object as default param with parenthesis by @camc314 in #1244
- Fix prefer date now with parenthesis by @camc314 in #1245
- Fix prefer logical operator error with parenthesis by @camc314 in #1241
- Fix prefer type error with parenthesis by @camc314 in #1240
- fix(parser): Disallow ReservedWord in NamedExports by @magic-akari in #1230
Misc
New Contributors
- @msdlisper made their first contribution in #1223
- @radu2147 made their first contribution in #1249
- @sirreal made their first contribution in #1416
- @Ken-HH24 made their first contribution in #1436
Full Changelog: oxlint_v0.0.17...oxlint_v0.0.18
oxlint v0.0.17
Try it out!
- Run
npx --yes oxlint@latest
from your terminal - Install the Vscode extension https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
What's Changed
Features
The final dot is no longer required by the CLI #1201:
npx oxlint@latest
This is the same as npx oxlint@latest .
, where the current working directory will be scanned.
This is an alignment with ESLint v9, see https://eslint.org/blog/2023/11/whats-coming-in-eslint-9.0.0/#running-eslint-with-no-file-arguments
What's Changed
New rules by category
Style
- eslint-plugin-unicorn: prefer-optional-catch-binding by @camc314 in #1188
- eslint-plugin-unicorn: prefer-spread by @camc314 in #1186
Fixes
- fix(linter): fix handling of repeated eslint-disable comments by @haocheng6 in #1200
Full Changelog: oxlint_v0.0.16...oxlint_v0.0.17
oxlint v0.0.16
Try it out!
- Run
npx --yes oxlint@latest .
from your terminal - Install the Vscode extension https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
What's Changed
Features
Use the following cli flags to enable the import / jest / jsx-a11y plugins
Enable Plugins
--import-plugin Enable the experimental import plugin and detect ESM problems
--jest-plugin Enable the Jest plugin and detect test problems
--jsx-a11y-plugin Enable the JSX-a11y plugin and detect accessibility problems
New rules by category (19 in total)
Correctness (turned on by default)
- eslint-plugin-unicorn: no-invalid-remove-event-listener by @camc314 in #1147
- eslint-plugin-unicorn: no-useless-fallback-in-spread @camc314 in #1176
- eslint-plugin-jsx-a11y: alt-text by @manzt in #1126
Suspicious
- eslint-plugin-unicorn: no-new-array by @camc314 in #1160
- eslint-plugin-unicorn: prefer-add-event-listener by @camc314 in #1175
Pedantic
- eslint-plugin-unicorn: prefer-type-error by @camc314 in #1149
- eslint-plugin-unicorn: new-for-builtins by @camc314 in #1159
- eslint-plugin-unicorn: no-new-buffer by @camc314 in #1174
- eslint-plugin-unicorn: prefer-date-now by @camc314 in #1150
- eslint-plugin-unicorn: prefer-regex-test by @camc314 in #1187
- eslint-plugin-unicorn: no-static-only-class by @camc314 in #1161
- eslint-plugin-unicorn: prefer-blob-reading-methods by @camc314 in #1168
- eslint-plugin-unicorn: prefer-code-point by @camc314 in #1167
- eslint-plugin-unicorn: no-object-as-default-parameter by @camc314 in #1162
Style
- eslint-plugin-unicorn: prefer-string-trim-start-end by @camc314 in #1148
- eslint-plugin-jest: prefer-todo rule by @eryue0220 in #1065
- eslint-plugin-react(jsx_key): ignore ObjectProterty nodes by @yesmeck in #1139
- eslint: default-case-last by @PerfectPan in #1156
Nursery
- eslint-plugin-import: no-amd by @qinyuhang in #1171
- eslint-plugin-jest: no-hooks by @eryue0220 in #1172
Fixes
- reduce the lookup times of Call Expression in Jest rules by @mysteryven in #1184
- parse configuration for unicorn/filename-case by @camc314 in #1145
- fix covered span of eslint-disable-next-line comments by @haocheng6 in #1128
New Contributors
- @ubugeeei made their first contribution in #1136
- @PerfectPan made their first contribution in #1156
- @qinyuhang made their first contribution in #1171
Full Changelog: oxlint_v0.0.15...oxlint_v0.0.16
oxlint v0.0.15
What's Changed
- fix(linter) Improve span for jsx key by @camc314 in #1040
- feat(linter): eslint-plugin-react/no-find-dom-node by @haocheng6 in #1031
- reactor(linter): Refactor jsx key rule to use static_property_info by @camc314 in #1043
- feat(linter): eslint-plugin-react(no-unescaped-entities) by @camc314 in #1044
- feat(linter): support react/no-render-return-value by @Dunqing in #1042
- feat(linter): eslint-plugin-react no-string-refs by @manzt in #1053
- feat(linter): eslint-plugin-unicorn - no-empty-file by @camc314 in #1052
- feat(linter) eslint-plugin-unicorn - text-encoding-identifier-case by @camc314 in #1051
- feat(linter): support react/no-string-refs by @Dunqing in #1055
- feat(linter) eslint-plugin-unicorn - prefer-logical-operator-over-ternary by @camc314 in #1064
- fix(linter): noTemplateLiterals configuration in no_string_refs rule not working by @Dunqing in #1063
- fix(linter) fix incorrect reporting for no_useless_escape by @camc314 in #1062
- feat(linter): eslint-plugin-unicorn switch-case-braces by @Dywanoid in #1054
- feat(linter): eslint-plugin-unicorn require-number-to-fixed-digits-argument by @Dywanoid in #1073
- fix(linter) Fix panic on no_mixed_operators rule by @camc314 in #1094
- fix(linter) Fix panic on no useless escape by @camc314 in #1092
- fix(linter) Fix panic when using ban ts comment on conformace tests by @camc314 in #1097
- fix(linter) Report error instead of panicing if the file fails to open by @camc314 in #1098
- fix(linter): revert changes to JSX attribute strings by @Boshen in #1101
- fix(linter): fix panic in no_unescaped_entities by @Boshen in #1103
- fix(linter/no_empty_file): point to start of file instead of the entire file by @Boshen in #1105
- feat(linter/no_children_prop): point the span to "children" by @Boshen in #1106
- feat(linter): support unicorn/prefer-query-selector by @Dunqing in #1068
- feat(linter): demote prefer_array_flat_map to style by @Boshen in #1108
- fix(linter/no_render_return_value): fix false positive when nested inside an arrow expression by @Boshen in #1109
- chore(linter/no_unescaped_entities): demote to pedantic by @Boshen in #1110
- fix(linter/no-render-return-value): remove duplicate test case by @Dunqing in #1111
- feat(linter): change some rules pedantic and improve help message by @Boshen in #1112
- chore(linter): move all import plugin rules to nursery by @Boshen in #1113
New Contributors
Full Changelog: oxlint_v0.0.14...oxlint_v0.0.15