Skip to content

Releases: oxc-project/oxc

oxlint v0.1.2

06 Jan 17:10
4a9e0c4
Compare
Choose a tag to compare

Try it out!

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

Full Changelog: oxlint_v0.1.1...oxlint_v0.1.2

oxlint v0.1.1

06 Jan 13:31
821cc8e
Compare
Choose a tag to compare

Try it out!

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

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

Full Changelog: oxlint_v0.0.22...oxlint_v0.1.1

oxlint v0.0.22

25 Dec 06:50
Compare
Choose a tag to compare

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

Screenshot 2023-12-17 at 21 18 34

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

Screenshot 2023-12-17 at 22 34 06

Performance

10 - 20% faster than the previous version.

Sampling from an internal codebase (119900 files) - Before 12.8s vs 11.2s after.

Improvements

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

New Contributors

Full Changelog: oxlint_v0.0.21...oxlint_v0.0.22

oxlint v0.0.21

18 Dec 11:30
Compare
Choose a tag to compare

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"]
    }
}

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

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

Full Changelog: oxlint_v0.0.20...oxlint_v0.0.21

oxlint v0.0.20

13 Dec 05:52
Compare
Choose a tag to compare

What's Changed

Full Changelog: oxlint_v0.0.19...oxlint_v0.0.20

oxlint v0.0.19

08 Dec 10:44
Compare
Choose a tag to compare

Try it out!

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?

image

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

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

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

New Contributors

Full Changelog: oxlint_v0.0.18...oxlint_v0.0.19

oxlint v0.0.18

22 Nov 07:16
Compare
Choose a tag to compare

Try it out!

oxlint has 78 correctness rules turned on by default, with 164 rules in total.

What's Changed

Features

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
image

Notice $? prints 1.

New Rules

Correctness

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

Style

Fixes

Misc

New Contributors

Full Changelog: oxlint_v0.0.17...oxlint_v0.0.18

oxlint v0.0.17

09 Nov 05:29
Compare
Choose a tag to compare

Try it out!

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

08 Nov 05:13
Compare
Choose a tag to compare

Try it out!

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

Pedantic

Style

Nursery

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

Full Changelog: oxlint_v0.0.15...oxlint_v0.0.16

oxlint v0.0.15

30 Oct 16:42
ddd5314
Compare
Choose a tag to compare

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