Releases: oxc-project/oxc
oxlint v0.2.5
What's Changed
This release matched all linter rule names with their ESLint counterparts.
New Rules
- react: jsx-no-target-blank by @hjiog in #2149
- eslint: no-void by @eryue0220 in #2162
- jest: prefer-called-with by @eryue0220 in #2163
Fixes
New Contributors
Full Changelog: oxlint_v0.2.4...oxlint_v0.2.5
oxlint v0.2.4
oxlint v0.2.3
What's Changed
New eslint-plugin-react-perf
oxlint --react-perf-plugin
Differenciate linux gnu / musl binary targets
- linux-x64-gnu
- linux-arm64-gnu
- linux-x64-musl
- linux-arm64-musl
New Rules
- jest: no-restricted-matchers by @eryue0220 in #2090
- jest: no-restricted-jest-methods by @eryue0220 in #2091
- import: no-named-as-default by @XantreGodlike in #2109
- unicorn: promote no-new-array to correctness with better help message by @Boshen in #2123
Favor Array.from({ length: n })
and [onlyElement]
instead of ambiguous new Array(arg)
Improvements
- eslint config jsonc support by @Boshen in #2121
- support eslint config in nextjs eslint by @kaykdm in #2107
- complete img-redundant linter by @msdlisper in #2112
Fixes
- cli: disallow path pointing to parent directories by @Boshen in #2125
- fix panic in prefer-native-coercion-function by @camc314 in #2100
- allow
[...new Array(n)]
in no-useless-spread by @Boshen in #2124 - not use
new_inline
with flexible str by @mysteryven in #2106
New Contributors
Full Changelog: oxlint_v0.2.2...oxlint_v0.2.3
oxlint v0.2.2
What's Changed
- fix(parser): fix crash on TSTemplateLiteralType in function return position by @Boshen in #2089
- feat(linter): improve no_redeclare rule implementation by @Dunqing in #2084
- refactor(linter): perfect the scope linter by @msdlisper in #2092
- fix(linter): s/consistent-type-export/consistent-type-exports by @Boshen in #2065
- feat(linter): eslint-plugin-import no-named-as-default-member rule by @XantreGodlike in #2071
New Contributors
Full Changelog: oxlint_v0.2.1...oxlint_v0.2.2
oxlint v0.2.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
New Rules
- eslint-plugin-next: no-document-import-in-page by @kaykdm in #1997
- eslint-plugin-next: no-head-element by @kaykdm in #2006
- eslint-plugin-next: no-typos by @kaykdm in #1978
- eslint-plugin-jsx-a11y: aria-activedescendant-has-tabindex by @keita-hino in #2012
- eslint-plugin-jsx-a11y: click-events-have-key-events by @leaysgur in #1976
- eslint-plugin-jsx-a11y: no-redundant-roles rule by @yossydev in #1981
- eslint-plugin-import: no-named-as-default-member rule by @XantreGodlike in #1988
Improvements
Linter
- fix(linter) fix false positive for
erasing-op
in0/0
case by @camc314 in #2009 - fix(linter): false positive for filename_case where filename doesn't have a proper casing by @Boshen in #2032
- fix(linter): keep rules disabled if the rule is not enabled in the config by @Boshen in #2031
41% faster after removing the --timings
feature
Parser - 7% faster than the previous version
- perf(parser): reduce
Token
size from 16 to 12 bytes by @Boshen in #2010 - perf(parser): lexer byte handlers consume ASCII chars faster by @overlookmotel in #2046
- perf(parser): lexer match byte not char by @overlookmotel in #2025
- refactor(parser): lexer handle unicode without branch by @overlookmotel in #2039
- refactor(parser): remove extraneous code from regex parsing by @overlookmotel in #2008
- refactor(parser): remove noop code by @overlookmotel in #2028
Full Changelog: oxlint_v0.2.0...oxlint_v0.2.1
oxlint v0.2.0
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
Better configuration support
oxlint -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.
To add / remove / configure a rule:
{
"rules": {
"no-empty": "off", // removes the rule
"no-empty": "error", // adds the rule
"no-empty": ["error", { "allowEmptyCatch": true }]` configures the rule
}
}
Next.js Plugin
oxlint --nextjs-plugin
- google-font-display by @camc314 in #1931
- google-font-preconnect by @camc314 in #1932
- inline-script-id by @camc314 in #1933
- next-script-for-ga by @camc314 in #1934
- no-assign-module-variable by @camc314 in #1935
- no-async-client-component by @camc314 in #1936
- no-css-tags by @camc314 in #1937
- no-head-import-in-document by @camc314 in #1957
- no-img-element by @camc314 in #1951
- no-script-component-in-head by @camc314 in #1954
- no-sync-scripts by @camc314 in #1953
- no-title-in-document-head by @camc314 in #1952
Vscode
- support vue, astro and svelte by @IWANABETHATGUY in #1923
New Rules
correctness
- react: require-render-return by @kaykdm in #1946
- react: no-direct-mutation-state by @zhangrunzhao in #1892
- typescript: triple-slash-reference by @kaykdm in #1903
- jsx-a11y: role-support-aria-props by @re-taro in #1961
- jsx-a11y: role-has-required-aria-props rule by @yossydev in #1881
- jsx-a11y: autocomplete-valid by @yossydev in #1901
restriction
- react: no-unknown-property by @XantreGodlike in #1875
style
- jest: no-test-return-statement by @eryue0220 in #1979
Fixes
Linter
- always print without considering the
--max-warnings
option by @Boshen in #1996 - support vue generic component by @Boshen in #1989
- Support cases where aria-hidden includes expressions by @keita-hino in #1964
- allow eslintrc to add rule when overriding by @fi3ework in #1984
- fix plugin name parsing when reading config file by @haocheng6 in #1972
- handle anonymous functional components in arrays that have a function body by @maurice in #1983
Parser
Improvements
- Parser is 10% faster than the previous version
- only allocate for escaped template strings by @Boshen in #2005
- reduce
Token
size from 32 to 16 bytes by @Boshen in #1962 - reduce work parsing regexps by @overlookmotel in #1999
- remove
TokenValue::BigInt
fromToken
by @Boshen in #1924 - remove
TokenValue::Number
fromToken
by @Boshen in #1945 - remove
TokenValue::RegExp
fromToken
by @Boshen in #1926 - remove string builder from number parsing by @Boshen in #2002
New Contributors
- @bmeck made their first contribution in #1950
- @leaysgur made their first contribution in #1965
- @keita-hino made their first contribution in #1964
- @kaykdm made their first contribution in #1946
- @underfin made their first contribution in #1967
- @fi3ework made their first contribution in #1984
- @luhc228 made their first contribution in #1993
Full Changelog: oxlint_v0.1.2...oxlint_v0.2.0
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