Commit graph

7598 commits

Author SHA1 Message Date
camc314
f000596edf feat(minifier): minify call expressionsto Number (#8267) 2025-01-06 02:21:28 +00:00
camc314
092aeafdc0 feat(minifier): flatten spread args in call expressions (#8266) 2025-01-06 02:21:27 +00:00
camc314
04ec38dc47 feat(minifier): remove unused arrow function expressions (#8262) 2025-01-06 02:21:26 +00:00
camc314
e446c15619 feat(minifier): improve minimizing unary not expressions (#8261) 2025-01-06 02:21:26 +00:00
camc314
62a2644e07 fix(minifier): handle arrow fn expressions correctly in is_in_boolean_context (#8260)
`var k = () => !!x` was incorrectly being minified to `var k = () => x`
2025-01-06 02:21:25 +00:00
camc314
7f19211736 feat(minifier): minimize unary expression statements (#8256)
`delete` cannot be minified as it may have side effect.
2025-01-06 02:21:24 +00:00
camc314
b6d16f4d80 fix(codegen): print parenthesis on negative bigint lit when neccessary (#8258)
closes #8257

i couldn't really write a test for this, as it only happens when codegen + minifier are used together.

Regression should be prevented by the 262 suite in #8256 (failed CI run before i implemented this fix: https://github.com/oxc-project/oxc/actions/runs/12621310419/job/35168016825)
2025-01-06 02:21:24 +00:00
renovate[bot]
6a97e29c19
chore(deps): update crate-ci/typos action to v1.29.4 (#8265)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [crate-ci/typos](https://redirect.github.com/crate-ci/typos) | action
| minor | `v1.28.3` -> `v1.29.4` |

---

### Release Notes

<details>
<summary>crate-ci/typos (crate-ci/typos)</summary>

###
[`v1.29.4`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.29.4)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.29.3...v1.29.4)

#### \[1.29.4] - 2025-01-03

###
[`v1.29.3`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.29.3)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.29.2...v1.29.3)

#### \[1.29.3] - 2025-01-02

###
[`v1.29.2`](https://redirect.github.com/crate-ci/typos/compare/v1.29.1...v1.29.2)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.29.1...v1.29.2)

###
[`v1.29.1`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.29.1)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.29.0...v1.29.1)

#### \[1.29.1] - 2025-01-02

##### Fixes

-   Don't correct `deriver`

###
[`v1.29.0`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.29.0)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.28.4...v1.29.0)

#### \[1.29.0] - 2024-12-31

##### Features

- Updated the dictionary with the [December
2024](https://redirect.github.com/crate-ci/typos/issues/1156) changes

##### Performance

-   Sped up dictionary lookups

###
[`v1.28.4`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.28.4)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.28.3...v1.28.4)

#### \[1.28.4] - 2024-12-16

##### Features

-   `--format sarif` support

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - "before 11am on monday" in timezone Asia/Shanghai.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2025-01-05 22:13:32 +00:00
Boshen
cec63e2119
feat(minifier): {} evals to f64::NaN 2025-01-05 23:09:57 +08:00
Boshen
4d8a08d2ac feat(minifier): improve constant evaluation (#8252) 2025-01-05 12:41:57 +00:00
Boshen
e84f267a39 feat(minifier): compress more property keys (#8253) 2025-01-05 07:20:56 +00:00
camc314
d1224f95ce feat(minifier): improve minimizing conditional expressions (#8251) 2025-01-05 04:14:02 +00:00
camc314
91b42defb5 test(minifier): enable some passing tests (#8250) 2025-01-05 04:14:01 +00:00
camc314
3c534aeb5a refactor(linter): refactor LintBuilder to prep for nested configs (#8034)
More simplification/preparations for nested configurations:

1. renames `LinterBuilder` to `ConfigStoreBuilder`
2. moves the `options` logic out of `LintBuilder`
3. make `ConfigStoreBuilder::build()` return a result (currently always returns OK, but it will return errors when nested config is implemented

The next steps to implement nested config which i hope to do in the next week are:
1. refactor the `from_oxlintrc` to accept a file path
2. introduce a new method on `ConfigStoreBuilder` (name TBC) that walks all child directories, collecting `.oxlintrc` files. these will be put into `ConfigStore` as a hash map of path > config.
2025-01-05 04:08:26 +00:00
Boshen
65f46f5409
feat(minifier): constant fold String.fromCharCode (#8248) 2025-01-04 23:22:32 +08:00
Boshen
0845162372
refactor(minifier): clean up ReplaceKnownMethods 2025-01-04 21:57:20 +08:00
Boshen
bd8d677352 feat(minifier): minimize ~undefined, ~null, ~true, ~false (#8247) 2025-01-04 13:34:53 +00:00
Boshen
f73dc9ea9b
feat(minifier): constant fold 'x'.toString() and true.toString() (#8246) 2025-01-04 21:28:26 +08:00
Boshen
fd5af73a22 feat(minifier): minimize Number constructor (#8245) 2025-01-04 09:56:03 +00:00
Boshen
2f52f333fa feat(minifier): minsize !!!foo ? bar : baz -> foo ? baz : bar (#8244) 2025-01-04 09:10:22 +00:00
Boshen
7c7f5d7af9
refactor(minifier): clean up peephole_fold_constants 2025-01-04 16:57:08 +08:00
Boshen
ce2b5a994b chore(minifier): disable RemoveUnusedCode (#8243)
A lot of edge cases fail in test262 and monitor-oxc.
2025-01-04 08:49:20 +00:00
Boshen
d2f8eaa842 fix(minifier): fix panic in peephole_minimize_conditions (#8242)
https://github.com/oxc-project/monitor-oxc caught some crashes.

Make things safer by returning falling back to true.
2025-01-04 07:56:21 +00:00
Boshen
ad9a0a9c4a feat(mininifier): minimize variants of a instanceof b == true (#8241) 2025-01-04 06:04:52 +00:00
Boshen
ccdc039f54 feat(minifier): always put literals on the rhs of equal op 1==x => x==1 (#8240) 2025-01-04 04:07:54 +00:00
Boshen
bf0fbcea6e refactor(minifier): improve constant fold numbers (#8239)
Ported esbuild's implementation
2025-01-04 03:30:20 +00:00
Cameron
39353b22e9
feat(minifier): improve minimizing conditionals (#8238) 2025-01-04 08:36:54 +08:00
camc314
c90fc16bba feat(minifier): restore conditional minification and fix edge case (#8235)
This restore's the changes made in #8233, but fixing the edge cases.

If the conditional expression is not a child of an `IfStatementTest`, `WhileStatementTest`, `DoWhileStatementText` or `ExpressionStatementExpression`, we must coerce the test to a boolean.
2025-01-03 14:20:42 +00:00
Boshen
6c8ee9fdef feat(minifier): remove last redundant return statement (#8234) 2025-01-03 12:24:57 +00:00
Boshen
a698deff51 fix(minifier): fix incorrect return value for (x ? true : y) (#8233)
Need to check if the return value is used or not:

```
function foo() {
    return foo ? true : bar; // no transformed
}

foo ? true : bar; // transformed to `foo || bar;`
```
2025-01-03 11:58:28 +00:00
Boshen
e00e3804b9
chore(napi/parser): publish oxc_parser_napi 2025-01-03 19:43:54 +08:00
camc314
62f8fba98c refactor(minifier): move all conditional minification logic to minimze_conditions (#8231)
@Boshen feel free to close this one if you want. 🙂

https://github.com/oxc-project/oxc/pull/8229 compresses some conditionals

this PR moves compression of all conditionals into the same place
2025-01-03 11:20:56 +00:00
Boshen
51f47926ef feat(minifier): minimize foo ? foo : bar and foo ? bar : foo (#8229) 2025-01-03 10:55:59 +00:00
Boshen
0e14bd8cab
chore(napi/parser): publish oxc_parser_napi
closes #8118
2025-01-03 18:13:12 +08:00
Boshen
6e2ec17d51 feat(minifier): statement fusion switch cases; improved minimize exit poitns (#8228) 2025-01-03 10:07:04 +00:00
Boshen
574a2428fd feat(minifier): minimize all variants of typeof x == 'undefined' (#8227) 2025-01-03 07:05:55 +00:00
Boshen
2041477f51 feat(minifier): fold if(x)return;y -> if(!x)y (#8226) 2025-01-03 05:24:53 +00:00
Alexander S.
2f9fab9172
refactor(linter): remove remapping for plugin name in diagnostics (#8223)
came across this code.

I do not think this is practicable in the real world. Many projects areo
migrating from jest to vitest and are currently installing both,
So we can't really tell what plugin name should be outputted.

The same is for typescript <-> eslint and our newest candidate:


2da4365fbe/crates/oxc_linter/src/config/rules.rs (L163-L165)
2025-01-03 11:40:26 +08:00
Alexander S.
37d31ecef9
fix(tasks/lint_rules): sync unicorn rules with eslint rules (#8224)
👀 promise/spec-only is implemented but not found in their rules
👀 unicorn/consistent-existence-index-check is implemented but not found
in their rules
👀 unicorn/prefer-math-min-max is implemented but not found in their
rules

> [!WARNING]
> This comment is maintained by CI. Do not edit this comment directly.
> To update comment template, see
https://github.com/oxc-project/oxc/tree/main/tasks/lint_rules

This is tracking issue for `eslint-plugin-unicorn`.


There are 120(+ 17 deprecated) rules.

- 24/113 recommended rules are remaining as TODO
- 7/7 not recommended rules are remaining as TODO


To get started, run the following command:

```sh
just new-unicorn-rule <RULE_NAME>
```

Then register the rule in `crates/oxc_linter/src/rules.rs` and also
`declare_all_lint_rules` at the bottom.


## Recommended rules

<details open>
<summary>
  : 89, 🚫: 0 / total: 113
</summary>

| Status | Name | Docs |
| :----: | :--- | :--- |
| | unicorn/better-regex |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/better-regex.md
|
|  | unicorn/catch-error-name |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/catch-error-name.md
|
|  | unicorn/consistent-empty-array-spread |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/consistent-empty-array-spread.md
|
|  | unicorn/consistent-function-scoping |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/consistent-function-scoping.md
|
|  | unicorn/empty-brace-spaces |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/empty-brace-spaces.md
|
|  | unicorn/error-message |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/error-message.md
|
|  | unicorn/escape-case |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/escape-case.md
|
| | unicorn/expiring-todo-comments |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/expiring-todo-comments.md
|
|  | unicorn/explicit-length-check |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/explicit-length-check.md
|
|  | unicorn/filename-case |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/filename-case.md
|
| | unicorn/import-style |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/import-style.md
|
|  | unicorn/new-for-builtins |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/new-for-builtins.md
|
|  | unicorn/no-abusive-eslint-disable |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-abusive-eslint-disable.md
|
|  | unicorn/no-anonymous-default-export |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-anonymous-default-export.md
|
| | unicorn/no-array-callback-reference |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-array-callback-reference.md
|
|  | unicorn/no-array-for-each |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-array-for-each.md
|
| | unicorn/no-array-method-this-argument |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-array-method-this-argument.md
|
| | unicorn/no-array-push-push |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-array-push-push.md
|
|  | unicorn/no-array-reduce |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-array-reduce.md
|
|  | unicorn/no-await-expression-member |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-await-expression-member.md
|
|  | unicorn/no-await-in-promise-methods |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-await-in-promise-methods.md
|
|  | unicorn/no-console-spaces |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-console-spaces.md
|
|  | unicorn/no-document-cookie |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-document-cookie.md
|
|  | unicorn/no-empty-file |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-empty-file.md
|
| | unicorn/no-for-loop |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-for-loop.md
|
|  | unicorn/no-hex-escape |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-hex-escape.md
|
|  | unicorn/no-instanceof-array |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-instanceof-array.md
|
| | unicorn/no-invalid-fetch-options |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-invalid-fetch-options.md
|
|  | unicorn/no-invalid-remove-event-listener |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|  | unicorn/no-length-as-slice-end |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-length-as-slice-end.md
|
|  | unicorn/no-lonely-if |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-lonely-if.md
|
|  | unicorn/no-magic-array-flat-depth |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-magic-array-flat-depth.md
|
|  | unicorn/no-negated-condition |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-negated-condition.md
|
|  | unicorn/no-negation-in-equality-check |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-negation-in-equality-check.md
|
|  | unicorn/no-nested-ternary |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-nested-ternary.md
|
|  | unicorn/no-new-array |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-new-array.md
|
|  | unicorn/no-new-buffer |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-new-buffer.md
|
|  | unicorn/no-null |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-null.md
|
|  | unicorn/no-object-as-default-parameter |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-object-as-default-parameter.md
|
|  | unicorn/no-process-exit |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-process-exit.md
|
|  | unicorn/no-single-promise-in-promise-methods |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|  | unicorn/no-static-only-class |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-static-only-class.md
|
|  | unicorn/no-thenable |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-thenable.md
|
|  | unicorn/no-this-assignment |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-this-assignment.md
|
|  | unicorn/no-typeof-undefined |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-typeof-undefined.md
|
|  | unicorn/no-unnecessary-await |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-unnecessary-await.md
|
| | unicorn/no-unnecessary-polyfills |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-unnecessary-polyfills.md
|
|  | unicorn/no-unreadable-array-destructuring |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|  | unicorn/no-unreadable-iife |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-unreadable-iife.md
|
|  | unicorn/no-useless-fallback-in-spread |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|  | unicorn/no-useless-length-check |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-useless-length-check.md
|
|  | unicorn/no-useless-promise-resolve-reject |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|  | unicorn/no-useless-spread |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-useless-spread.md
|
|  | unicorn/no-useless-switch-case |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-useless-switch-case.md
|
|  | unicorn/no-useless-undefined |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-useless-undefined.md
|
|  | unicorn/no-zero-fractions |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-zero-fractions.md
|
|  | unicorn/number-literal-case |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/number-literal-case.md
|
|  | unicorn/numeric-separators-style |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/numeric-separators-style.md
|
|  | unicorn/prefer-add-event-listener |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-add-event-listener.md
|
| | unicorn/prefer-array-find |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-array-find.md
|
|  | unicorn/prefer-array-flat-map |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-array-flat-map.md
|
|  | unicorn/prefer-array-flat |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-array-flat.md
|
| | unicorn/prefer-array-index-of |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-array-index-of.md
|
|  | unicorn/prefer-array-some |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-array-some.md
|
| | unicorn/prefer-at |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-at.md
|
|  | unicorn/prefer-blob-reading-methods |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-blob-reading-methods.md
|
|  | unicorn/prefer-code-point |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-code-point.md
|
|  | unicorn/prefer-date-now |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-date-now.md
|
| | unicorn/prefer-default-parameters |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-default-parameters.md
|
|  | unicorn/prefer-dom-node-append |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-dom-node-append.md
|
|  | unicorn/prefer-dom-node-dataset |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-dom-node-dataset.md
|
|  | unicorn/prefer-dom-node-remove |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-dom-node-remove.md
|
|  | unicorn/prefer-dom-node-text-content |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-dom-node-text-content.md
|
|  | unicorn/prefer-event-target |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-event-target.md
|
| | unicorn/prefer-export-from |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-export-from.md
|
|  | unicorn/prefer-includes |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-includes.md
|
| | unicorn/prefer-keyboard-event-key |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-keyboard-event-key.md
|
|  | unicorn/prefer-logical-operator-over-ternary |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|  | unicorn/prefer-math-trunc |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-math-trunc.md
|
|  | unicorn/prefer-modern-dom-apis |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-modern-dom-apis.md
|
|  | unicorn/prefer-modern-math-apis |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-modern-math-apis.md
|
| | unicorn/prefer-module |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-module.md
|
|  | unicorn/prefer-native-coercion-functions |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-native-coercion-functions.md
|
|  | unicorn/prefer-negative-index |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-negative-index.md
|
|  | unicorn/prefer-node-protocol |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-node-protocol.md
|
|  | unicorn/prefer-number-properties |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-number-properties.md
|
| | unicorn/prefer-object-from-entries |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-object-from-entries.md
|
|  | unicorn/prefer-optional-catch-binding |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-optional-catch-binding.md
|
|  | unicorn/prefer-prototype-methods |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-prototype-methods.md
|
|  | unicorn/prefer-query-selector |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-query-selector.md
|
|  | unicorn/prefer-reflect-apply |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-reflect-apply.md
|
|  | unicorn/prefer-regexp-test |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-regexp-test.md
|
|  | unicorn/prefer-set-has |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-set-has.md
|
|  | unicorn/prefer-set-size |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-set-size.md
|
| | unicorn/prefer-spread |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-spread.md
|
|  | unicorn/prefer-string-raw |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-string-raw.md
|
|  | unicorn/prefer-string-replace-all |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-string-replace-all.md
|
|  | unicorn/prefer-string-slice |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-string-slice.md
|
|  | unicorn/prefer-string-starts-ends-with |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|  | unicorn/prefer-string-trim-start-end |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-string-trim-start-end.md
|
|  | unicorn/prefer-structured-clone |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-structured-clone.md
|
| | unicorn/prefer-switch |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-switch.md
|
| | unicorn/prefer-ternary |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-ternary.md
|
| | unicorn/prefer-top-level-await |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-top-level-await.md
|
|  | unicorn/prefer-type-error |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-type-error.md
|
| | unicorn/prevent-abbreviations |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prevent-abbreviations.md
|
| | unicorn/relative-url-style |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/relative-url-style.md
|
|  | unicorn/require-array-join-separator |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/require-array-join-separator.md
|
|  | unicorn/require-number-to-fixed-digits-argument |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|  | unicorn/switch-case-braces |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/switch-case-braces.md
|
| | unicorn/template-indent |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/template-indent.md
|
|  | unicorn/text-encoding-identifier-case |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/text-encoding-identifier-case.md
|
|  | unicorn/throw-new-error |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/throw-new-error.md
|

 = Implemented, 🚫 = No need to implement

</details>


## Not recommended rules

<details open>
<summary>
  : 0, 🚫: 0 / total: 7
</summary>

| Status | Name | Docs |
| :----: | :--- | :--- |
| | unicorn/consistent-destructuring |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/consistent-destructuring.md
|
| | unicorn/custom-error-definition |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/custom-error-definition.md
|
| | unicorn/no-keyword-prefix |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-keyword-prefix.md
|
| | unicorn/no-unused-properties |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/no-unused-properties.md
|
| | unicorn/prefer-json-parse-buffer |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/prefer-json-parse-buffer.md
|
| | unicorn/require-post-message-target-origin |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/require-post-message-target-origin.md
|
| | unicorn/string-content |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/rules/string-content.md
|

 = Implemented, 🚫 = No need to implement

</details>


## Deprecated rules

<details >
<summary>
  : 0, 🚫: 0 / total: 17
</summary>

| Status | Name | Docs |
| :----: | :--- | :--- |
| | unicorn/import-index |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#import-index
|
| | unicorn/no-array-instanceof |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#no-array-instanceof
|
| | unicorn/no-fn-reference-in-iterator |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#no-fn-reference-in-iterator
|
| | unicorn/no-reduce |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#no-reduce
|
| | unicorn/no-unsafe-regex |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#no-unsafe-regex
|
| | unicorn/prefer-dataset |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-dataset
|
| | unicorn/prefer-event-key |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-event-key
|
| | unicorn/prefer-exponentiation-operator |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-exponentiation-operator
|
| | unicorn/prefer-flat-map |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-flat-map
|
| | unicorn/prefer-node-append |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-node-append
|
| | unicorn/prefer-node-remove |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-node-remove
|
| | unicorn/prefer-object-has-own |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-object-has-own
|
| | unicorn/prefer-replace-all |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-replace-all
|
| | unicorn/prefer-starts-ends-with |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-starts-ends-with
|
| | unicorn/prefer-text-content |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-text-content
|
| | unicorn/prefer-trim-start-end |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#prefer-trim-start-end
|
| | unicorn/regex-shorthand |
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v55.0.0/docs/deprecated-rules.md#regex-shorthand
|

 = Implemented, 🚫 = No need to implement

</details>
2025-01-03 11:39:51 +08:00
Boshen
2da4365fbe feat(parser): missing initializer in destructuring declaration inside for loop head (#8222)
closes #8220
2025-01-02 14:02:49 +00:00
Boshen
9c1afa4729 feat(minifier): optional catch binding when catch param is unused (#8221) 2025-01-02 13:20:49 +00:00
Boshen
4a29845d82 feat(minifier): add ConvertToDottedProperties (#8212) 2025-01-02 13:02:22 +00:00
Boshen
2786dea164 feat(minifier): add RemoveUnusedCode (#8210) 2025-01-02 12:50:21 +00:00
oxc-bot
d2d90b077b
release(oxlint): v0.15.5 (#8218)
## [0.15.5] - 2025-01-02

### Features

- 0e168b8 linter: Catch more cases in const-comparisons (#8215)
(Cameron)
- bde44a3 linter: Add `statement_span` to `ModuleRecord/ImportEntry`
(#8195) (Alexander S.)
- ccaa9f7 linter: Implement `eslint/new-cap`  (#8146) (Alexander S.)

### Bug Fixes

- 2b14a6f linter: Fix `ignorePattern` config for windows (#8214)
(Alexander S.)

### Testing

- cb709c9 linter: Fix some oxlint tests on windows (#8204) (Cameron)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-01-02 18:55:31 +08:00
Alexander S.
2b14a6fb54
fix(linter): fix ignorePattern config for windows (#8214)
Changes:

- Config `ignorePatterns` not as `Path`, because the create `ignore`
does only handle `/` and not Win-style `\`
- Passed full path to the config and do not use `canonicalize` because
it prefix the paths with `\\?\`,
  read more here: https://stackoverflow.com/a/41233992/7387397
- Updated and enabled tests for windows, some are still failing 

closes #8188

---------

Co-authored-by: Alexander Schlegel <alexander.schlegel@clicksports.de>
2025-01-02 18:34:02 +08:00
Cameron
0e168b8c19
feat(linter): catch more cases in const-comparisons (#8215) 2025-01-02 18:32:47 +08:00
Cameron
cd274eeb02
feat(minifier): minimize logical exprs (#8209) 2025-01-02 18:32:20 +08:00
Boshen
cd349a312d chore(tasks/coverage): do not run minifier in script mode (#8213) 2025-01-01 14:56:43 +00:00
Boshen
05be1fc639 fix(minifier): remove incorrect fold Expression::AssignmentExpression (#8211) 2025-01-01 05:44:01 +00:00
camc314
4ae15df042 feat(minifier): imprve more conditional expr minification with boolean lit (#8208) 2025-01-01 02:31:18 +00:00