Commit graph

1561 commits

Author SHA1 Message Date
Boshen
0856111bea
feat(transformer): implement more of react transform attributes (#1081) 2023-10-28 22:47:39 +08:00
Boshen
96332c85c6
feat(transformer): import jsxs when children is static (#1080) 2023-10-28 17:25:25 +08:00
Boshen
c7a04f42e7
refactor(transformer): remove returning None from transform functions (#1079) 2023-10-28 16:55:38 +08:00
Boshen
d411258be4
feat(transformer): finish transform jsx attribute value (#1078) 2023-10-28 16:46:33 +08:00
Boshen
5fb27fbe8a
feat(transformer): implement key extraction for react automatic (#1077) 2023-10-28 16:34:54 +08:00
Boshen
394ed358f6
feat(transformer): implement react get_attribute_name (#1076) 2023-10-28 16:25:03 +08:00
Boshen
f60fd65f65
feat(transfomer): implement react has_key_after_props_spread (#1075) 2023-10-28 16:17:11 +08:00
Boshen
d6ba8910ba
feat(transformer): add props null to React.createElement (#1074) 2023-10-28 15:59:46 +08:00
Mariusz Antas
0a0e93b55d
feat(linter): eslint-plugin-unicorn require-number-to-fixed-digits-argument (#1073)
Rule taken from https://github.com/web-infra-dev/oxc/issues/684.

Tests taken from:

https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/require-number-to-fixed-digits-argument.mjs

Another rule! 😄
2023-10-28 10:47:27 +08:00
Boshen
e16e7e44e0
feat(transformer): implement react transform attributes (#1071) 2023-10-28 02:12:23 +00:00
Mariusz Antas
162c720ef1
feat(linter): eslint-plugin-unicorn switch-case-braces (#1054)
Rule taken from https://github.com/web-infra-dev/oxc/issues/684.

Tests taken from:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/switch-case-braces.mjs
2023-10-27 00:28:06 +00:00
Wenzhe Wang
b5bfc361fc
feat(transform): transform jsx element name (#1070) 2023-10-27 08:13:40 +08:00
Boshen
d9ba532ca6
refactor(transformer): add an empty SPAN utility for creating AST nodes (#1067) 2023-10-26 18:43:53 +08:00
Boshen
d8f1a7fce6
feat(transformer): start implementing react jsx transform (#1057) 2023-10-26 17:27:05 +08:00
Cameron
94d3e28aac
fix(linter) fix incorrect reporting for no_useless_escape (#1062) 2023-10-26 15:40:45 +08:00
magic-akari
1b64e48ee1
feat(transformer): strip implicit type import for typescript (#1058) 2023-10-26 11:07:30 +08:00
Dunqing
59660a53b8
fix(linter): noTemplateLiterals configuration in no_string_refs rule not working (#1063)
I didn't notice that the `noTemplateLiterals` configuration didn't work
due to the lack of test cases
2023-10-26 11:03:37 +08:00
Cameron
5029dfde5a
feat(linter) eslint-plugin-unicorn - prefer-logical-operator-over-ternary (#1064) 2023-10-26 11:03:12 +08:00
Dunqing
47837e5396
feat(linter): support react/no-string-refs (#1055)
I noticed that there is already a
https://github.com/web-infra-dev/oxc/pull/1053 with the same rule PR.
This PR is currently only used to compare it

However, it seems to be missing a lot of detailing, such as not handling
the react component for es6, which is caused by the lack of test cases.

Also, the `get_parent_es5_component` and `get_parent_es6_component`
function is very useful for other react rules. If #1053 is merged, I
will create another PR to add them
2023-10-25 23:08:33 +08:00
Cameron
5cfeda5022
feat(linter) eslint-plugin-unicorn - text-encoding-identifier-case (#1051)
part of #684

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-25 15:02:50 +00:00
Boshen
f53a5326a5
chore(linter): deny clippy::print_stdout 2023-10-25 22:45:14 +08:00
Wenzhe Wang
ae74e08141
chore(tasks): only use bun to run babel exec.js (#1060) 2023-10-25 22:33:20 +08:00
Cameron
db83f66ed0
feat(linter): eslint-plugin-unicorn - no-empty-file (#1052) 2023-10-25 22:32:37 +08:00
Dunqing
8816649e3c
feat(rulegen): escape from to \” (#1059) 2023-10-25 22:31:09 +08:00
Trevor Manz
ebab50e0ce
feat(linter): eslint-plugin-react no-string-refs (#1053)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-25 03:53:46 +00:00
Wenzhe Wang
7192520d2b
feat(transformer_conformance): use bun to run babel exec.js test cases (#1012)
closes #999 

Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-25 03:06:07 +00:00
Dunqing
d8f07ca71d
feat(linter): support react/no-render-return-value (#1042)
refer to
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
2023-10-24 09:34:20 +00:00
Boshen
af1a76bafa
feat(transformer): implement some of needs_explicit_esm for typescript (#1047)
Co-authored-by: magic-akari <akari.ccino@gmail.com>
2023-10-24 17:30:01 +08:00
Boshen
a442fad3b7
feat(semantic): bind function expression name (#1049)
closes #1018

We'll eventually recover the mangling tests, which should cover this
change.
2023-10-24 17:25:12 +08:00
Cameron
64988f484b
feat(linter): eslint-plugin-react(no-unescaped-entities) (#1044) 2023-10-24 16:41:44 +08:00
Boshen
3eb28e4972
deps(rust): bump 2023-10-24 10:49:41 +08:00
Cameron
a48e880914
reactor(linter): Refactor jsx key rule to use static_property_info (#1043) 2023-10-24 10:00:33 +08:00
Hao Cheng
a2e40ef623
feat(linter): eslint-plugin-react/no-find-dom-node (#1031)
This PR implements the
[eslint-plugin-react/no-find-dom-node](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md)
rule for oxlint.
2023-10-24 01:52:27 +00:00
Cameron
2483e5cbf1
fix(linter) Improve span for jsx key (#1040)
closes #1034
2023-10-23 21:45:57 +08:00
Boshen
854b55a3e6
feat(codegen): json strings proposal (#1039) 2023-10-23 18:29:30 +08:00
Boshen
befc26a440
chore(transform_conformance): remove the duplicated test case 2023-10-23 17:22:27 +08:00
Boshen
a75582046b
refactor(codegen): do not use (code, option) tuple if there are no configurations (#1038)
closes #1035
2023-10-23 16:40:56 +08:00
dependabot[bot]
31edfa105e
chore(deps): bump the dependencies group with 4 updates (#1037)
Bumps the dependencies group with 4 updates:
[regex](https://github.com/rust-lang/regex),
[ropey](https://github.com/cessen/ropey),
[thiserror](https://github.com/dtolnay/thiserror) and
[codspeed-criterion-compat](https://github.com/CodSpeedHQ/codspeed-rust).

Updates `regex` from 1.10.1 to 1.10.2
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/regex/blob/master/CHANGELOG.md">regex's
changelog</a>.</em></p>
<blockquote>
<h1>1.10.2 (2023-10-16)</h1>
<p>This is a new patch release that fixes a search regression where
incorrect
matches could be reported.</p>
<p>Bug fixes:</p>
<ul>
<li>[BUG <a
href="https://redirect.github.com/rust-lang/regex/issues/1110">#1110</a>](<a
href="https://redirect.github.com/rust-lang/regex/issues/1110">rust-lang/regex#1110</a>):
Revert broadening of reverse suffix literal optimization introduced in
1.10.1.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5f1f1c8b6d"><code>5f1f1c8</code></a>
1.10.2</li>
<li><a
href="1a54a829ba"><code>1a54a82</code></a>
deps: bump regex-automata to 0.4.3</li>
<li><a
href="61242b1e0e"><code>61242b1</code></a>
regex-automata-0.4.3</li>
<li><a
href="50fe7d177d"><code>50fe7d1</code></a>
changelog: 1.10.2</li>
<li><a
href="eb950f65e6"><code>eb950f6</code></a>
automata/meta: revert broadening of reverse suffix optimization</li>
<li><a
href="e7bd19dd3e"><code>e7bd19d</code></a>
regex-lite-0.1.5</li>
<li><a
href="0086dec69a"><code>0086dec</code></a>
lite: fix stack overflow test</li>
<li><a
href="4ae14720e9"><code>4ae1472</code></a>
tests: fix compilation of doctests on 32-bit architectures</li>
<li><a
href="cd79881df4"><code>cd79881</code></a>
regex-lite-0.1.4</li>
<li><a
href="466e42ca2b"><code>466e42c</code></a>
lite: fix stack overflow in NFA compiler</li>
<li>See full diff in <a
href="https://github.com/rust-lang/regex/compare/1.10.1...1.10.2">compare
view</a></li>
</ul>
</details>
<br />

Updates `ropey` from 1.6.0 to 1.6.1
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/cessen/ropey/blob/master/CHANGELOG.md">ropey's
changelog</a>.</em></p>
<blockquote>
<h2>[1.6.1] - 2023-10-18</h2>
<ul>
<li>Fixed test code that was incorrect on some platforms / with some
configurations.</li>
<li>Minor documentation improvements.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d41ee247f2"><code>d41ee24</code></a>
Prepare for release v1.6.1.</li>
<li><a
href="c185ec562e"><code>c185ec5</code></a>
Expose tree constants for internal testing.</li>
<li><a
href="dfb0a78635"><code>dfb0a78</code></a>
Merge pull request <a
href="https://redirect.github.com/cessen/ropey/issues/91">#91</a> from
blinxen/master</li>
<li><a
href="e629850c3a"><code>e629850</code></a>
[tests] Run search_char_idx_02 and search_line_break_idx_04 only in
debug mode</li>
<li><a
href="387ea30b35"><code>387ea30</code></a>
Merge pull request <a
href="https://redirect.github.com/cessen/ropey/issues/86">#86</a> from
tshepang/patch-1</li>
<li><a
href="9e257b06c4"><code>9e257b0</code></a>
Revert &quot;missing comma&quot;</li>
<li><a
href="1af8c3983b"><code>1af8c39</code></a>
missing comma</li>
<li><a
href="7393572984"><code>7393572</code></a>
missing comma (for readability)</li>
<li><a
href="f1292371ca"><code>f129237</code></a>
Merge pull request <a
href="https://redirect.github.com/cessen/ropey/issues/81">#81</a> from
Johan-Mi/master</li>
<li><a
href="3485d8c9d3"><code>3485d8c</code></a>
Remove unused lifetimes</li>
<li>See full diff in <a
href="https://github.com/cessen/ropey/compare/v1.6.0...v1.6.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `thiserror` from 1.0.49 to 1.0.50
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/thiserror/releases">thiserror's
releases</a>.</em></p>
<blockquote>
<h2>1.0.50</h2>
<ul>
<li>Improve diagnostic when a #[source], #[from], or #[transparant]
attribute refers to a type that has no std::error::Error impl (<a
href="https://redirect.github.com/dtolnay/thiserror/issues/258">#258</a>,
thanks <a
href="https://github.com/de-vri-es"><code>@​de-vri-es</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a7d220d791"><code>a7d220d</code></a>
Release 1.0.50</li>
<li><a
href="4088d169ed"><code>4088d16</code></a>
Ignore module_name_repetitions pedantic clippy lint</li>
<li><a
href="ebebf77fe0"><code>ebebf77</code></a>
Format ui tests with rustfmt</li>
<li><a
href="ff0a0a5859"><code>ff0a0a5</code></a>
Source and From attributes only have single-ident path</li>
<li><a
href="7cec716420"><code>7cec716</code></a>
Remove reliance on Spanned for Member</li>
<li><a
href="c9fe739272"><code>c9fe739</code></a>
Touch up PR 258</li>
<li><a
href="4850c6f80f"><code>4850c6f</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/thiserror/issues/258">#258</a>
from de-vri-es/as-dyn-error-span</li>
<li><a
href="a49f7c603d"><code>a49f7c6</code></a>
Change span of <code>as_dyn_error()</code> to point compile error at
attribute.</li>
<li><a
href="f4eac7ef7b"><code>f4eac7e</code></a>
Ignore needless_raw_string_hashes clippy lint</li>
<li>See full diff in <a
href="https://github.com/dtolnay/thiserror/compare/1.0.49...1.0.50">compare
view</a></li>
</ul>
</details>
<br />

Updates `codspeed-criterion-compat` from 2.2.0 to 2.3.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/CodSpeedHQ/codspeed-rust/releases">codspeed-criterion-compat's
releases</a>.</em></p>
<blockquote>
<h2>v2.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>fix(ci): change the version of the codspeed action to main by <a
href="https://github.com/art049"><code>@​art049</code></a> in <a
href="https://redirect.github.com/CodSpeedHQ/codspeed-rust/pull/18">CodSpeedHQ/codspeed-rust#18</a></li>
<li>feat(cargo-codspeed): add <code>--features vendored-openssl</code>
by <a href="https://github.com/Boshen"><code>@​Boshen</code></a> in <a
href="https://redirect.github.com/CodSpeedHQ/codspeed-rust/pull/14">CodSpeedHQ/codspeed-rust#14</a></li>
<li>chore(cargo-codspeed): set verbosity to normal by <a
href="https://github.com/Boshen"><code>@​Boshen</code></a> in <a
href="https://redirect.github.com/CodSpeedHQ/codspeed-rust/pull/15">CodSpeedHQ/codspeed-rust#15</a></li>
<li>chore: bump rust toolchain to 1.73 by <a
href="https://github.com/art049"><code>@​art049</code></a> in <a
href="https://redirect.github.com/CodSpeedHQ/codspeed-rust/pull/21">CodSpeedHQ/codspeed-rust#21</a></li>
<li>feat(criterion): allow explicit lifetime usage with compat by <a
href="https://github.com/art049"><code>@​art049</code></a> in <a
href="https://redirect.github.com/CodSpeedHQ/codspeed-rust/pull/22">CodSpeedHQ/codspeed-rust#22</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/Boshen"><code>@​Boshen</code></a> made
their first contribution in <a
href="https://redirect.github.com/CodSpeedHQ/codspeed-rust/pull/14">CodSpeedHQ/codspeed-rust#14</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/CodSpeedHQ/codspeed-rust/compare/v2.2.0...v2.3.0">https://github.com/CodSpeedHQ/codspeed-rust/compare/v2.2.0...v2.3.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="518659da83"><code>518659d</code></a>
Release 2.3.0</li>
<li><a
href="dd3763fea9"><code>dd3763f</code></a>
feat(criterion): allow explicit lifetime usage with compat</li>
<li><a
href="1621b664db"><code>1621b66</code></a>
chore(cargo-codspeed): set verbosity to normal</li>
<li><a
href="87506ab5ca"><code>87506ab</code></a>
chore: update readme</li>
<li><a
href="7b43e1eb7c"><code>7b43e1e</code></a>
feat(cargo-codspeed): add --features <code>vendored-openssl</code></li>
<li>See full diff in <a
href="https://github.com/CodSpeedHQ/codspeed-rust/compare/v2.2.0...v2.3.0">compare
view</a></li>
</ul>
</details>
<br />


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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 15:07:02 +08:00
Boshen
009fda9791
Release oxlint v0.0.14 2023-10-23 10:50:43 +08:00
Boshen
b6b6853e41
fix(linter): point to the opening fragment for jsx_no_useless_fragment
In real codebases the fragment child may be a wall of text that gets
printed on the screen.
2023-10-23 10:24:10 +08:00
Cameron
7edc7f0690
feat(linter) eslint-plugin-react(jsx-no-comment-text-nodes) (#1027) 2023-10-23 09:42:09 +08:00
Cameron
d129425b67
feat(linter) eslint-plugin-react: no dangerously set inner html (#1029) 2023-10-23 09:39:12 +08:00
Cameron
76ac9cd4c5
fix(lexer) Fix spans for jsx children (#1030)
Closes #1026
2023-10-22 22:44:19 +08:00
Angelo Annunziata
46207c0e4b
chore: update just file (#1028)
**What I Did**
- move command short-description just above the command to show it
correctly in `just -l`
- just one git command to update local repo for both oxc and submodules
2023-10-22 12:06:49 +08:00
Boshen
01671729b7
chore(span,index): update documentation 2023-10-22 11:23:36 +08:00
Cameron
dea9b7cbac
feat(linter): eslint-plugin-react: jsx-no-duplicate-props (#1024)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-21 15:25:32 +00:00
Sg
25247e3839
feat(linter): eslint/no-fallthrough (nursery) 2023-10-21 23:22:56 +08:00
Cameron
f13fc2287a
feat(linter): eslint-plugin-react/no-useless-fragment (#1021) 2023-10-21 23:16:46 +08:00
Cameron
72cf9ec725
chore(rulegen) Add rule gen for react rules (#1023) 2023-10-21 22:39:19 +08:00
Boshen
1edf67eb68
Add more credits to README 2023-10-21 22:30:11 +08:00