Skip to content

oxlint v0.4.0

Compare
Choose a tag to compare
@github-actions github-actions released this 24 May 07:34
e5337f0

Potential Breaking Changes

enforce rule severity from the cli and configuration file by @Boshen in #3337

The --deny or -D flag in the CLI, and the "error" severity setting in the configuration file will now set linter diagnostics to be an "error" and exit the program with exit code 1.

Previously, these flags had no effect, and all linter diagnostics were reported as warnings.

This means in CI, oxlint --deny-warnings is no longer needed for exit code 1 if oxlint -D correctness is set.

To restore the previous "report as warning" behaviour, the --warn or -W flag is added to the CLI, and the "warn" severity in the configuration file will take into effect.

merge deepscan rules into oxc rules by @Boshen in #3327

deepscan rules are now "oxc" rules, because there is no "deepscan" plugin in the eslint ecosystem and this caused some confusion.

Ecosystem CI

We added the Oxlint Ecosystem CI to maximize ecosystem compatibility, reduce churn, and minimize break-after-release

New Features

The default rule set enables some plugins by default, the following CLI arguments are added for disabling them:

  • --disable-react-plugin
  • --disable-unicorn-plugin
  • --disable-oxc-plugin
  • --disable-typescript-plugin

New Rules

Two notable new rules that are under experiment but worth a try:

No Barrel File

oxlint --import-plugin -D no-barrel-file

Loading a lot of modules is slow for runtimes and bundlers.

image

To change the threshhold:

oxlint -c oxlintrc.json --import-plugin -D no-barrel-file

{
  "rules": {
    "oxc/no-barrel-file": ["error", {
      "threshold": 10
    }]
  }
}

See Speeding up the JavaScript ecosystem - The barrel file debacle for background reading.

Rule of Hooks

oxlint -D rules-of-hooks

Enforce the React Rules of Hooks.

Bug Fixes

  • fix(linter): avoid infinite loop in jest/expect-expect by @mysteryven in #3332
  • fix(linter): avoid infinite loop when traverse ancestors in jest/no_conditional_expect by @mysteryven in #3330
  • fix(linter): fix panic in jest/expect-expect by @Boshen in #3324
  • fix(linter/jsx-no-undef): check for globals when an identifier is undefined by @Boshen in #3331
  • fix(linter/next): false positives for non-custom font link by @Dunqing in #3383

Performance Improvements

  • perf(lexer): use bitshifting when parsing known integers by @DonIsaac in #3296
  • perf(linter): use usize for RuleEnum hash by @Boshen in #3336
  • perf(parser): more efficient number parsing by @overlookmotel in #3342
  • perf(parser): use FxHashSet for not_parenthesized_arrow by @Boshen in #3344
  • perf(parser): improve parse_simple_arrow_function_expression by @Boshen in #3349
  • perf(parser): improve expression parsing by @Boshen in #3352
  • perf(parser): improve is_parenthesized_arrow_function_expression by @Boshen in #3343

What's coming next

Full Changelog: oxlint_v0.3.5...oxlint_v0.4.0