Commit graph

2186 commits

Author SHA1 Message Date
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
yoshi2no
cf0793b675
feat(linter): tabindex-no-positive for eslint-plugin-jsx-a11y (#1677)
partof: #1141

I've implemented `tabindex-no-positive` rule for jsx_a11y

originals:

- doc:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/tabindex-no-positive.md
- code:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/rules/tabindex-no-positive.js
- test:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/__tests__/src/rules/tabindex-no-positive-test.js
2023-12-15 11:17:38 +08:00
Herrington Darkholme
c63f5123b3
feat(parser/napi): add flexbuffer to AST transfer (2x speedup) (#1680)
Hi! I have created a proof of concept of improving using oxc in
JavaScript. The method is not polished but it provides valuable insights
for future direction!

Feel free to close~ It is for reference only :)

# Context 

This is a proof of concept implementation of passing binary AST to
JavaScript. JavaScript can selectively read flexbuffers-based AST nodes
on demand to avoid the deserialization toll. More context
[here](https://dev.to/herrington_darkholme/benchmark-typescript-parsers-demystify-rust-tooling-performance-2go8).

# Changes

* Add a `parseSyncBuffer` napi method to return a binary AST from Rust
to JavaScript. The AST is in flexbuffer format.
* Add a `test_buffer.js` to test usage of flexbuffers in JavaScript. It
is in cjs format because flexbuffers does not support ESM :/

# Result
Some preliminary results, for reference only.

```
~ node test_buffer.js
testJSON: 4.043s
testBuffer: 2.395s
```

Buffer based API is 100% faster than JSON.

# Future Ideas
* Flexbuffers itself is slow. A better binary protocol is desired!
* Using binary reader to traverse AST is undesirable. A proxy-based API
to emulate object behavior will be nice.
2023-12-15 02:52:33 +00:00
IWANABETHATGUY
37d5152cce
feat(vscode): use icon to represent enabled status (#1675) 2023-12-14 20:59:26 +08:00
RiESAEX
e5752a5462
fix(linter): fix excape_case panicing on unicode strings (#1673)
fix: #1671
2023-12-14 20:32:16 +08:00
Boshen
ddab18f5af
chore: update snapshots - upgrading bun fixes this??? 2023-12-14 16:58:47 +08:00
Cameron
9275c749ca
feat(linter) Parse eslint configuration (#1146)
**DRAFT**

Adds support for parsing `eslint` configuration files.

Example: 
```sh
cargo run --bin=oxc_cli lint --config-path ./.eslintrc.json .
```

This isn't a full implementation of how eslint parses configs but should
be fine for now:

Currently supported `extends`:
 - `eslint:recommended` -> `eslint`
 - `plugin:react/recommended` -> `react`
 - `plugin:@typescript-eslint/recommended` -> `typescript`
 - `plugin:react-hooks/recommended` -> `react`
 - `plugin:unicorn/recommended` -> `unicorn`
 - `plugin:jest/recommended` -> `jest`

These defaults can _all_ be overridden by configuring the rule in the
`rules` section of the estlint config:

e.g.
```json
{
    "extends": [
        "eslint:recommended"
    ],
    "rules": {
        "eqeqeq": "off"
    },
}
```

This would enable of of the rules within the `eslint` group. But would
not enable `eqeqeq` as it is explicitly disabled

Note, we do not currently support the following:
 - supplying a `filter` and `config-path`
 - supplying a `plugin` and `config-path`
2023-12-14 16:29:27 +08:00
Hao Cheng
c9589b5447
feat(linter): eslint-plugin-unicorn/prefer-prototype-methods (#1660) 2023-12-14 14:55:03 +08:00
Boshen
8edcab82f2
chore(lexer): document the accessor keyword 2023-12-14 12:55:55 +08:00
IWANABETHATGUY
e529b38e32
feat: add option to control enable/disable oxc linter (#1665)
1. Closed https://github.com/oxc-project/oxc/issues/1655
2023-12-14 12:45:34 +08:00
Wenzhe Wang
d719af473c
refactor(linter): make some jest rules report more detailed (#1666) 2023-12-14 11:05:06 +08:00
IWANABETHATGUY
7594a9d10f
chore: format typescript and json file in editors/vscode (#1667)
1. just format, nothing else
2023-12-14 02:01:24 +08:00
Wenzhe Wang
90524c83f7
feat(linter): add eslint-plugin-import(export) rule (#1654) 2023-12-13 23:12:45 +08:00
Wenzhe Wang
c49a1f6b32
feat(prettier): add print_binaryish_expressions (#1664) 2023-12-13 22:52:53 +08:00
Dunqing
f58b6279c8
feat(transformer): add arrow_functions plugin (#1663) 2023-12-13 20:46:28 +08:00
Dunqing
67b7cc0f51
feat(ast): support visit more jsx ast in visit (#1662) 2023-12-13 20:41:44 +08:00
Ken-HH24
282771afc4
feat(linter): eslint-plugin-unicorn prefer-dom-node-text-content(style) (#1658)
Implement [prefer-dom-node-text-content](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md) for #684 .
2023-12-13 12:19:00 +00:00
Dunqing
00806384ff
perf(linter/react): find class node by symbols in get_parent_es6_component (#1657)
This way we can get the class node faster. But I don't know if this is a
good way. In `eslint-plugin-react`, they get class node by scope. But
oxc cannot do the same way
2023-12-13 13:48:53 +08:00
Dunqing
864176a051
feat(transformer/react-jsx): returns ThisExpression when identifier is this (#1661) 2023-12-13 13:47:54 +08:00
Boshen
31600ac8de
Release oxlint and vscode extension v0.0.20 2023-12-13 13:37:06 +08:00
Boshen
425e318e9a
chore: update homepage links 2023-12-13 13:36:27 +08:00
Boshen
4ced3f949c
refactor(linter): separate out the category in the output of --rules 2023-12-13 13:23:52 +08:00
Boshen
ca009d5995
chore(linter): move prefer-array-flat to pedantic 2023-12-13 13:16:18 +08:00