Commit graph

2998 commits

Author SHA1 Message Date
renovate[bot]
1e9c0bc484
chore(deps): update rust crates (#2747) 2024-03-17 16:40:42 +00:00
Wang Wenzhe
2ef4762de8
feat(linter/tree-shaking): add cache for checking mutating identifiers (#2743) 2024-03-18 00:35:15 +08:00
Jose
f5b4599fd5
feat(linter): eslint/no-ternary (#2744)
Rule detail: https://eslint.org/docs/latest/rules/no-ternary

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-17 22:05:13 +08:00
Jose
6189985e9e
feat(linter): eslint/no-continue (#2742)
Rule detail: https://eslint.org/docs/latest/rules/no-continue

It's my first time in Rust, so I have a lot to learn from you. Maybe I
do some silly mistakes. Sorry!

---------

Co-authored-by: j.buendia <j.buendia>
2024-03-17 21:21:43 +08:00
Andi Pabst
91e8a71214
feat(linter): eslint/no-with (#2741)
Relates to #479 

Rule detail: https://eslint.org/docs/latest/rules/no-with
2024-03-17 19:53:55 +08:00
Andi Pabst
81752b2790
feat(linter): eslint/max-lines (#2739)
Relates to #479 

Rule detail: https://eslint.org/docs/latest/rules/max-lines
2024-03-17 18:59:47 +08:00
cinchen
0623a5335f
feat(linter): eslint-plugin-jest: prefer-to-contain (#2735)
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-to-contain.ts)
2024-03-17 09:44:01 +08:00
overlookmotel
78f1adc043
chore(napi): remove oxc-parser from benchmarks (#2738)
#2724 added CodSpeed benchmarks for NodeJS `oxc-parser`.

Unfortunately it turns out CodSpeed's results are wildly inaccurate.
Unclear why, but have raised an issue with CodSpeed
(https://github.com/CodSpeedHQ/action/issues/96). In meantime it seems
best to remove the benchmarks as they're not useful at present.
2024-03-16 23:39:23 +08:00
Boshen
57bf9857d3
chore(benche): remove redundant black_box because we are using codspeed 2024-03-16 18:59:19 +08:00
Boshen
178d205d53
chore: criterion2 (#2737) 2024-03-16 18:55:04 +08:00
Valerii Smirnov
26a8171b98
implemented import/no-default-export (#2736)
Tests:
https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/tests/src/rules/no-default-export.js
Rule:
https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-default-export.md

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-03-16 13:14:07 +08:00
cinchen
9edda499aa
feat(linter): eslint-plugin-jest: prefer-expect-resolves (#2703)
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-expect-resolves.ts)
2024-03-16 10:08:10 +08:00
overlookmotel
692e9bcab4
chore(napi): only enable Codspeed plugin on CI (#2733)
When running NAPI benchmarks locally, Codspeed plugin hides the
benchmark results.
2024-03-15 15:22:49 +00:00
overlookmotel
75226f3b4a
chore: silence erroneous RA warnings for Tsify (#2731) 2024-03-15 12:42:12 +00:00
overlookmotel
af47aebc7c
chore(napi): add oxc-parser to benchmarks (#2724)
Closes #2616.

Adds benchmarks for NodeJS NAPI build. Measurement includes `JSON.parse`
of the AST on JS side, since that's how it'll be used 99% of the time.

Benchmarks run against same files as Rust parser benchmarks, so we can
see the overhead of transferring AST to JS.
2024-03-15 19:45:02 +08:00
underfin
d7004da253
perf(sourcemap): remove unnecessary binary search (#2728)
Becuase `position` argument is ordering, using binary search is
unnecessary.
2024-03-15 18:50:53 +08:00
Boshen
125edb2650
refactor: remove unused dependencies (#2729) 2024-03-15 18:43:22 +08:00
underfin
2be5f9d6c9
perf(codegen): avoid unnecessary copy (#2727) 2024-03-15 16:09:24 +08:00
Boshen
798a1fde09
fix(parser): fix failed to parse JSXChild after JSXEmptyExpression (#2726)
fixes #2723
2024-03-15 13:39:20 +08:00
Yuji Sugiura
53a8e7ffbe
feat(linter): Add settings.jsdoc (#2706)
Base work for #2642 🏃🏻 

- [x] struct
- [x] bool flags
- [x] tagNamePreferences
2024-03-14 22:34:32 +08:00
cinchen
4947809772
feat(linter/jest): add new property for parse_jest_fn (#2715)
This pr is to add a new return value: `local`, which current property
`name` always return `expect` and the `local` property will return its
alias name for the following example:

```js
import { expect as JEST_EXPECT } from '@jest/globals';
```

and the `jest_expect_fn_call.name` will return `expect` and the
`jest_expect_fn_call.local` wil return `JEST_EXPECT`.
2024-03-14 21:06:05 +08:00
Boshen
a5ddb5b452
Release crates v0.10.0 2024-03-14 18:23:34 +08:00
Boshen
cbc2f5ff97
refactor: remove unused dependencies (#2718) 2024-03-14 17:50:31 +08:00
Boshen
945265a33e
chore: format wasm/parser/Cargo.toml 2024-03-14 17:25:53 +08:00
Boshen
697b6b70c0
feat: merge features serde and wasm to serialize (#2716)
This PR merges the previous confusing features `serde` and `wasm` into a
single `serialize` feature.

We'll eventually do serialize + type information for both wasm and napi
targets.

`oxc_macros` is removed from `oxc_ast`'s dependency because it requires
`syn` and friends, which goes against our policy ["Third-party
dependencies should be
minimal."](https://oxc-project.github.io/docs/contribute/rules.html#development-policy)
2024-03-14 17:13:12 +08:00
underfin
9609c34e6d
fix(codegen): CallExpression sourcemap (#2717) 2024-03-14 07:53:22 +00:00
cinchen
f8fe3af3cf
feat(linter): eslint-plugin-jest: prefer-to-be (#2702)
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-to-be.ts)
2024-03-14 12:14:49 +08:00
Yuji Sugiura
b00d4b8110
fix(semantic/jsdoc): Support multibyte chars (#2694)
Co-authored-by: Boshen <boshenc@gmail.com>
2024-03-13 19:00:01 +08:00
overlookmotel
c820a5b661
fix(ast): serialize empty array elements as null (#2707)
Serialize `ArrayExpressionElement::Elision` variant as `null` in JSON
AST, to align with ESTree.
2024-03-13 10:10:23 +00:00
Boshen
0d7bc8f255
feat(ast): fill in missing ast visits (#2705)
closes #2700
2024-03-13 16:31:01 +08:00
Boshen
1facc8d35d
chore: add clippy::cargo rules 2024-03-13 15:01:08 +08:00
cinchen
265030d049
feat(linter): eslint-plugin-jest: prefer-spy-on (#2666)
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-spy-on.ts)
2024-03-13 14:01:31 +08:00
underfin
2dfc0cc28e
chore: upgrade sourcemap 7.1.1 (#2701) 2024-03-13 13:52:36 +08:00
Wang Wenzhe
11219d4415
feat(linter/tree_shaking): check assignment of identifier (#2697) 2024-03-13 11:45:42 +08:00
Wang Wenzhe
f3eab76410
chore(linter/tree_shaking): comment tree-shaking test code and remove ignore flag (#2696) 2024-03-13 11:42:16 +08:00
overlookmotel
acf127be35
fix(ast): correct TS type for ArrayAssignmentTarget (#2699)
`trailing_comma` field in JSON AST is camel case `trailingComma`.
2024-03-13 00:15:57 +00:00
overlookmotel
89e8d1526f
refactor: derive SerAttrs on all AST types (#2698)
Add `SerAttrs` derive to a few types that I missed out in #2669.
2024-03-13 00:14:04 +00:00
Boshen
0f86333437
refactor(ast): refactor Trivias API - have less noise around it (#2692) 2024-03-12 20:16:36 +08:00
Boshen
86ee074678
fix(parser): remove all duplicated comments in trivia builder (#2689) 2024-03-12 17:51:22 +08:00
Boshen
977c20b677
feat(coverage): add a duplicate comment check (#2688) 2024-03-12 16:52:34 +08:00
Boshen
cda9c93436
fix(parser): improve lexing of jsx identifier to fix duplicated comments after jsx name (#2687) 2024-03-12 15:51:51 +08:00
Boshen
6c6adb46d1
fix(ast): parse rest parameter with the correct optional and type annotation syntax (#2686)
closes #2653
2024-03-12 15:47:22 +08:00
Dunqing
e86cd629c8
feat(linter/import): support check reexport binding in namespace (#2678) 2024-03-12 13:21:19 +08:00
Wang Wenzhe
220eba14cd
refactor(lint): split files for no_side_effects rule (#2684) 2024-03-12 11:09:33 +08:00
Wang Wenzhe
3ae94795a1
feat(linter): report side effect for array element in node_side_effects rule (#2683) 2024-03-12 11:04:38 +08:00
Boshen
366a87975d
feat(linter): resolve ESM star exports (#2682) 2024-03-11 21:43:11 +08:00
Boshen
8a73d18fcf
chore(parser): make sure all span.end >= span.start (#2681)
closes #2679
2024-03-11 19:49:51 +08:00
overlookmotel
75ae563dbc
refactor(span): change shape of Language (#2680)
Closes #2677.

Also changed the JSON output to be `javascript`, `typescript` or
`typescriptDefinition`. The current value `javaScript` / `typeScript` is
a bit weird.
2024-03-11 19:03:06 +08:00
Arnaud Barré
b378e7ecc9
fix(parser): fix span for JSXEmptyExpression with comment (#2673)
[playground](https://oxc-project.github.io/oxc/playground/?code=3YCAAICVgICAgICAgICejwtjmCpbllbPawdM2eEFKwhGb62iFlQWu39yrLCA)

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-03-11 10:50:33 +00:00
renovate[bot]
68c01d304e
chore(deps): update softprops/action-gh-release action to v2 (#2676) 2024-03-11 15:33:50 +08:00