Commit graph

1730 commits

Author SHA1 Message Date
Cameron
728b7832dc
feat(prettier) Print this expression (#1263) 2023-11-13 13:02:21 +00:00
Boshen
4a6f54cc1a
feat(prettier_conformance): add prettier test runner (#1262) 2023-11-13 20:14:35 +08:00
Cameron
c0d42b8a33
feat(linter) eslint plugin unicorn: prefer dom node dataset (#1257) 2023-11-13 09:46:41 +00:00
Radu Baston
76d4690218
feat(linter) eslint plugin unicorn: empty-brace-spaces (#1249)
New contributor here to an amazing project. I think I covered all the
cases where braces can be used.
Plugin: #684 

[Rule](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md)

---------

Co-authored-by: Radu Baston <radu.baston@sectorlabs.ro>
2023-11-13 17:28:23 +08:00
Cameron
97e0212d58
feat(linter) eslint plugin unicorn: no lonely if (#1252) 2023-11-13 09:19:50 +00:00
Cameron
90b09e9725
feat(linter) eslint plugin unicorn: no typeof undefined (#1251) 2023-11-13 09:07:53 +00:00
Cameron
1f58023739
feat(linter) eslint-plugin-unicorn: prefer string slice (#1247) 2023-11-13 09:02:12 +00:00
Cameron
6d12f6a5dc
feat(linter) eslint plugin unicorn: no negated condition (#1253) 2023-11-13 08:53:10 +00:00
Cameron
bd2e3f746f
feat(linter) eslint plugin unicorn: prefer string replace all (#1248) 2023-11-13 08:52:22 +00:00
dependabot[bot]
6da449ef48
chore(deps): bump the dependencies group with 1 update (#1261)
Bumps the dependencies group with 1 update:
[env_logger](https://github.com/rust-cli/env_logger).

<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md">env_logger's
changelog</a>.</em></p>
<blockquote>
<h2>[0.10.1] - 2023-11-10</h2>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="36623f573b"><code>36623f5</code></a>
chore: Release env_logger version 0.10.1</li>
<li><a
href="8a033d8438"><code>8a033d8</code></a>
chore: Fix packaging</li>
<li><a
href="9df7e6c081"><code>9df7e6c</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-cli/env_logger/issues/241">#241</a>
from ChrisDenton/simple-insert</li>
<li><a
href="46ccdd94f5"><code>46ccdd9</code></a>
perf: Replace <code>HashMap</code> with a <code>Vec</code></li>
<li><a
href="bdc96a421f"><code>bdc96a4</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-cli/env_logger/issues/249">#249</a>
from atouchet/v10</li>
<li><a
href="983837c47b"><code>983837c</code></a>
Update links and remove broken badge</li>
<li><a
href="dcd220dfaf"><code>dcd220d</code></a>
Update listed version number</li>
<li><a
href="36b1508ea1"><code>36b1508</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-cli/env_logger/issues/260">#260</a>
from y-yagi/2018-edition</li>
<li><a
href="6f64347c6a"><code>6f64347</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-cli/env_logger/issues/282">#282</a>
from epage/syntax</li>
<li><a
href="b29735781a"><code>b297357</code></a>
chore: Update docs and examples to 2018 edition</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-cli/env_logger/compare/v0.10.0...v0.10.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=env_logger&package-manager=cargo&previous-version=0.10.0&new-version=0.10.1)](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 <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-11-13 08:38:31 +00:00
Boshen
65be4acdd4
feat(prettier): init project and infrastructure (#1260)
> [!NOTE]  
> This is going to be a community project because I don't have the time
and energy to work on this alone.

# Prettier

Background: 22.5K USD bounty for prettier written in Rust?!

See https://console.algora.io/challenges/prettier

> [!WARNING]  
> ## Contribution Agreement
> 
> You hereby agree that you contribute for fun and for the purpose of
learning, not for the goal of winning the challenge.
> 
> In the unlikely event of winning the challenge, @boshen will
ultimately decide on how to spend the money.
>

> [!IMPORTANT]  
Please talk to me on [discord](https://discord.com/invite/9uXCAwqQZW)
and indicate that you are willing to contribute and agree to the
contribution agreement.

## Getting started

Create a `test.js` and run the example `just example prettier` from
`crates/oxc_prettier/examples/prettier.rs`, follow the code structure
and read the references documented at the top of the files.

# Tasks

- [x] Have the basic infrastructure ready for contribution
- [ ] Implement a test runner in Rust which extracts the snapshots and
do a comparison over it
- [ ] Establish a way to pass all the tests by manually porting code
- [ ] Pass as many tests as possible in
https://github.com/prettier/prettier/tree/main/tests/format/js
2023-11-13 14:34:20 +08:00
Wenzhe Wang
f3788eec31
refactor(linter): remove all old parse_expect_jest_fn_call (#1259) 2023-11-13 14:33:41 +08:00
Dunqing
472707c04e
feat(task/transformer-conformance): skip babel 8 unsupported test cases (#1258)
Prior to babel8, object merging would use `babelHelper.extend`, which
caused most tests to fail
2023-11-13 11:05:36 +08:00
Cameron
6f642e2a9f
feat(linter) eslint plugin unicorn: prefer dom node append (#1256) 2023-11-13 08:58:06 +08:00
Cameron
89b6fce958
feat(linter) eslint plugin unicorn: no document cookie (#1255) 2023-11-13 08:56:18 +08:00
Cameron
11b43fa528
feat(linter) eslint plugin unicorn: no this assignment (#1250) 2023-11-13 08:49:05 +08:00
Cameron
8496156bb7
feat(linter) eslint plugin unicorn: prefer string starts ends with (#1246) 2023-11-13 08:43:02 +08:00
Cameron
d55ce0ddc6
fix(linter) Fix prefer date now with parenthesis (#1245) 2023-11-13 08:42:05 +08:00
Cameron
f3f3383733
fix(linter) Fix no object as default param with parenthesis (#1244) 2023-11-13 08:41:47 +08:00
Cameron
3a92828a0a
fix(linter) Fix no instanceof array with parenthesis (#1243) 2023-11-13 08:41:33 +08:00
Cameron
e60c287b77
fix(linter) Fix catch error name with parenthesis (#1242) 2023-11-13 08:41:20 +08:00
Cameron
f25b496eea
fix(linter) Fix prefer type error with parenthesis (#1240) 2023-11-13 00:05:58 +08:00
Cameron
9f653881bb
fix(linter) Fix prefer logical operator error with parenthesis (#1241) 2023-11-13 00:05:24 +08:00
Wenzhe Wang
80f3d13761
chore(linter): replace with parse_general_jest_fn_new (#1237) 2023-11-12 20:27:54 +08:00
Dunqing
d62631e239
refactor(transformer/react-jsx): use extend instead of for-in with push (#1236) 2023-11-12 19:26:15 +08:00
Dunqing
47ba874f4f
refactor(transformer/react-jsx): improve SpreadChildrenAreNotSupported error implementation (#1235) 2023-11-12 19:17:09 +08:00
Wenzhe Wang
1dd321e021
refactor(linter): remove all old parse_general_jest_fn_call in jest rules (#1232) 2023-11-12 18:57:30 +08:00
magic-akari
9c0aafcd1c
fix(parser): Disallow ReservedWord in NamedExports (#1230)
- fix: #1222

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-12 10:52:02 +00:00
Wenzhe Wang
f775488102
refactor(lint): replace parse_jest_fn_* methods in eslint-plugin-jest(no-standalone-expect) rule (#1231) 2023-11-12 18:51:24 +08:00
Wenzhe Wang
18a35252fc
feat(linter): reimplement eslint-plugin-jest(no-identical-title) (#1229) 2023-11-12 18:43:27 +08:00
Dunqing
1eef241788
feat(transformer/react-jsx): support for throwing SpreadChildrenAreNotSupported error (#1234) 2023-11-12 18:37:19 +08:00
Wenzhe Wang
72b3bdf619
refactor(linter): replace all is_type_of_jest_fn_call (#1228) 2023-11-12 18:37:03 +08:00
Wenzhe Wang
efc346e56a
refactor(linter): migrate eslint-plugin-jest(no-alias-method) (#1226) 2023-11-12 11:33:25 +08:00
Hao Cheng
82c1769836
feat(linter): eslint-plugin-unicorn/no-abusive-eslint-disable (#1125)
This PR implements the
[eslint-plugin-unicorn/no-abusive-eslint-disable](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md)
rule.

Tests taken from
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/no-abusive-eslint-disable.mjs.

Related issue: #684
2023-11-12 11:32:14 +08:00
Wenzhe Wang
071311a898
refactor(lint): migrate eslint-plugin-jest(expec-expect) (#1225) 2023-11-12 11:26:31 +08:00
Dunqing
39e608734f
feat(transformer/react-jsx): support for throwing ImportSourceCannotBeSet error (#1224) 2023-11-12 11:17:23 +08:00
Wenzhe Wang
b4ce2b5f9b
refactor(linter): remove unused logic in resolve_to_jest_fn (#1208)
I copied parse_jest_fn.rs file to parse_jest_fn_new.rs, the new file only changed `resolve_to_jest_fn` now. The new version of `parse_jest_fn_call` doesn't need to get the original of node, and I changed its parameters. I tried to add it to the old file, but it will influence other files, so I created a new file for it. I will delete the old file after all rules migrated.
2023-11-12 11:15:23 +08:00
Boshen
9aa78f65fd
Update Cargo.lock 2023-11-11 23:28:41 +08:00
Boshen
efb3fd45bf
Release oxc_resolver v0.5.3 2023-11-11 23:26:07 +08:00
zhangpeng
0fa24bcafc
feat(resovler): impl Into for IOError (#1223)
patch for rspack issue
[#4564](https://github.com/web-infra-dev/rspack/issues/4564)
2023-11-11 23:21:51 +08:00
Dunqing
b7e8feb7c1
feat(transformer/react-jsx): support throw valueless-key error (#1221) 2023-11-11 20:10:07 +08:00
Dunqing
a22ced78f1
feat(transformer/react-jsx): implement throwIfNamespace option (#1220) 2023-11-11 13:31:45 +08:00
Boshen
50d2d88a36
chore(transform_conformance): update snapshot 2023-11-11 10:57:09 +08:00
Dunqing
48242367bb
fix(transformer/react-jsx): missing import jsxs in nested fragment (#1218) 2023-11-11 02:45:42 +00:00
Dunqing
a0f40cb058
fix(transformer/react-jsx): missing default options when plugin without config (#1219) 2023-11-11 10:38:28 +08:00
magic-akari
8afb81aa34
fix(parser): ASI of async class member (#1214)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-10 16:21:51 +00:00
Boshen
a60b7e5856
feat(tasks): add misc tests to codegen (#1215) 2023-11-10 16:13:31 +00:00
Boshen
c202bc9dcb
feat: Release resolver with NAPI (#1212) 2023-11-10 15:25:17 +00:00
Boshen
fdd8018c8e
chore(transform_conformance): update snapshot 2023-11-10 18:28:48 +08:00
Dunqing
d9b450414b
feat(transformer/react-jsx): when the source type is a script, use require to import the react (#1207) 2023-11-10 18:17:31 +08:00