renovate[bot]
c53d981e45
chore(deps): update rust crates ( #3988 )
...
[](https://renovatebot.com )
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [bitflags](https://togithub.com/bitflags/bitflags ) |
workspace.dependencies | minor | `2.5.0` -> `2.6.0` |
| [log](https://togithub.com/rust-lang/log ) | workspace.dependencies |
patch | `0.4.21` -> `0.4.22` |
| [mime_guess](https://togithub.com/abonander/mime_guess ) |
workspace.dependencies | patch | `2.0.4` -> `2.0.5` |
| [num-bigint](https://togithub.com/rust-num/num-bigint ) |
workspace.dependencies | patch | `0.4.5` -> `0.4.6` |
| [oxc_resolver](https://togithub.com/oxc-project/oxc-resolver ) |
workspace.dependencies | minor | `1.8.2` -> `1.9.2` |
| [serde_json](https://togithub.com/serde-rs/json ) |
workspace.dependencies | patch | `1.0.117` -> `1.0.119` |
---
### Release Notes
<details>
<summary>bitflags/bitflags (bitflags)</summary>
###
[`v2.6.0`](https://togithub.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#260 )
[Compare
Source](https://togithub.com/bitflags/bitflags/compare/2.5.0...2.6.0 )
#### What's Changed
- Sync CHANGELOG.md with github release notes by
[@​dextero](https://togithub.com/dextero ) in
[https://github.com/bitflags/bitflags/pull/402 ](https://togithub.com/bitflags/bitflags/pull/402 )
- Update error messages and zerocopy by
[@​KodrAus](https://togithub.com/KodrAus ) in
[https://github.com/bitflags/bitflags/pull/403 ](https://togithub.com/bitflags/bitflags/pull/403 )
- Bump minimum declared versions of dependencies by
[@​dextero](https://togithub.com/dextero ) in
[https://github.com/bitflags/bitflags/pull/404 ](https://togithub.com/bitflags/bitflags/pull/404 )
- chore(deps): bump serde_derive and bytemuck versions by
[@​joshka](https://togithub.com/joshka ) in
[https://github.com/bitflags/bitflags/pull/405 ](https://togithub.com/bitflags/bitflags/pull/405 )
- add OSFF Scorecard workflow by
[@​KodrAus](https://togithub.com/KodrAus ) in
[https://github.com/bitflags/bitflags/pull/396 ](https://togithub.com/bitflags/bitflags/pull/396 )
- Update stderr messages by
[@​KodrAus](https://togithub.com/KodrAus ) in
[https://github.com/bitflags/bitflags/pull/408 ](https://togithub.com/bitflags/bitflags/pull/408 )
- Fix typo by
[@​waywardmonkeys](https://togithub.com/waywardmonkeys ) in
[https://github.com/bitflags/bitflags/pull/410 ](https://togithub.com/bitflags/bitflags/pull/410 )
- Allow specifying outer attributes in impl mode by
[@​KodrAus](https://togithub.com/KodrAus ) in
[https://github.com/bitflags/bitflags/pull/411 ](https://togithub.com/bitflags/bitflags/pull/411 )
#### New Contributors
- [@​dextero](https://togithub.com/dextero ) made their first
contribution in
[https://github.com/bitflags/bitflags/pull/402 ](https://togithub.com/bitflags/bitflags/pull/402 )
- [@​joshka](https://togithub.com/joshka ) made their first
contribution in
[https://github.com/bitflags/bitflags/pull/405 ](https://togithub.com/bitflags/bitflags/pull/405 )
- [@​waywardmonkeys](https://togithub.com/waywardmonkeys ) made
their first contribution in
[https://github.com/bitflags/bitflags/pull/410 ](https://togithub.com/bitflags/bitflags/pull/410 )
**Full Changelog**:
https://github.com/bitflags/bitflags/compare/2.5.0...2.6.0
</details>
<details>
<summary>rust-lang/log (log)</summary>
###
[`v0.4.22`](https://togithub.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0422---2024-06-27 )
[Compare
Source](https://togithub.com/rust-lang/log/compare/0.4.21...0.4.22 )
</details>
<details>
<summary>rust-num/num-bigint (num-bigint)</summary>
###
[`v0.4.6`](https://togithub.com/rust-num/num-bigint/blob/HEAD/RELEASES.md#Release-046-2024-06-27 )
[Compare
Source](https://togithub.com/rust-num/num-bigint/compare/num-bigint-0.4.5...num-bigint-0.4.6 )
- [Fixed compilation on `x86_64-unknown-linux-gnux32`.][312]
**Contributors**: [@​cuviper](https://togithub.com/cuviper ),
[@​ralphtandetzky](https://togithub.com/ralphtandetzky ),
[@​yhx-12243](https://togithub.com/yhx-12243 )
[312]: https://togithub.com/rust-num/num-bigint/pull/312
</details>
<details>
<summary>oxc-project/oxc-resolver (oxc_resolver)</summary>
###
[`v1.9.2`](https://togithub.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#192---2024-06-30 )
[Compare
Source](https://togithub.com/oxc-project/oxc-resolver/compare/oxc_resolver-v1.9.1...oxc_resolver-v1.9.2 )
##### Added
- *(napi)* add tracing via `OXC_LOG:DEBUG`
([#​202](https://togithub.com/oxc-project/oxc_resolver/pull/202 ))
##### Other
- document directory is an absolute path for `resolve(directory,
specifier)`
([#​206](https://togithub.com/oxc-project/oxc_resolver/pull/206 ))
- add a broken tsconfig test
([#​205](https://togithub.com/oxc-project/oxc_resolver/pull/205 ))
- improve code coverage for src/error.rs
([#​204](https://togithub.com/oxc-project/oxc_resolver/pull/204 ))
- skip resolving extension alias when `options.extension_alias` is empty
([#​203](https://togithub.com/oxc-project/oxc_resolver/pull/203 ))
- add npm badge to crates.io
###
[`v1.9.1`](https://togithub.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#191---2024-06-29 )
[Compare
Source](https://togithub.com/oxc-project/oxc-resolver/compare/oxc_resolver-v1.9.0...oxc_resolver-v1.9.1 )
##### Added
- strip symbols and enable LTO
([#​197](https://togithub.com/oxc-project/oxc_resolver/pull/197 ))
##### Other
- improve call to `Path::ends_with`
([#​199](https://togithub.com/oxc-project/oxc_resolver/pull/199 ))
- list \[profile.release] explicitly
([#​198](https://togithub.com/oxc-project/oxc_resolver/pull/198 ))
###
[`v1.9.0`](https://togithub.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#190---2024-06-28 )
[Compare
Source](https://togithub.com/oxc-project/oxc-resolver/compare/oxc_resolver-v1.8.4...oxc_resolver-v1.9.0 )
##### Added
- export package.json `type` and `sideEffects` field by default for
bundlers
([#​196](https://togithub.com/oxc-project/oxc-resolver/pull/196 ))
###
[`v1.8.4`](https://togithub.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#184---2024-06-27 )
[Compare
Source](https://togithub.com/oxc-project/oxc-resolver/compare/oxc_resolver-v1.8.3...oxc_resolver-v1.8.4 )
##### Other
- skip searching for package.json when `alias_fields` is not provided
([#​194](https://togithub.com/oxc-project/oxc_resolver/pull/194 ))
###
[`v1.8.3`](https://togithub.com/oxc-project/oxc-resolver/blob/HEAD/CHANGELOG.md#183---2024-06-26 )
[Compare
Source](https://togithub.com/oxc-project/oxc-resolver/compare/oxc_resolver-v1.8.2...oxc_resolver-v1.8.3 )
- *(napi*) release wasi build
</details>
<details>
<summary>serde-rs/json (serde_json)</summary>
###
[`v1.0.119`](https://togithub.com/serde-rs/json/releases/tag/v1.0.119 )
[Compare
Source](https://togithub.com/serde-rs/json/compare/v1.0.118...v1.0.119 )
- Add `serde_json::Map::shift_insert`
([#​1149](https://togithub.com/serde-rs/json/issues/1149 ), thanks
[@​joshka](https://togithub.com/joshka ))
###
[`v1.0.118`](https://togithub.com/serde-rs/json/releases/tag/v1.0.118 )
[Compare
Source](https://togithub.com/serde-rs/json/compare/v1.0.117...v1.0.118 )
- Implement Hash for serde_json::Value
([#​1127](https://togithub.com/serde-rs/json/issues/1127 ), thanks
[@​edwardycl](https://togithub.com/edwardycl ))
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 10am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions ) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/ ). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-01 00:44:13 +00:00
renovate[bot]
f6f8c9dd63
chore(deps): update dependency vite to v5.3.2 ( #3986 )
...
[](https://renovatebot.com )
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [vite](https://vitejs.dev )
([source](https://togithub.com/vitejs/vite/tree/HEAD/packages/vite )) |
[`5.3.1` -> `5.3.2`](https://renovatebot.com/diffs/npm/vite/5.3.1/5.3.2 )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
---
### Release Notes
<details>
<summary>vitejs/vite (vite)</summary>
###
[`v5.3.2`](https://togithub.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small532-2024-06-27-small )
[Compare
Source](https://togithub.com/vitejs/vite/compare/v5.3.1...v5.3.2 )
- fix(client): uniform variable `location`
([#​17528](https://togithub.com/vitejs/vite/issues/17528 ))
([a8e2f6f](https://togithub.com/vitejs/vite/commit/a8e2f6f )), closes
[#​17528](https://togithub.com/vitejs/vite/issues/17528 )
- fix(deps): update all non-major dependencies
([#​17494](https://togithub.com/vitejs/vite/issues/17494 ))
([bf123f2](https://togithub.com/vitejs/vite/commit/bf123f2 )), closes
[#​17494](https://togithub.com/vitejs/vite/issues/17494 )
- fix(typescript): correctly expand ${configDir} in tsconfig.json
([#​17576](https://togithub.com/vitejs/vite/issues/17576 ))
([24c799b](https://togithub.com/vitejs/vite/commit/24c799b )), closes
[#​17576](https://togithub.com/vitejs/vite/issues/17576 )
- chore: fix some comments
([#​17495](https://togithub.com/vitejs/vite/issues/17495 ))
([ec16a5e](https://togithub.com/vitejs/vite/commit/ec16a5e )), closes
[#​17495](https://togithub.com/vitejs/vite/issues/17495 )
- chore(deps): update all non-major dependencies
([#​17553](https://togithub.com/vitejs/vite/issues/17553 ))
([a33a97f](https://togithub.com/vitejs/vite/commit/a33a97f )), closes
[#​17553](https://togithub.com/vitejs/vite/issues/17553 )
- chore(deps): update dependency eslint to v9
([#​16661](https://togithub.com/vitejs/vite/issues/16661 ))
([6c10662](https://togithub.com/vitejs/vite/commit/6c10662 )), closes
[#​16661](https://togithub.com/vitejs/vite/issues/16661 )
- chore(deps): update es-module-lexer to 1.5.4
([#​17555](https://togithub.com/vitejs/vite/issues/17555 ))
([2d6672f](https://togithub.com/vitejs/vite/commit/2d6672f )), closes
[#​17555](https://togithub.com/vitejs/vite/issues/17555 )
- refactor(optimizer): use early continues
([#​17551](https://togithub.com/vitejs/vite/issues/17551 ))
([7c06ef0](https://togithub.com/vitejs/vite/commit/7c06ef0 )), closes
[#​17551](https://togithub.com/vitejs/vite/issues/17551 )
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 10am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/ ). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-30 21:00:20 +00:00
Boshen
e44963acda
Revert "chore(napi/transform): support wasm build ( #3933 )"
...
This reverts commit 3e9e4c9912 .
2024-06-30 22:04:36 +08:00
mysteryven
b257d53151
feat(linter): support report @typescript-eslint/consistent-type-imports ( #3895 )
...
This PR only contains the part about report error, adding the fixer part will make the whole PR difficult to review at one time.
There are also some commented cases. One kind of them is `decorator`, as it blocked by #3645 , another kind of them is type reference, need to solve #3799 first. I added TODO flags for them.
2024-06-30 13:48:08 +00:00
github-actions[bot]
3870ed5a24
Release crates v0.16.2 ( #3983 )
...
## [0.16.2] - 2024-06-30
### Features
- dc6d45e ast,codegen: Add `TSParenthesizedType` and print type
parentheses correctly (#3979 ) (Boshen)
- 63f36da parser: Parse modifiers with `parse_modifiers` (take 2)
(#3977 ) (DonIsaac)
### Bug Fixes
- dac617d codegen: Print some missing typescript attributes (#3980 )
(Boshen)
- bd1141d isolated-declarations: If declarations is referenced in
`declare global` then keep it (#3982 ) (Dunqing)
### Performance
- b234ddd semantic: Only check for jsdoc if jsdoc building is enabled
(Boshen)
- 1eac3d2 semantic: Use `Atom<'a>` for `Reference`s (#3972 ) (Don Isaac)
- 0c81fbe syntax: Use `NonZeroU32` for `SymbolId` and `ReferenceId`
(#3970 ) (Boshen)
### Refactor
- 5845057 transformer: Pass in symbols and scopes (#3978 ) (Boshen)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-30 19:59:15 +08:00
Dunqing
3e9e4c9912
chore(napi/transform): support wasm build ( #3933 )
...
~~Encountered the same problem as
https://github.com/oxc-project/oxc-resolver/issues/190 . Fixed in
napi@2.16.7, but oxc use `3.x`~~
Fixed in napi@3.0.0-alpha.3
2024-06-30 19:49:02 +08:00
Dunqing
bd1141da67
fix(isolated-declarations): if declarations is referenced in declare global then keep it ( #3982 )
...
close : #3981
2024-06-30 11:34:04 +00:00
kaykdm
211447559b
feat(linter): implement @typescript-eslint/no-dynamic-delete ( #3971 )
...
Related issue: https://github.com/oxc-project/oxc/issues/2180
original implementation
- code:
https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/rules/no-dynamic-delete.ts
- test:
https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts
- doc: https://typescript-eslint.io/rules/no-dynamic-delete/
2024-06-30 19:11:46 +08:00
Jelle van der Waa
10a3c9a052
feat(linter/eslint-plugin-react): Implement no-set-state ( #3975 )
...
Rule Detail:
[link](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-set-state.md )
2024-06-30 19:11:33 +08:00
Boshen
1852ea4fd2
chore: clean up unused deps
2024-06-30 19:04:44 +08:00
Boshen
5d6490e95d
chore: add crate oxc_transform_napi to release
2024-06-30 18:53:17 +08:00
underfin
9bc36ed5d3
chore: bump napi 3.0.0-alpha.3 ( #3953 )
...
Keep version same as rolldown, avoid release build error.
2024-06-30 18:25:06 +08:00
Boshen
dac617de29
fix(codegen): print some missing typescript attributes ( #3980 )
2024-06-30 08:58:00 +00:00
Boshen
dc6d45e2e6
feat(ast,codegen): add TSParenthesizedType and print type parentheses correctly ( #3979 )
...
closes #3916
2024-06-30 07:57:48 +00:00
Boshen
5845057bff
refactor(transformer): pass in symbols and scopes ( #3978 )
...
This PR adds a new method `build_with_symbols_and_scopes` to make semantic building optional, there may be prior steps that has the semantic data already built.
2024-06-30 06:33:48 +00:00
Boshen
b234ddd47c
perf(semantic): only check for jsdoc if jsdoc building is enabled
2024-06-30 13:58:06 +08:00
Boshen
d953c85db1
chore(ast): move TSType to the right place
2024-06-30 13:57:51 +08:00
DonIsaac
63f36daae0
feat(parser): parse modifiers with parse_modifiers (take 2) ( #3977 )
...
Same as #3948 , with fixes for bugs found by @Boshen.
2024-06-30 03:46:34 +00:00
Boshen
54c653ebd4
Revert "perf(semantic): use Atom<'a> for References" ( #3974 )
...
Reverts oxc-project/oxc#3972
@DonIsaac As it turns out we can't have lifetimes on these structures because semantic data is exposed to downstream users to use freely, detached from the ast and allocator.
2024-06-29 15:55:04 +00:00
Boshen
dbbb6fca56
fix(linter): global variable check should always check builtin variables ( #3973 )
...
closes #3374
2024-06-29 15:27:23 +00:00
Don Isaac
1eac3d244d
perf(semantic): use Atom<'a> for References ( #3972 )
...
Relates to [this
issue](https://github.com/oxc-project/backlog/issues/31 ) on the backlog.
2024-06-29 23:23:36 +08:00
Boshen
0c81fbeac6
perf(syntax): use NonZeroU32 for SymbolId and ReferenceId ( #3970 )
...
closes https://github.com/oxc-project/backlog/issues/55
closes https://github.com/oxc-project/oxc/issues/3318
2024-06-29 17:29:02 +08:00
github-actions[bot]
21b964b214
Release oxlint v0.5.1 ( #3967 )
...
## [0.5.1] - 2024-06-29
### Features
- f64ad4b semantic: Make jsdoc building optional (turned off by default)
(#3955 ) (Boshen)
### Bug Fixes
- c26975a linter: Only show the filename for max-lines (#3966 ) (Boshen)
- 94329e4 linter: Handle useful but empty constructors in
no-useless-constructor (#3951 ) (DonIsaac)
- 6498a08 linter: No-useless-spread fixer with multiple spread elements
(#3950 ) (DonIsaac)
- 750cb43 oxlint: Gate custom allocators by feature flag (#3945 ) (Luca
Bruno)
### Refactor
- 1cca2a8 eslint: Convert with_labels to with_label where applicable
(#3946 ) (Jelle van der Waa)
- 2705df9 linter: Improve diagnostic labeling (#3960 ) (DonIsaac)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-29 17:01:56 +08:00
github-actions[bot]
fa50e9737e
Release crates v0.16.1 ( #3968 )
...
## [0.16.1] - 2024-06-29
### Features
- 7b38bde parser: Parse modifiers with `parse_modifiers` (#3948 )
(DonIsaac)
- f64ad4b semantic: Make jsdoc building optional (turned off by default)
(#3955 ) (Boshen)
### Bug Fixes
- 51e54f9 codegen: Should print `TSModuleDeclarationKind` instead of
just `module` (#3957 ) (Dunqing)
- 31e4c3b isolated-declarations: `declare global {}` should be kept even
if it is not exported (#3956 ) (Dunqing)
### Refactor
- 2705df9 linter: Improve diagnostic labeling (#3960 ) (DonIsaac)
- 15ec254 semantic: Remove the unused `Semantic::build2` function
(Boshen)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-29 16:53:09 +08:00
Boshen
3c72ab769b
chore: s/with_labels([span])/with_label(span)
2024-06-29 16:49:47 +08:00
Boshen
c26975ab76
fix(linter): only show the filename for max-lines ( #3966 )
...
closes #3961
2024-06-29 08:40:41 +00:00
Boshen
ba7dd0250c
chore(index): remove example_generated feature
...
To reduce noise
2024-06-29 14:29:26 +08:00
Boshen
14bc31ee74
Revert "feat(parser): parse modifiers with parse_modifiers ( #3948 )"
...
This reverts commit 7b38bde073 .
2024-06-29 14:16:26 +08:00
rzvxa
71c07c59d7
improvement(ast_codegen): better output formatting. ( #3932 )
...
We use prettyplease for formatting our generated code, Which has a lot of advantages over rustfmt, But sometimes it conflicts with our cargo fmt config,
Since it isn't configurable I just added a `cargo fmt` step after the generation process to prevent conflicts.
We might be able to not rely on prettyplease at all, But We have to test that one after we have most of our generated code, rustfmt usually bails on nested calls and macros so it might not work as our only solution. In contrast to that prettyplease is used in both bindgen and cargo-expand and is created for this exact reason(formatting generated code).
2024-06-29 05:37:15 +00:00
DonIsaac
7b38bde073
feat(parser): parse modifiers with parse_modifiers ( #3948 )
...
Closes #3929
2024-06-29 05:29:47 +00:00
Dunqing
51e54f902c
fix(codegen): should print TSModuleDeclarationKind instead of just module ( #3957 )
2024-06-29 05:24:36 +00:00
DonIsaac
2705df93b3
refactor(linter): improve diagnostic labeling ( #3960 )
2024-06-29 05:19:22 +00:00
Boshen
f64ad4b7c2
feat(semantic): make jsdoc building optional (turned off by default) ( #3955 )
2024-06-29 05:12:25 +00:00
Dunqing
31e4c3b33e
fix(isolated-declarations): declare global {} should be kept even if it is not exported ( #3956 )
...
close : #3952
2024-06-29 05:07:21 +00:00
Boshen
15ec254740
refactor(semantic): remove the unused Semantic::build2 function
2024-06-28 23:15:12 +08:00
Luca Bruno
750cb43624
fix(oxlint): gate custom allocators by feature flag ( #3945 )
...
This tweaks the conditional compilation of custom allocators by wiring
the dedicated Cargo feature flag `allocator` to the source code. It
ensures that allocator gating is directly checking the relevant feature
instead of trying to infer it from the build profile.
2024-06-28 21:34:46 +08:00
DonIsaac
94329e4c66
fix(linter): handle useful but empty constructors in no-useless-constructor ( #3951 )
...
Closes #3665
2024-06-28 02:12:20 +00:00
DonIsaac
6498a089ea
fix(linter): no-useless-spread fixer with multiple spread elements ( #3950 )
...
Closes #3909
2024-06-28 02:06:58 +00:00
Jelle van der Waa
ea30aecb67
Coccinelle labels refactor ( #3947 )
...
Follow up of https://github.com/oxc-project/oxc/pull/3946
2024-06-27 19:11:46 -04:00
Jelle van der Waa
1cca2a8d92
refactor(eslint): convert with_labels to with_label where applicable ( #3946 )
...
Following earlier work in d6437fec0b prefer `with_label` over
`with_labels`. Automatically converted using CoccinelleForRust.
---
I noticed some conversions of `with_labels` to `with_label` for a single
span in https://github.com/oxc-project/oxc/pull/3854 and in my recent
pull requests. The Linux kernel uses Coccinelle to automatically
converted helper functions, so I was wondering if there was something
similar for Rust as Coccinelle only does C. It turns out that there is a
[Coccinelle for
Rust](https://gitlab.inria.fr/coccinelle/coccinelleforrust ), so I wrote
a small Coccinelle rule to automatically convert all rules. (This PR
only touches eslint, I am happy to run it for the whole rules directory,
this is more a test if the project is willing to accept such massive
automatic refactors).
To convert this automatically build the tool, and save the snippet below
as `with_labels.cocci` and run:
```
~/code/coccinelleforrust/target/debug/cfr --apply --coccifile with_labels.cocci crates/oxc_linter/src/rules/eslint
```
with_labels.cocci:
```
@@
expression E, OxcDiagnostic;
@@
OxcDiagnostic.
- with_labels([E.into()])
+ with_label(E)
```
2024-06-27 15:11:19 -04:00
Boshen
d80ebb16ef
chore: codecov ignore ast generated code
2024-06-27 22:03:01 +08:00
Boshen
4560b59e30
ci: passthrough CI env variable for cross build
2024-06-27 21:11:16 +08:00
github-actions[bot]
4e3e1a39eb
Release crates v0.16.0 ( #3930 )
...
## [0.16.0] - 2024-06-26
- 6796891 ast: [**BREAKING**] Rename all instances of `BigintLiteral` to
`BigIntLiteral`. (#3898 ) (rzvxa)
- 1f85f1a ast: [**BREAKING**] Revert adding `span` field to the
`BindingPattern` type. (#3899 ) (rzvxa)
- ae09a97 ast: [**BREAKING**] Remove `Modifiers` from ts nodes (#3846 )
(Boshen)
- 1af5ed3 ast: [**BREAKING**] Replace `Modifiers` with `declare` and
`const` on `EnumDeclaration` (#3845 ) (Boshen)
- 0673677 ast: [**BREAKING**] Replace `Modifiers` with `declare` on
`Function` (#3844 ) (Boshen)
- ee6ec4e ast: [**BREAKING**] Replace `Modifiers` with `declare` and
`abstract` on `Class` (#3841 ) (Boshen)
- 9b38119 ast: [**BREAKING**] Replace `Modifiers` with `declare` on
`VariableDeclaration` (#3839 ) (Boshen)
- cfcef24 ast: [**BREAKING**] Add `directives` field to `TSModuleBlock`
(#3830 ) (Boshen)
- 4456034 ast: [**BREAKING**] Add `IdentifierReference` to
`ExportSpecifier` (#3820 ) (Boshen)
### Features
- 497769c ast: Add some visitor functions (#3785 ) (Dunqing)
- 4b06dc7 ast: Add TSType::TSIntrinsicKeyword to is_keyword (#3775 )
(Dunqing)
- 5847e16 ast,parser: Add `intrinsic` keyword (#3767 ) (Boshen)
- 2e026e1 ast_codegen: Generate `ast_kind.rs`. (#3888 ) (rzvxa)
- 09f4d3c ast_codegen: Add `ImplGetSpanGenerator`. (#3852 ) (rzvxa)
- 3e78f98 cfg: Add depth first search with hash sets. (#3771 ) (rzvxa)
- 01da2f7 codegen: Print TSThisParameter for TSCallSignatureDeclaration
and TSMethodSignature (#3792 ) (Dunqing)
- 2821e0e codegen: Print readonly keyword for TSIndexSignature (#3791 )
(Dunqing)
- 97575d8 codegen: Print TSClassImplements and TSThisParameter (#3786 )
(Dunqing)
- 5e2baf3 isolated-declarations: Report error for expando functions
(#3872 ) (Dunqing)
- 2cdb34f isolated-declarations: Support for class function overloads
(#3811 ) (Dunqing)
- 231b8f0 isolated-declarations: Support for export default function
overloads (#3809 ) (Dunqing)
- a37138f isolated-declarations: Improve the inference template literal
(#3797 ) (Dunqing)
- b0d7355 isolated-declarations: Transform const expression correctly
(#3793 ) (Dunqing)
- b38c34d isolated-declarations: Support inferring
ParenthesizedExpression (#3769 ) (Dunqing)
- 4134de8 isolated-declarations: Add ts error code to the error message
(#3755 ) (Dunqing)
- 94202de isolated-declarations: Add `export {}` when needed (#3754 )
(Dunqing)
- e95d8e3 isolated-declarations: Shrink span for arrow function that
needs an explicit return type (#3752 ) (Dunqing)
- df9971d isolated-declarations: Improve inferring the return type from
function (#3750 ) (Dunqing)
- 4aea2b1 isolated-declarations: Improve inferring the type of accessor
(#3749 ) (Dunqing)
- 9ea30c4 isolated-declarations: Treat AssignmentPattern as optional
(#3748 ) (Dunqing)
- dd540c8 minifier: Add skeleton for ReplaceGlobalDefines ast pass
(#3803 ) (Boshen)
- f3c3970 minifier: Add skeleton for RemoveDeadCode ast pass (#3802 )
(Boshen)
- 4fb90eb oxc: Export isolated-declarations (#3765 ) (Boshen)
- d5f6aeb semantic: Check for illegal symbol modifiers (#3838 ) (Don
Isaac)
- 01572f0 sourcemap: Impl `std::fmt::Display` for `Error` (#3902 )
(DonIsaac)
- 5501d5c transformer/typescript: Transform `import {} from "mod"` to
import `"mod"` (#3866 ) (Dunqing)
- 2a16ce0 traverse: Disable syntax check and disable build module record
(#3794 ) (Boshen)- d3cd3ea Oxc transform binding (#3896 ) (underfin)
### Bug Fixes
- 063cfde ast: Correct JSON serialization of `TSModuleBlock` (#3858 )
(overlookmotel)
- 66f404c ast: Fix JSON serialization of `BindingPattern` (#3856 )
(overlookmotel)
- 2766594 codegen: Print type parameters for MethodDefinition (#3922 )
(Dunqing)
- 27f0531 isolated-declarations: Private constructor reaching
unreachable (#3921 ) (Dunqing)
- 59ce38b isolated-declarations: Inferring of UnrayExpression
incorrectly (#3920 ) (Dunqing)
- 58e54f4 isolated-declarations: Report an error for parameters if they
are ObjectPattern or ArrayPattern without an explicit type (#3810 )
(Dunqing)
- cb8a272 isolated-declarations: Cannot infer nested `as const` (#3807 )
(Dunqing)
- d8ecce5 isolated-declarations: Infer BigInt number as `bigint` type
(#3806 ) (Dunqing)
- 4e241fc isolated-declarations: Missing `const` after transformed const
enum (#3805 ) (Dunqing)
- 683c7b0 isolated-declarations: Shouldn’t add declare in declaration
with export default (#3804 ) (Dunqing)
- 7d47fc3 isolated-declarations: Should stripe async and generator
keyword after transformed (#3790 ) (Dunqing)
- 8ce794d isolated-declarations: Inferring an incorrect return type when
there is an arrow function inside a function (#3768 ) (Dunqing)
- d29316a isolated-declarations: Transform incorrectly when there are
multiple functions with the same name (#3753 ) (Dunqing)
- bf1c250 isolated-declarations: False positives for non-exported
binding elements (#3751 ) (Dunqing)
- 275349a parser: Parse function type parameter name `accessor` (#3926 )
(Boshen)
- ef82c78 parser: Trailing comma is not allowed in
ParenthesizedExpression (#3885 ) (Dunqing)
- 13754cb parser: Change diagnostic to "modifier cannot be used here"
(#3853 ) (Boshen)
- 8c9fc63 semantic: Apply strict mode scope flag for strict mode TS
Modules (#3861 ) (overlookmotel)
- 99a40ce semantic: `export default foo` should have
`ExportLocalName::Default(NameSpan)` entry (#3823 ) (Boshen)
- 08fcfb3 transformer: Fix spans and scopes in TS enum transform (#3911 )
(overlookmotel)
- 17ad8f7 transformer: Create new scopes for new blocks in TS transform
(#3908 ) (overlookmotel)
- d76f34b transformer: TODO comments for missing scopes (#3837 )
(overlookmotel)
- e470731 transformer: TS transform handle when type exports first
(#3833 ) (overlookmotel)
- d774e54 transformer: TS transform generate do not copy statements
(#3832 ) (overlookmotel)
- ff1da27 transformer: Correct comment in example (#3831 )
(overlookmotel)
- 6dcc3f4 transformer: Fix TS annotation transform scopes (#3816 )
(overlookmotel)
- aea3e9a transformer: Correct spans for TS annotations transform
(#3782 ) (overlookmotel)
### Performance
- 92c21b2 diagnostics: Optimize string-buffer reallocations (#3897 )
(Luca Bruno)
- 4bf405d parser: Add a few more inline hints to cursor functions
(#3894 ) (Boshen)
- 10d1de5 semantic: Remove uneccessary allocation in builder (#3867 )
(DonIsaac)- 4f7ff7e Do not pass `&Atom` to functions (#3818 )
(overlookmotel)
### Refactor
- 6f26087 ast: Add comment about alternatives to `AstBuilder::copy`
(#3905 ) (overlookmotel)
- 442aca3 ast: Add comment not to use `AstBuilder::copy` (#3891 )
(overlookmotel)
- acf69fa ast: Refactor custom `Serialize` impls (#3859 ) (overlookmotel)
- 9e148e9 ast: Add line breaks (#3860 ) (overlookmotel)
- 363d3d5 ast: Add span field to the `BindingPattern` type. (#3855 )
(rzvxa)
- a648748 ast: Shorten code in AST builder (#3835 ) (overlookmotel)
- 1206967 ast: Reduce allocations in AST builder (#3834 ) (overlookmotel)
- 2f5d50e isolated-declarations: Remove `Modifiers` (#3847 ) (Boshen)
- 8027b1e minifier: Change prepass to ast_passes::remove_parens (#3801 )
(Boshen)
- a471e62 parser: Clean up `try_parse` (#3925 ) (Boshen)
- 3db2553 parser: Improve parsing of TypeScript type arguments (#3923 )
(Boshen)
- 4cf3c76 parser: Improve parsing of TypeScript types (#3903 ) (Boshen)
- 187f078 parser: Improve parsing of
`parse_function_or_constructor_type` (#3892 ) (Boshen)
- 97d59fc parser: Move code around for parsing `Modifiers` (#3849 )
(Boshen)
- 5ef28b7 transformer: Shorten code (#3912 ) (overlookmotel)
- d9f268d transformer: Shorten TS transform code (#3836 ) (overlookmotel)
- 21b0d01 transformer: Pass ref to function (#3781 ) (overlookmotel)
- 7c44703 transformer: Remove needless `pub` on TS enum transform
methods (#3774 ) (overlookmotel)
- 22c56d7 transformer: Move TSImportEqualsDeclaration transform code
(#3764 ) (overlookmotel)
- cd56aa9 transformer: Simplify TS export assignment transform (#3762 )
(overlookmotel)
- 512740d transformer: Move and simplify TS enum transform entry point
(#3760 ) (overlookmotel)
- 1061baa traverse: Separate `#[scope]` attr (#3901 ) (overlookmotel)
- fcd21a6 traverse: Indicate scope entry point with
`scope(enter_before)` attr (#3882 ) (overlookmotel)
- 24979c9 traverse: Use camel case props internally (#3880 )
(overlookmotel)
- 2045c92 traverse: Improve parsing attrs in traverse codegen (#3879 )
(overlookmotel)- d6437fe Clean up some usages of `with_labels` (#3854 )
(Boshen)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-27 20:38:31 +08:00
underfin
9e8709f06e
fix(sourcemap): should add tokens for unordered span ( #3941 )
...
close: https://github.com/oxc-project/oxc/issues/3843
2024-06-27 20:24:22 +08:00
Boshen
1d74db7774
ci: fix oxlint build
2024-06-27 15:37:59 +08:00
Boshen
7b5abf647f
ci: fix build
2024-06-27 15:19:38 +08:00
github-actions[bot]
06e4ce4f5d
Release oxlint v0.5.0 ( #3940 )
...
## [0.5.0] - 2024-06-27
- 6796891 ast: [**BREAKING**] Rename all instances of `BigintLiteral` to
`BigIntLiteral`. (#3898 ) (rzvxa)
- ae09a97 ast: [**BREAKING**] Remove `Modifiers` from ts nodes (#3846 )
(Boshen)
- 1af5ed3 ast: [**BREAKING**] Replace `Modifiers` with `declare` and
`const` on `EnumDeclaration` (#3845 ) (Boshen)
- ee6ec4e ast: [**BREAKING**] Replace `Modifiers` with `declare` and
`abstract` on `Class` (#3841 ) (Boshen)
- 4456034 ast: [**BREAKING**] Add `IdentifierReference` to
`ExportSpecifier` (#3820 ) (Boshen)
- 0537d29 cfg: [**BREAKING**] Move control flow to its own crate.
(#3728 ) (rzvxa)
- 5c38a0f codegen: [**BREAKING**] New code gen API (#3740 ) (Boshen)
- 4bce59d semantic/cfg: [**BREAKING**] Re-export `petgraph` as
`control_flow::graph`. (#3722 ) (rzvxa)
### Features
- 3ae2628 linter: Change `no-import-assign` to correctness (#3928 )
(Boshen)
- a89d501 linter: Implement
@typescript-eslint/no-non-null-asserted-nulli… (#3850 ) (kaykdm)
- fc48cb4 linter: eslint-plugin-jest/prefer-jest-mocked (#3865 )
(cinchen)
- 63b98bd linter: Accept multiple fixes when fix code (#3842 )
(mysteryven)
- 328445b linter: Support `vitest/no-disabled-tests` (#3717 )
(mysteryven)
- 8c61f9c linter: Implement @typescript-eslint/no-non-null-assertion
(#3825 ) (kaykdm)
- 080ecbd linter: Add `no-fallthrough`. (#3673 ) (rzvxa)
- 9493fbe linter: Add `oxc/no-optional-chaining` rule (#3700 )
(mysteryven)
- 139adfe linter: Add `@typescript-eslint/no-import-type-side_effects`
(#3699 ) (mysteryven)
- 5f84500 linter/eslint-plugin-react: Implement prefer-es6-class (#3812 )
(Jelle van der Waa)
- fafe67c linter/import: Implement max-dependencies (#3814 ) (Jelle van
der Waa)
- d5f6aeb semantic: Check for illegal symbol modifiers (#3838 ) (Don
Isaac)
### Bug Fixes
- 4bd2c88 linter: Fix and promote `getter-return` to correctness.
(#3777 ) (rzvxa)
- 1190dee linter: False positives with setters in the `getter-return`
rule. (#3714 ) (rzvxa)
- de0690f linter: Do not run getter-return in typescript (#3693 )
(Boshen)
- cf71c23 linter: Edge case with infinite loops. (#3672 ) (rzvxa)
- 5902331 oxlint: Properly report error (#3889 ) (Luca Bruno)
- 99a40ce semantic: `export default foo` should have
`ExportLocalName::Default(NameSpan)` entry (#3823 ) (Boshen)
- abd6ac8 semantic/cfg: Discrete finalization path after `NewFunction`s.
(#3671 ) (rzvxa)
### Performance
- 4f7ff7e Do not pass `&Atom` to functions (#3818 ) (overlookmotel)
### Refactor
- 4d2b7f1 linter: `LintContext` can now only be constructed with a cfg
enabled semantic. (#3761 ) (rzvxa)
- 7302429 linter/prefer_number_properties: Remove the unused
`IdentifierName` check (#3822 ) (Boshen)
- d8ad321 semantic: Make control flow generation optional. (#3737 )
(rzvxa)
### Testing
- 887da40 linter: Enable `no-fallthrough` test with `disable-next-line`.
(#3766 ) (rzvxa)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-06-27 15:09:13 +08:00
Boshen
75592e0d4d
ci: fix reusable_prepare_release version output
2024-06-27 15:08:31 +08:00
Boshen
cd4bd6ec7f
chore(linter): change getter-return to nursery
...
relates #3935
2024-06-27 14:38:43 +08:00
Boshen
37fceefbbf
chore(linter): change no-fallthrough to pedantic
...
Because the code is still correct.
2024-06-27 14:37:44 +08:00