Commit graph

1220 commits

Author SHA1 Message Date
Cameron
7182cc6ebe
feat(printer) Print Argument (#1280) 2023-11-14 09:50:30 +08:00
Cameron
232b93ba41
feat(printer) Print ArrayExpression (#1279) 2023-11-14 09:45:26 +08:00
Cameron
561c73d88c
feat(printer) Basic Printer options (#1278) 2023-11-14 09:37:18 +08:00
Dunqing
0297cf7cc7
fix(prettier): remove redundant newline and semicolons from the Program (#1284) 2023-11-14 09:36:37 +08:00
Dunqing
3942256af4
feat(prettier): correctly format the NumberLiteral (#1283) 2023-11-14 09:27:56 +08:00
Dunqing
7f01d48df3
feat(transformer/react-jsx): set automatic to the default value for runtime (#1270)
Align babel8
2023-11-14 09:26:21 +08:00
Cameron
0fcd0fe28e
feat(linter) eslint plugin unicorn: no useless promise resolve reject (#1254) 2023-11-13 22:21:42 +00:00
Cameron
3db074b87c
feat(printer) Print TryStatement (#1277) 2023-11-13 19:16:05 +00:00
Cameron
2adfec6c0f
feat(printer) Print ContinueStatement (#1276) 2023-11-13 18:29:28 +00:00
Cameron
4ea0aacdb4
feat(printer) Print ThrowStatement (#1275) 2023-11-13 18:28:14 +00:00
Cameron
f892a9e8a1
feat(printer) Print BreakStatement (#1274) 2023-11-13 18:28:06 +00:00
Cameron
cef4c88579
feat(printer) Print UnaryExpression (#1273) 2023-11-13 18:27:52 +00:00
Cameron
a7acd07df8
feat(printer) Print UpdateExpression (#1272) 2023-11-13 18:27:08 +00:00
Cameron
1fb12d0088
feat(printer) Print RegExpLiteral (#1269) 2023-11-13 15:06:59 +00:00
Cameron
1cc003f194
feat(printer) Print PrivateIdentifier (#1268) 2023-11-13 15:06:49 +00:00
Boshen
5c1637b786
feat(prettier): add some basic formatting functions (#1266) 2023-11-13 13:27:53 +00:00
Cameron
ca82125f0b
feat(printer) Print Debugger statement (#1265) 2023-11-13 13:06:29 +00:00
Cameron
74e5616acc
feat(prettier) Print Super expression (#1264) 2023-11-13 13:02:36 +00:00
Cameron
728b7832dc
feat(prettier) Print this expression (#1263) 2023-11-13 13:02:21 +00: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
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
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