Boshen
bb646f2bf9
feat(tasks/minsize): show target size for easier comparison ( #4201 )
2024-07-11 12:38:45 +00:00
IWANABETHATGUY
1c117eb20d
fix: avoid print extra semicolon after accessor property ( #4199 )
...
## Before
```js
export default class Foo { @x @y accessor #aDef = 1 }
```
**output**
```bash
Original:
export default class Foo { @x @y accessor #aDef = 1 }
Printed:
export default class Foo {
accessor #aDef=1;;
}
```
2024-07-11 20:16:02 +08:00
Boshen
e3e663bae4
feat(mangler): initialize crate and integrate into minifier ( #4197 )
2024-07-11 10:35:13 +00:00
Dunqing
bbe5dede07
refactor(semantic): set current_scope_id to scope_id in enter_scope ( #4193 )
...
close : #4170
2024-07-11 08:45:35 +00:00
Dunqing
7f1adddaf0
refactor(semantic): correct scope in CatchClause ( #4192 )
...
close : #4186
CatchClause has two scopes. The first one is `CatchClause`, which will add a `CatchParameter` to it. The second one is `Block`, which will add binding that declares in the current block scope.
The spec has a syntax error about `CatchParameter`
- It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the LexicallyDeclaredNames of Block.
2024-07-11 08:45:30 +00:00
Boshen
aa22073736
refactor(codegen): improve print API ( #4196 )
2024-07-11 08:41:04 +00:00
github-actions[bot]
4f26e51b74
Release oxlint v0.6.0 ( #4194 )
...
## [0.6.0] - 2024-07-11
- 5731e39 ast: [**BREAKING**] Store span details inside comment struct
(#4132 ) (Luca Bruno)
### Features
- fb549e1 linter: Add vitest/no-focused-tests rule (#4178 ) (mysteryven)
- 6c49007 linter: Add fixer for
@typescript-eslint/consistent-type-imports (#3984 ) (mysteryven)
- 278c3e9 linter: Add fixer for jsx-a11y/aria-props (#4176 ) (DonIsaac)
- 2188144 linter: Eslint-plugin-jest/prefer-hooks-in-order (#4052 )
(cinchen)
- cc58614 linter: Better schemas for allow/warn/deny (#4150 ) (DonIsaac)
- c5b4be0 linter: Add fixer for prefer-node-protocol (#4129 ) (DonIsaac)
- 7ec0c0b linter/eslint: Implement no-label-var (#4087 ) (Jelle van der
Waa)
### Bug Fixes
- ed4c54c eslint/radix: Detect yield Number.parseInt variant (#4110 )
(Jelle van der Waa)
- e9ad03b linter: Fixer for no-debugger creates incorrect code (#4184 )
(DonIsaac)
- bd69571 linter: Fix top level return panic in
eslint/array_callback_return (#4167 ) (Boshen)
- c8f5664 linter: Fix panic with unicode in
unicorn/prefer_dom_node_dataset (#4166 ) (Boshen)
- f2b3273 linter: Fix fixer panic in
typescript/consistent_indexed_object_style (#4165 ) (Boshen)
- 2334515 linter: Panic in `get_enclosing_function` (#4121 ) (DonIsaac)
- 1b91d40 linter: Incorrect fixer for `no-unused-labels` (#4123 ) (Don
Isaac)
- 1729249 linter: Incorrect fix in
`no-single-promise-in-promise-methods` rule; (#4094 ) (DonIsaac)
- cc7e893 linter/tree-shaking: Avoid recursive function stackoverflow
(#4191 ) (mysteryven)
- 28eeee0 parser: Fix asi error diagnostic pointing at invalid text
causing crash (#4163 ) (Boshen)
- 0f02608 semantic: Bind `TSImportEqualsDeclaration`s (#4100 ) (Don
Isaac)
### Performance
- ddfa343 diagnostic: Use `Cow<'static, str>` over `String` (#4175 )
(DonIsaac)
### Refactor
- 2687ebc react: Use find_binding helper for finding React binding
(#4108 ) (Jelle van der Waa)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-11 14:38:41 +08:00
mysteryven
fb549e1288
feat(linter): add vitest/no-focused-tests rule ( #4178 )
...
Rule detail: https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
2024-07-11 05:37:04 +00:00
mysteryven
cc7e893634
fix(linter/tree-shaking): avoid recursive function stackoverflow ( #4191 )
...
fixes : #4164
2024-07-11 05:28:35 +00:00
mysteryven
6c49007b27
feat(linter): add fixer for @typescript-eslint/consistent-type-imports ( #3984 )
...
This rule's fixer is complicated, I do line by line copy as possible.
7b13dae347/packages/eslint-plugin/src/rules/consistent-type-imports.ts
2024-07-11 04:48:04 +00:00
Boshen
c8184723f4
feat(minifier): dce conditional expression && or || ( #4190 )
2024-07-11 04:40:23 +00:00
DonIsaac
e9ad03bb62
fix(linter): fixer for no-debugger creates incorrect code ( #4184 )
...
Part of #4179 .
Fixes cases like:
```js
if (foo) debugger
// got fixed into
if (foo)
// but now gets fixed to
if (foo) {}
```
2024-07-11 04:33:43 +00:00
DonIsaac
278c3e9313
feat(linter): add fixer for jsx-a11y/aria-props ( #4176 )
...
Part of #4179 .
Adds a fixer for some common typos.
2024-07-11 04:33:37 +00:00
Jelle van der Waa
7ec0c0bdd4
feat(linter/eslint): Implement no-label-var ( #4087 )
...
Rule Detail:
[link](https://eslint.org/docs/latest/rules/no-label-var )
Co-authored-by: Don Isaac <donald.isaac@gmail.com>
2024-07-10 23:22:31 -04:00
github-actions[bot]
2a169d1969
Release crates v0.20.0 ( #4189 )
...
## [0.20.0] - 2024-07-11
- 5731e39 ast: [**BREAKING**] Store span details inside comment struct
(#4132 ) (Luca Bruno)
### Features
- 67fe75e ast, ast_codegen: Pass the `scope_id` to the `enter_scope`
event. (#4168 ) (rzvxa)
- 54cd04a minifier: Implement dce with var hoisting (#4160 ) (Boshen)
- 44a894a minifier: Implement return statement dce (#4155 ) (Boshen)
- 725571a napi/transformer: Add `jsx` option to force parsing with jsx
(#4133 ) (Boshen)
### Bug Fixes
- 48947a2 ast: Put `decorators` before everything else. (#4143 ) (rzvxa)
- 7a059ab cfg: Double resolution of labeled statements. (#4177 ) (rzvxa)
- 4a656c3 lexer: Incorrect lexing of large hex/octal/binary literals
(#4072 ) (DonIsaac)
- 28eeee0 parser: Fix asi error diagnostic pointing at invalid text
causing crash (#4163 ) (Boshen)
### Performance
- ddfa343 diagnostic: Use `Cow<'static, str>` over `String` (#4175 )
(DonIsaac)
- 2203143 semantic: Store unresolved refs in a stack (#4162 ) (lucab)
- fca9706 semantic: Faster search for leading comments (#4140 ) (Boshen)
### Documentation
- bdcc298 ast: Update the note regarding the `ast_codegen` markers.
(#4149 ) (rzvxa)
### Refactor
- 03ad1e3 semantic: Tweak comment argument type (#4157 ) (lucab)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-11 11:05:49 +08:00
Boshen
8c54a2f1ed
fix(tasks/ast_codegen): run cargo fmt synchronously ( #4181 )
...
relates #4152
This is my wild guess, because it works in my other script 143685deb1/xtask/src/main.rs (L21)
2024-07-11 02:59:30 +00:00
Boshen
07506ece83
ci: add a git diff check after running tests
2024-07-11 10:18:56 +08:00
DonIsaac
ddfa343475
perf(diagnostic): use Cow<'static, str> over String ( #4175 )
...
Allows us to use `&'static str` for error and help messages without allocating them into `String`s.
2024-07-11 01:44:13 +00:00
rzvxa
7a059ab53a
fix(cfg): double resolution of labeled statements. ( #4177 )
...
Fixes #4173
2024-07-11 01:39:28 +00:00
Boshen
ca0b4fa08a
refactor(tasks): clean up test files and remove libs.txt ( #4172 )
2024-07-10 17:38:06 +00:00
Boshen
083fe38971
chore(codegen): add a for loop special case
2024-07-11 01:35:05 +08:00
Boshen
254d5e07e3
fix(wasm): codegen is broken due to preserve_parens(false)
2024-07-11 01:33:10 +08:00
DonIsaac
4a656c3a18
fix(lexer): incorrect lexing of large hex/octal/binary literals ( #4072 )
...
Closes #3347 . Implementation follows the approach described by @overlookmotel [here](https://github.com/oxc-project/oxc/issues/3347#issuecomment-2119004288 ).
2024-07-10 16:39:10 +00:00
Boshen
bd69571965
fix(linter): fix top level return panic in eslint/array_callback_return ( #4167 )
2024-07-10 15:28:01 +00:00
rzvxa
67fe75ec6c
feat(ast, ast_codegen): pass the scope_id to the enter_scope event. ( #4168 )
2024-07-10 15:19:23 +00:00
Boshen
c8f5664e0a
fix(linter): fix panic with unicode in unicorn/prefer_dom_node_dataset ( #4166 )
2024-07-10 15:14:45 +00:00
lucab
22031430b1
perf(semantic): store unresolved refs in a stack ( #4162 )
...
This tweaks `SemanticBuilder` logic in order to accumulate unresolved
references in a stack, getting rid of the previous index-vector which
is not required under the current access pattern.
Ref: https://github.com/oxc-project/oxc/pull/4107#issuecomment-2214167393
2024-07-10 14:59:16 +00:00
Boshen
f2b32731df
fix(linter): fix fixer panic in typescript/consistent_indexed_object_style ( #4165 )
2024-07-10 14:45:15 +00:00
Boshen
28eeee0f71
fix(parser): fix asi error diagnostic pointing at invalid text causing crash ( #4163 )
2024-07-10 14:45:10 +00:00
cinchen
218814483b
feat(linter): eslint-plugin-jest/prefer-hooks-in-order ( #4052 )
...
part of https://github.com/oxc-project/oxc/issues/492
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-hooks-in-order.ts )
2024-07-10 22:41:19 +08:00
rzvxa
3ba7cfed1f
feat(ast_codegen): add #[visit(enter_before)] hint. ( #4147 )
...
Closes #4142
I can split it into 2 PRs but it seems pointless. Let me know if you guys disagree with me.
2024-07-10 14:02:29 +00:00
rzvxa
e1279da55c
chore(ci): fix the formatting issues on AST Changes. ( #4153 )
...
I'm not sure what causes this issue so this PR is going to start as an experimentation
2024-07-10 13:38:05 +00:00
Boshen
725571aad1
feat(napi/transformer): add jsx option to force parsing with jsx ( #4133 )
...
To mimic the esbuild `loader=jsx` or babel `babel-plugin-syntax-jsx` behavior.
2024-07-10 11:12:10 +00:00
Boshen
54cd04aead
feat(minifier): implement dce with var hoisting ( #4160 )
2024-07-10 11:03:21 +00:00
Boshen
44a894a2f9
feat(minifier): implement return statement dce ( #4155 )
...
This isn't complete, I need to figure out `var` hoisting 🙃
2024-07-10 11:03:14 +00:00
lucab
03ad1e32cc
refactor(semantic): tweak comment argument type ( #4157 )
...
Minor followup from https://github.com/oxc-project/oxc/pull/4132 .
2024-07-10 07:19:24 +00:00
Boshen
b632c0458c
chore: commit uncommited change
2024-07-10 13:44:02 +08:00
DonIsaac
cc586145ab
feat(linter): better schemas for allow/warn/deny ( #4150 )
2024-07-10 02:51:10 +00:00
rzvxa
48947a26d2
fix(ast): put decorators before everything else. ( #4143 )
...
Won't fix #4142
It is similar to #3994 but for those types that weren't relying on this order. It seems to be the right order.
technically speaking it is a breaking change but I know as a fact that it won't have a big difference on our downstream. If you want it to be chronically correct feel free to merge as a breaking change.
2024-07-10 02:03:05 +00:00
Boshen
fca9706ab3
perf(semantic): faster search for leading comments ( #4140 )
...
fixes #4114
@leaysgur This is my wild guess, I need a second pairs of eyes to make
sure this is correct.
2024-07-10 09:54:26 +08:00
rzvxa
e6c407d1c3
chore(ci): add Codegen to the CI workflow. ( #4144 )
...
It should be marked as `required`.
Closes #4138
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-07-10 09:47:30 +08:00
rzvxa
bdcc2986f7
docs(ast): update the note regarding the ast_codegen markers. ( #4149 )
2024-07-09 22:52:08 +00:00
rzvxa
daea29c0da
chore: update the branding to use the universal variant. ( #4139 )
...
Have the same spirit as this one
https://github.com/oxc-project/.github/pull/2
Makes the `OXC` visible on any background no matter the contrast.
2024-07-09 23:32:52 +08:00
Luca Bruno
5731e3957f
refactor(ast)!: store span details inside comment struct ( #4132 )
...
This tweaks `Comment` definition in order to internally store the start
and end position of its span.
Closes: https://github.com/oxc-project/oxc/issues/4069
2024-07-09 23:23:43 +08:00
github-actions[bot]
714bf1dd7f
Release crates v0.19.0 ( #4137 )
...
## [0.19.0] - 2024-07-09
- b936162 ast/ast_builder: [**BREAKING**] Shorter allocator utility
method names. (#4122 ) (rzvxa)
### Features
- 485c871 ast: Allow conversion from `Expression` into `Statement` with
`FromIn` trait. (#4124 ) (rzvxa)
### Refactor
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-09 20:32:06 +08:00
rzvxa
485c871e8d
feat(ast): allow conversion from Expression into Statement with FromIn trait. ( #4124 )
...
Our downstream rolldown is using this, If we want them to adopt our traits we should provide this implementation for them.
2cd2a367ee/crates/rolldown_ecmascript/src/allocator_helpers/into_in.rs (L24)
2024-07-09 12:16:40 +00:00
rzvxa
b936162093
refactor(ast/ast_builder)!: shorter allocator utility method names. ( #4122 )
...
This PR serves two purposes, First off it would lower the amount of characters we have to type in for a simple operation such as wrapping an expression in a vector. Secondly, it would follow the generated names more closely since nowhere else in the builder we do have `new_xxx`, We always say `xxx` since a builder always constructs something.
```
new_vec -> vec
new_vec_single -> vec1*
new_vec_from_iter -> vec_from_iter
new_vec_with_capacity -> vec_with_capacity
new_str -> str
new_atom -> atom
```
`*` This one is the main motivation behind this PR, It saves 10 characters!
2024-07-09 12:16:38 +00:00
github-actions[bot]
e29cdbfe40
Release crates v0.18.0 ( #4136 )
...
## [0.18.0] - 2024-07-09
- d347aed ast: [**BREAKING**] Generate `ast_builder.rs`. (#3890 ) (rzvxa)
### Features
- c6c16a5 minifier: Dce all conditional expressions (#4135 ) (Boshen)
- 365d9ba oxc_codegen: Generate annotation comments before
`CallExpression` and `NewExpression` (#4119 ) (IWANABETHATGUY)
- 3a0f2aa parser: Check for illegal modifiers in modules and namespaces
(#4126 ) (DonIsaac)
- 2f53bdf semantic: Check for abstract ClassElements in non-abstract
classes (#4127 ) (DonIsaac)
- c4ee9f8 semantic: Check for abstract initializations and
implementations (#4125 ) (Don Isaac)
- 44c7fe3 span: Add various implementations of `FromIn` for `Atom`.
(#4090 ) (rzvxa)
### Bug Fixes
- cb1af04 isolated-declarations: Remove the `async` and `generator`
keywords from `MethodDefinition` (#4130 ) (Dunqing)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-09 19:56:10 +08:00
Boshen
c6c16a5fc9
feat(minifier): dce all conditional expressions ( #4135 )
2024-07-09 18:28:33 +08:00
Dunqing
cb1af043b8
fix(isolated-declarations): remove the async and generator keywords from MethodDefinition ( #4130 )
...
close : #4120
2024-07-09 03:58:47 +00:00