Commit graph

2228 commits

Author SHA1 Message Date
magic-akari
5b2696b711
refactor(parser): report this parameter error (#1788)
- follow up: #1728
2023-12-23 22:09:14 +08:00
Milo
b25f014e84
fix(linter): fix a typo in no_redeclare message (#1789) 2023-12-23 12:48:50 +00:00
Cameron
29a4a35fd8
fix(prettier) add missing closing brace for dock debug (#1786) 2023-12-23 10:59:13 +08:00
Boshen
51a243b989
perf(linter): reduce the RuleEnum enum size from 168 to 16 bytes (#1783)
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2023-12-22 22:54:41 +08:00
Dunqing
521aa2cf9d
feat(linter/eslint/no-useless-escape): support auto fix (#1743)
There are many errors in the vitest repo related to this rule.
2023-12-22 22:23:34 +08:00
Tapan Prakash
b8a90c1b9b
feat(linter): eslint-plugin-jsx-a11y no-distracting-elements rule (#1767)
Implemented eslint-plugin-jsx-a11y no-distracting-elements as part of
https://github.com/oxc-project/oxc/issues/1141 porting recommended
rules.

Doc:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-distracting-elements.md
Test:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/__tests__/src/rules/no-distracting-elements-test.js
2023-12-22 13:04:29 +08:00
Wenzhe Wang
18f0e20c56
docs(linter): update comments (#1779) 2023-12-22 12:20:22 +08:00
Wenzhe Wang
0bf7596949
fix(linter): support read the third item in config file (#1771)
closes: #1757
2023-12-21 22:51:57 +08:00
Boshen
2286181223
fix(linter): update snapshots 2023-12-21 22:07:53 +08:00
Boshen
5d7ea9d7a1
fix(linter): change non-error lints to warning 2023-12-21 21:55:22 +08:00
IWANABETHATGUY
fc7c857f80
fix(vscode): don't lint files in .gitignore and .eslintignore (#1765)
Closed https://github.com/oxc-project/oxc/issues/1752
2023-12-21 21:45:32 +08:00
Boshen
2e707bc1c7
perf(linter): use simd (memchr) for no-useless-escape search (#1766) 2023-12-21 19:14:16 +08:00
Boshen
82dc4035eb
chore(linter): bump oxc_resolver to v1.0.1 2023-12-21 16:43:27 +08:00
Boshen
da67fe1ca2
refactor(semantic): remove unused methods from AstNode 2023-12-21 16:08:14 +08:00
Boshen
6d4202241b
fix(linter): improve the help message for const-comparisons (#1764)
closes #1741
2023-12-21 16:04:39 +08:00
Boshen
d0cc3ec9a2
perf(linter): change regex to static in no_commented_out_tests 2023-12-21 15:35:57 +08:00
Boshen
e741b8fec4
perf(linter): precompute rule.name() (#1759)
enum static dispatch has become slow because there are 200 enum variants
2023-12-21 12:06:01 +08:00
Cameron
fc3a1a21a3
feat(linter) deepscan: bad char at comparison (#1750) 2023-12-20 12:39:27 +08:00
Cameron
a34c7fcbcc
feat(linter) deepscan: bad replace all arg (#1749) 2023-12-20 12:34:27 +08:00
Cameron
266667b892
chore: add deepscan to rulegen (#1748) 2023-12-20 12:29:28 +08:00
Cameron
df29e8da72
fix(cli) skip run lint when --rules is passed (#1747)
not sure if there is a cleaner way to do this.

maybe change `check_options` to return an Option - none if no CliResult, Some if there is a cli result (something was incorrect or the cmd was handled)
2023-12-20 12:24:45 +08:00
Boshen
2b4d1bf142
fix(parser): await in jsx expression
closes #1740
2023-12-19 20:23:16 +08:00
Cameron
3b1212e8bd
fix(linter) false positives for empty brace spaces (#1742)
closes #1699
2023-12-19 20:23:09 +08:00
Boshen
289ceb08e4
chore(MAINTENANCE): update MAINTENANCE guide 2023-12-19 19:54:01 +08:00
Boshen
0e563b301d
fix(linter): fix missing ` in the help message for const-comparisons 2023-12-19 19:51:12 +08:00
Dunqing
117f44cb30
feat(linter/eslint/no-cond-assign): span points to the operator (#1739)
close: #1726
2023-12-19 11:29:30 +00:00
Boshen
2d3ac95eda
refactor(linter): shrink the error span for require_yield
closes #1721
2023-12-19 19:19:05 +08:00
Boshen
38cb487903
refactor(linter): explain no-empty-pattern
closes #1720
2023-12-19 19:18:57 +08:00
Boshen
c61a6c6694
chore(benchmark): remove vue from test benchmark because it is flaky 2023-12-19 19:05:42 +08:00
Boshen
cc20eb0b18
chore(MAINTENANCE): make the repos easier to clone 2023-12-19 18:59:04 +08:00
Boshen
3a38d79d93
chore(linter): reference the new oxc rules 2023-12-19 18:58:51 +08:00
Cameron
0a611ac046
feat(linter) no double comparisons (#1712)
https://rust-lang.github.io/rust-clippy/master/index.html#/double_comparisons

<img width="1134" alt="Screenshot 2023-12-17 at 22 34 06"
src="https://github.com/oxc-project/oxc/assets/18101008/ae268c31-132f-451d-9e24-d3f1c89e5b42">
2023-12-19 10:55:32 +00:00
Cameron
de1d6ad1dd
feat(linter) no const comparisons (#1710)
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


<img width="1134" alt="Screenshot 2023-12-17 at 21 18 34"
src="https://github.com/oxc-project/oxc/assets/18101008/3574199c-03fb-409c-8ffb-0dc1f685c347">
2023-12-19 18:50:45 +08:00
Dunqing
8e6004ffc6
fix(linter/eslint/no-obj-calls): correctly resolves the binding name (#1738)
close: #1733
2023-12-19 18:39:58 +08:00
magic-akari
a2858ed452
refactor(ast): introduce ThisParameter (#1728)
Most TypeScript types can be eliminated during the code generation phase
by not printing the corresponding AST nodes.
The changes in this PR enable applying a similar technique to the `this`
parameter.
2023-12-19 13:20:33 +08:00
legend80s
f8b386ef58
feat(linter): correct example and docs url for number_arg_out_of_range (#1737) 2023-12-19 05:14:43 +00:00
Cameron
7f65d6a15c
fix(linter) improve span of bad-remove-event-listener, merge rules (#1734)
closes #1725
2023-12-18 23:52:11 +08:00
Cameron
f1d1563cde
fix(linter) improve span for no-unneccessary-await (#1732)
closes #1718
2023-12-18 21:34:28 +08:00
Cameron
78931e6187
feat(linter) improve span for no useless catch (#1731)
closes #1719
2023-12-18 21:29:28 +08:00
Cameron
360f3b01da
fix(linter) shrink span for prefer-string-starts-with-ends-with (#1730)
closes #1722
2023-12-18 21:25:27 +08:00
Cameron
4ebb3fb218
fix(cli): conflict between --import-plugin and -D correctness (#1729)
closes #1727
2023-12-18 21:20:48 +08:00
Boshen
2046e85664
ci: fix release vscode 2023-12-18 19:02:56 +08:00
Boshen
57b7fb67c5
Release oxlint and vscode extension v0.0.21 2023-12-18 17:18:36 +08:00
Boshen
19e77b0af3
fix(parser): false postive for "Missing initializer in const declaration" in declare + namespace (#1724)
closes #1723
2023-12-18 17:03:42 +08:00
yoshi2no
621a9438a8
feat(linter): eslint-plugin-jsx-a11y no-access-key (correctness) for (#1708)
partof: #1141

I've implemented `no-access-key` rule for jsx_a11y

originals:

- doc:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-access-key.md
- code:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/rules/no-access-key.js
- test:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/__tests__/src/rules/no-access-key-test.js
2023-12-18 16:32:04 +08:00
Boshen
3cc761d9b2
chore(MAINTENANCE): add release linter guide 2023-12-18 16:21:10 +08:00
Boshen
161d206a81
ci: add debug symbols to benchmark (#1717) 2023-12-18 15:31:13 +08:00
dependabot[bot]
2f4d6d35d5
chore(deps): bump the dependencies group with 4 updates (#1716) 2023-12-18 15:24:12 +08:00
dependabot[bot]
265f7db3ca
chore(deps): bump actions/upload-artifact from 3 to 4 (#1714)
Bumps
[actions/upload-artifact](https://github.com/actions/upload-artifact)
from 3 to 4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/upload-artifact/releases">actions/upload-artifact's
releases</a>.</em></p>
<blockquote>
<h2>v4.0.0</h2>
<h2>What's Changed</h2>
<p>The release of upload-artifact@v4 and download-artifact@v4 are major
changes to the backend architecture of Artifacts. They have numerous
performance and behavioral improvements.</p>
<p>For more information, see the <a
href="https://github.com/actions/toolkit/tree/main/packages/artifact"><code>@​actions/artifact</code></a>
documentation.</p>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/vmjoseph"><code>@​vmjoseph</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/upload-artifact/pull/464">actions/upload-artifact#464</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/upload-artifact/compare/v3...v4.0.0">https://github.com/actions/upload-artifact/compare/v3...v4.0.0</a></p>
<h2>v3.1.3</h2>
<h2>What's Changed</h2>
<ul>
<li>chore(github): remove trailing whitespaces by <a
href="https://github.com/ljmf00"><code>@​ljmf00</code></a> in <a
href="https://redirect.github.com/actions/upload-artifact/pull/313">actions/upload-artifact#313</a></li>
<li>Bump <code>@​actions/artifact</code> version to v1.1.2 by <a
href="https://github.com/bethanyj28"><code>@​bethanyj28</code></a> in <a
href="https://redirect.github.com/actions/upload-artifact/pull/436">actions/upload-artifact#436</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/upload-artifact/compare/v3...v3.1.3">https://github.com/actions/upload-artifact/compare/v3...v3.1.3</a></p>
<h2>v3.1.2</h2>
<ul>
<li>Update all <code>@actions/*</code> NPM packages to their latest
versions- <a
href="https://redirect.github.com/actions/upload-artifact/issues/374">#374</a></li>
<li>Update all dev dependencies to their most recent versions - <a
href="https://redirect.github.com/actions/upload-artifact/issues/375">#375</a></li>
</ul>
<h2>v3.1.1</h2>
<ul>
<li>Update actions/core package to latest version to remove
<code>set-output</code> deprecation warning <a
href="https://redirect.github.com/actions/upload-artifact/issues/351">#351</a></li>
</ul>
<h2>v3.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Bump <code>@​actions/artifact</code> to v1.1.0 (<a
href="https://redirect.github.com/actions/upload-artifact/pull/327">actions/upload-artifact#327</a>)
<ul>
<li>Adds checksum headers on artifact upload (<a
href="https://redirect.github.com/actions/toolkit/pull/1095">actions/toolkit#1095</a>)
(<a
href="https://redirect.github.com/actions/toolkit/pull/1063">actions/toolkit#1063</a>)</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c7d193f32e"><code>c7d193f</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/upload-artifact/issues/466">#466</a>
from actions/v4-beta</li>
<li><a
href="13131bb095"><code>13131bb</code></a>
licensed cache</li>
<li><a
href="4a6c273b98"><code>4a6c273</code></a>
Merge branch 'main' into v4-beta</li>
<li><a
href="f391bb91a3"><code>f391bb9</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/upload-artifact/issues/465">#465</a>
from actions/robherley/v4-documentation</li>
<li><a
href="9653d03c4b"><code>9653d03</code></a>
Apply suggestions from code review</li>
<li><a
href="875b630764"><code>875b630</code></a>
add limitations section</li>
<li><a
href="ecb21463e9"><code>ecb2146</code></a>
add compression example</li>
<li><a
href="5e7604f84a"><code>5e7604f</code></a>
trim some repeated info</li>
<li><a
href="d6437d0758"><code>d6437d0</code></a>
naming</li>
<li><a
href="1b56155703"><code>1b56155</code></a>
s/v4-beta/v4/g</li>
<li>Additional commits viewable in <a
href="https://github.com/actions/upload-artifact/compare/v3...v4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/upload-artifact&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-18 14:56:13 +08:00
dependabot[bot]
ce8ab0c039
chore(deps): bump actions/download-artifact from 3 to 4 (#1715)
Bumps
[actions/download-artifact](https://github.com/actions/download-artifact)
from 3 to 4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/download-artifact/releases">actions/download-artifact's
releases</a>.</em></p>
<blockquote>
<h2>v4.0.0</h2>
<h2>What's Changed</h2>
<p>The release of upload-artifact@v4 and download-artifact@v4 are major
changes to the backend architecture of Artifacts. They have numerous
performance and behavioral improvements.</p>
<p>For more information, see the <a
href="https://github.com/actions/toolkit/tree/main/packages/artifact"><code>@​actions/artifact</code></a>
documentation.</p>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/bflad"><code>@​bflad</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/download-artifact/pull/194">actions/download-artifact#194</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/download-artifact/compare/v3...v4.0.0">https://github.com/actions/download-artifact/compare/v3...v4.0.0</a></p>
<h2>v3.0.2</h2>
<ul>
<li>Bump <code>@actions/artifact</code> to v1.1.1 - <a
href="https://redirect.github.com/actions/download-artifact/pull/195">actions/download-artifact#195</a></li>
<li>Fixed a bug in Node16 where if an HTTP download finished too quickly
(&lt;1ms, e.g. when it's mocked) we attempt to delete a temp file that
has not been created yet <a
href="hhttps://redirect.github.com/actions/toolkit/pull/1278">actions/toolkit#1278</a></li>
</ul>
<h2>v3.0.1</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/download-artifact/pull/178">Bump
<code>@​actions/core</code> to 1.10.0</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7a1cd3216c"><code>7a1cd32</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/download-artifact/issues/246">#246</a>
from actions/v4-beta</li>
<li><a
href="8f32874a49"><code>8f32874</code></a>
licensed cache</li>
<li><a
href="b5ff8444b1"><code>b5ff844</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/download-artifact/issues/245">#245</a>
from actions/robherley/v4-documentation</li>
<li><a
href="f07a0f73f5"><code>f07a0f7</code></a>
Update README.md</li>
<li><a
href="7226129829"><code>7226129</code></a>
update test workflow to use different artifact names for matrix</li>
<li><a
href="ada9446619"><code>ada9446</code></a>
update docs and bump <code>@​actions/artifact</code></li>
<li><a
href="7eafc8b729"><code>7eafc8b</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/download-artifact/issues/244">#244</a>
from actions/robherley/bump-toolkit</li>
<li><a
href="3132d12662"><code>3132d12</code></a>
consume latest toolkit</li>
<li><a
href="5be1d38671"><code>5be1d38</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/download-artifact/issues/243">#243</a>
from actions/robherley/v4-beta-updates</li>
<li><a
href="465b526e63"><code>465b526</code></a>
consume latest <code>@​actions/toolkit</code></li>
<li>Additional commits viewable in <a
href="https://github.com/actions/download-artifact/compare/v3...v4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/download-artifact&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-18 14:55:50 +08:00