Commit graph

2308 commits

Author SHA1 Message Date
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
Dunqing
edc6fa4830
feat(semantic): add SymbolFlags::Function for FunctionDeclaration (#1713)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-12-18 11:26:33 +08:00
IWANABETHATGUY
ef08892027
fix(vscode): report problem more accurately (#1681)
Closed https://github.com/oxc-project/oxc/issues/1674
2023-12-18 10:59:51 +08:00
msdlisper
8f296dfb7a
refactor(linter): use fxHashMap in jsx-a11y settings (#1707)
Continue to refine #1668
2023-12-17 20:05:21 +08:00
Ken-HH24
774a257a66
feat(linter): eslint-plugin-unicorn no-null(style) (#1705)
Try to implement
[no-null](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-null.md)
for #684 .
2023-12-17 10:24:09 +00:00
Wenzhe Wang
a96e4281ab
fix(rulegen): support creating cases in outdent (#1704)
fix: #1694
2023-12-17 13:45:23 +08:00
Cameron
959703631e
chore: add new-oxc-rule to rulegen (#1703) 2023-12-17 10:44:38 +08:00
Cameron
f4f0bdf74a
chore(linter) convert catch error name to a warning (#1700) 2023-12-16 17:52:26 +00:00
Cameron
c61ea76b73
fix(linter) improve diagnostic for no useless spread (#1698)
closes #1697
2023-12-16 17:47:55 +00:00
Boshen
03a02c8b99
chore(CONTRIBUTING): use the website content 2023-12-16 21:02:52 +08:00
Boshen
38ed86972c
ci: bump upload-artifact and download-artifact to v4 for release oxlint 2023-12-16 20:56:36 +08:00
Cameron
73a655f5b5
fix(linter) remove parsing of extends eslint config (#1695)
See https://github.com/oxc-project/oxc/issues/1672

we can bring this back (or a version of it) once we work out how we
want`extends` to work.
2023-12-16 12:46:27 +00:00
msdlisper
6a90cd4af4
feat(linter): add jsx-a11y settings (#1668)
When we developed linter for #1141 , we needed to configure some
settings for `jsx-a11y`, which was not supported before, but I am trying
to support it now.
like this:
```
fn config() -> serde_json::Value {
    serde_json::json!([2,{
        "ignoreNonDOM": true
    }])
}

fn settings() -> serde_json::Value {
    serde_json::json!({
        "jsx-a11y": {
            "components": {
                "Button": "button",
            }
        }
    })
}

let pass = vec![
    ("<Button />", Some(config()), Some(settings())),
];
```
2023-12-16 13:45:14 +08:00
Boshen
cf91379d1b
ci: fix codecov not executing on conformance tests 2023-12-16 13:38:40 +08:00
Cameron
6268f3f2f4
fix(linter) Fix false positives in prefer string start, ends with, port more test cases (#1689)
closes #1687 - uses `intersection` instead of `||`:
 - this improves performance as it combines the flags into a single bitmask instead of doing two seperate checks
 - 

Adds missing test cases from eslint-plugin-unicorn
2023-12-15 17:08:42 +00:00
Andy Armstrong
d101acf833
fix(linter): prefer-string-starts-ends-with: ignore i and m modifiers. (#1688)
Fixes: #1687
2023-12-15 17:00:43 +00:00
Cameron
9f990ce677
fix(linter) false positive in jsx key (#1686) 2023-12-15 22:25:14 +08:00
Cameron
0d7e166f4b
refactor: use new_without_config for jsx_key (#1685) 2023-12-15 11:40:07 +00:00
Cameron
0a8746c751
fix(linter): Panic in prefer string starts, ends with (#1684)
Closes #1683
2023-12-15 11:35:01 +00:00
zoomdong
0f77e5dc52
chore: remove unsless oxc_resolve ci files (#1682) 2023-12-15 10:37:46 +00:00
Dunqing
32db5d29b3
feat(tasks/transformer): add function name plugin (#1676)
The plugin is added at https://github.com/oxc-project/oxc/pull/1510.
2023-12-15 11:29:34 +08:00