Commit graph

1720 commits

Author SHA1 Message Date
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
Dunqing
3e15fa624b
fix(transformer/react-jsx): undetectable comments in multiline comments (#1211) 2023-11-10 08:20:55 +00:00
dependabot[bot]
57d24e569b
chore(deps): bump the dependencies group with 6 updates (#1210) 2023-11-10 15:09:38 +08:00
Boshen
26705f2dbf
ci(release_napi_parser): check version change before build 2023-11-10 14:47:08 +08:00
Boshen
6489a8ef62
chore(CONTRIBUTING.md): Remove CLA notice 2023-11-10 14:32:59 +08:00
Boshen
eca98cf2ed
s/web-infra-dev/oxc-project 2023-11-10 14:30:18 +08:00
Boshen
2328c068b6
Change license holder to @boshen 2023-11-10 14:26:11 +08:00
Boshen
90ff0ddbe0
refactor: change @oxidation-compiler/napi to oxc-parser (#1209) 2023-11-10 06:17:05 +00:00
Dunqing
8c624abf9c
feat(transformer/react-jsx): throw the pragma and pragmaFrag cannot be set when runtime is automatic error (#1196)
close: #1194

Here's a rough implementation of my idea of throwing an error.
2023-11-10 12:50:54 +08:00
Dunqing
b65094b995
fix(transformer/react-jsx): no need to wrap the Array when there is only one correct child element (#1205) 2023-11-10 10:52:37 +08:00
Boshen
e4c097bb91
chore: mv dir editor/vscode to editors/vscode (#1203) 2023-11-09 21:13:11 +08:00