Boshen
505d39ba0a
chore: bump deps
2024-08-12 10:12:34 +08:00
Boshen
89b1886403
chore: update deny.toml
2024-08-12 10:12:03 +08:00
renovate[bot]
0046398fa2
chore(deps): update dependency @types/node to v22.2.0 ( #4834 )
...
[](https://renovatebot.com )
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node )
([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node ))
| [`22.1.0` ->
`22.2.0`](https://renovatebot.com/diffs/npm/@types%2fnode/22.1.0/22.2.0 )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
---
### 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 was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/ ). View the
[repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMC4xIiwidXBkYXRlZEluVmVyIjoiMzguMjAuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-12 02:05:29 +00:00
Don Isaac
cc922f4c89
feat(vscode): provide config's schema to oxlint config files ( #4826 )
...
Updates the VSCode plugin client to automatically provide our
auto-generated
JSON schema to `\.?oxlint(rc)?(\.json)?` files.
2024-08-12 09:15:47 +08:00
DonIsaac
096ac7bee5
refactor(linter): clean up jsx-a11y/anchor-is-valid ( #4831 )
2024-08-12 01:11:54 +00:00
DonIsaac
8827659a84
docs(ast): more doc comments for JSX nodes ( #4830 )
2024-08-12 01:11:54 +00:00
renovate[bot]
89712f5a24
chore(deps): update rust crate serde_json to v1.0.124 ( #4833 )
...
[](https://renovatebot.com )
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [serde_json](https://togithub.com/serde-rs/json ) |
workspace.dependencies | patch | `1.0.122` -> `1.0.124` |
---
### Release Notes
<details>
<summary>serde-rs/json (serde_json)</summary>
###
[`v1.0.124`](https://togithub.com/serde-rs/json/releases/tag/v1.0.124 )
[Compare
Source](https://togithub.com/serde-rs/json/compare/v1.0.123...v1.0.124 )
- Fix a bug in processing string escapes in big-endian architectures
([#​1173](https://togithub.com/serde-rs/json/issues/1173 ), thanks
[@​purplesyringa](https://togithub.com/purplesyringa ))
###
[`v1.0.123`](https://togithub.com/serde-rs/json/releases/tag/v1.0.123 )
[Compare
Source](https://togithub.com/serde-rs/json/compare/v1.0.122...v1.0.123 )
- Optimize string parsing by applying SIMD-within-a-register: 30.3%
improvement on
[twitter.json](https://togithub.com/miloyip/nativejson-benchmark/blob/v1.0.0/data/twitter.json )
from 613 MB/s to 799 MB/s
([#​1161](https://togithub.com/serde-rs/json/issues/1161 ), thanks
[@​purplesyringa](https://togithub.com/purplesyringa ))
</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 was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/ ). View the
[repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMC4xIiwidXBkYXRlZEluVmVyIjoiMzguMjAuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-12 00:05:48 +00:00
renovate[bot]
3bfa54dee9
chore(deps): update cargo-bins/cargo-binstall action to v1.10.0 ( #4832 )
...
[](https://renovatebot.com )
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
|
[cargo-bins/cargo-binstall](https://togithub.com/cargo-bins/cargo-binstall )
| action | minor | `v1.9.0` -> `v1.10.0` |
---
### Release Notes
<details>
<summary>cargo-bins/cargo-binstall (cargo-bins/cargo-binstall)</summary>
###
[`v1.10.0`](https://togithub.com/cargo-bins/cargo-binstall/releases/tag/v1.10.0 )
[Compare
Source](https://togithub.com/cargo-bins/cargo-binstall/compare/v1.9.0...v1.10.0 )
*Binstall is a tool to fetch and install Rust-based executables as
binaries. It aims to be a drop-in replacement for `cargo install` in
most cases. Install it today with `cargo install cargo-binstall`, from
the binaries below, or if you already have it, upgrade with `cargo
binstall cargo-binstall`.*
##### In this release:
- feature: Merge `--disable-strategies` with `disabled-strategies` in
crate cargo manifest
([#​1867](https://togithub.com/cargo-bins/cargo-binstall/issues/1867 )
[#​1868](https://togithub.com/cargo-bins/cargo-binstall/issues/1868 ))
- dep: Bump hickory-resolver to 0.25.0-alpha.2
([#​665](https://togithub.com/cargo-bins/cargo-binstall/issues/665 )
[#​1869](https://togithub.com/cargo-bins/cargo-binstall/issues/1869 ))
</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 was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/ ). View the
[repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMC4xIiwidXBkYXRlZEluVmVyIjoiMzguMjAuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-11 22:22:06 +00:00
overlookmotel
ecfa1247b7
refactor(ast_codegen): add line break to generated code ( #4829 )
...
Follow-on after #4819 . Style nit. Add a line break after `#![allow(...)]`.
2024-08-11 19:36:24 +00:00
rzvxa
0ea697b4e9
refactor(ast, ast_codegen): CloneIn implementations now initialize semantic related cells with Default value. ( #4819 )
...
closes #4809
2024-08-11 19:10:56 +00:00
rzvxa
74af8e230a
refactor(ast_codegen): Simplify InnerMarkers. ( #4812 )
2024-08-11 18:42:54 +00:00
renovate[bot]
54592fb95b
chore(deps): update rust crates ( #4828 )
...
[](https://renovatebot.com )
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [markdown](https://togithub.com/wooorm/markdown-rs ) | dev-dependencies
| patch | `1.0.0-alpha.18` -> `1.0.0-alpha.19` |
| [serde](https://serde.rs )
([source](https://togithub.com/serde-rs/serde )) | workspace.dependencies
| patch | `1.0.204` -> `1.0.206` |
| [tempfile](https://stebalien.com/projects/tempfile-rs/ )
([source](https://togithub.com/Stebalien/tempfile )) |
workspace.dependencies | minor | `3.11.0` -> `3.12.0` |
---
### Release Notes
<details>
<summary>wooorm/markdown-rs (markdown)</summary>
###
[`v1.0.0-alpha.19`](https://togithub.com/wooorm/markdown-rs/releases/tag/1.0.0-alpha.19 )
[Compare
Source](https://togithub.com/wooorm/markdown-rs/compare/1.0.0-alpha.18...1.0.0-alpha.19 )
- [`2c83b0d`](https://togithub.com/wooorm/markdown-rs/commit/2c83b0d )
Fix panic on incomplete closing frontmatter fence
by [@​nokome](https://togithub.com/nokome ) in
[https://github.com/wooorm/markdown-rs/pull/121 ](https://togithub.com/wooorm/markdown-rs/pull/121 )
- [`d0788c9`](https://togithub.com/wooorm/markdown-rs/commit/d0788c9 )
Update dev-dependencies
by [@​wooorm](https://togithub.com/wooorm ) in
[https://github.com/wooorm/markdown-rs/pull/120 ](https://togithub.com/wooorm/markdown-rs/pull/120 )
**Full Changelog**:
https://github.com/wooorm/markdown-rs/compare/1.0.0-alpha.18...1.0.0-alpha.19
</details>
<details>
<summary>serde-rs/serde (serde)</summary>
###
[`v1.0.206`](https://togithub.com/serde-rs/serde/releases/tag/v1.0.206 )
[Compare
Source](https://togithub.com/serde-rs/serde/compare/v1.0.205...v1.0.206 )
- Improve support for `flatten` attribute inside of enums
([#​2567](https://togithub.com/serde-rs/serde/issues/2567 ), thanks
[@​Mingun](https://togithub.com/Mingun ))
###
[`v1.0.205`](https://togithub.com/serde-rs/serde/releases/tag/v1.0.205 )
[Compare
Source](https://togithub.com/serde-rs/serde/compare/v1.0.204...v1.0.205 )
- Use serialize_entry instead of serialize_key + serialize_value when
serialize flattened newtype enum variants
([#​2785](https://togithub.com/serde-rs/serde/issues/2785 ), thanks
[@​Mingun](https://togithub.com/Mingun ))
- Avoid triggering a collection_is_never_read lint in the
deserialization of enums containing flattened fields
([#​2791](https://togithub.com/serde-rs/serde/issues/2791 ))
</details>
<details>
<summary>Stebalien/tempfile (tempfile)</summary>
###
[`v3.12.0`](https://togithub.com/Stebalien/tempfile/blob/HEAD/CHANGELOG.md#3120 )
- Add a `keep(keep: bool)` function to builder that suppresses
delete-on-drop behavior (thanks to
[@​RalfJung](https://togithub.com/RalfJung )).
- Update `windows-sys` from 0.52 to 0.59.
</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 was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/ ). View the
[repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMC4xIiwidXBkYXRlZEluVmVyIjoiMzguMjAuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-11 17:18:59 +00:00
DonIsaac
8862f0680e
chore(linter): update docs for declare_oxc_lint! ( #4825 )
2024-08-11 15:27:54 +00:00
DonIsaac
8ec7e1204a
chore: alias new-typescript-rule to new-ts-rule ( #4824 )
...
This is the command suggested to users on our `typescript-eslint` mega-issue #2180 .
This should help reduce confusion.
2024-08-11 15:27:53 +00:00
DonIsaac
f6258ae126
chore: add 'just fix' command ( #4823 )
...
Fixes all auto-fixable issues from rustfmt, taplo, typos, and clippy.
2024-08-11 15:27:53 +00:00
Don Isaac
28bfc12bea
chore: add default VSCode build task ( #4822 )
...
Changes the default VSCode build command to run `cargo fmt` and `cargo
test --no-run`. This can be easily run with `Cmd+B` (or `Ctrl+B` for
Windows users).
2024-08-11 23:05:27 +08:00
camc314
4e818a434c
feat(linter) support arrow functions in oxc only used in recursion ( #4816 )
2024-08-11 12:50:48 +00:00
overlookmotel
8e10e25ded
feat(allocator): introduce Address ( #4810 )
...
Closes #4807 .
Introduce `Address`. `Address` can be obtained from a `Box<T>` and can act as a unique identifier for an AST node in arena.
NB: It will also be unique across 2 ASTs in different allocators as long as neither allocator is dropped.
2024-08-11 03:31:45 +00:00
DonIsaac
3d40528588
feat(linter): add fix emoji to rules table and doc pages ( #4715 )
...
Rules table:
<img width="898" alt="image" src="https://github.com/user-attachments/assets/353052aa-0af3-4c09-8441-ff79f4561ca0 ">
Doc pages:
<img width="918" alt="image" src="https://github.com/user-attachments/assets/cb43cb2d-15ff-41e6-8523-145cfbc3f484 ">
2024-08-10 22:50:47 +00:00
Don Isaac
a266b45167
feat(rulegen): improve examples in documentation ( #4815 )
2024-08-10 18:48:59 -04:00
IWANABETHATGUY
15a0fd4f7e
refactor(linter): use Option to reduce nested level in eslint/getter-return ( #4814 )
...
1. Simplify `is_wanted_node`
2024-08-10 16:44:30 -04:00
camc314
d7fce589f8
feat(linter) add suggestion fix for oxc missing throw ( #4806 )
2024-08-10 16:13:44 +00:00
DonIsaac
d2734f3bc4
feat(linter): start fixer for no-unused-vars ( #4718 )
...
Start to add dangerous suggestions for `no-unused-vars`. This PR focuses on fixing unused variable declarations.
- declarations with no references of any kind will be removed with a `FixKind` of dangerous suggestion.
- declarations with some usages will be renamed when the rule is configured with certain `"varsIgnorePattern"`s with a `FixKind` of dangerous fix.
2024-08-10 15:27:12 +00:00
camc314
070ae53ad6
feat(linter): add fixer for unicorn prefer-string-replace-all ( #4801 )
2024-08-10 14:46:12 +00:00
overlookmotel
504ac0b178
perf(minifier): InjectGlobalVariables only add to replaced_dot_defines once for each ( #4803 )
...
`InjectGlobalVariables` minifier plugin was previously adding an entry to `replaced_dot_defines` each time it made a replacement, resulting in many duplicate entries if a single dot define gets replaced multiple times. Only add once for each dot define.
2024-08-10 13:46:15 +00:00
overlookmotel
35f27420b9
perf(minifier): avoid repeated Atom creation in InjectGlobalVariables ( #4802 )
...
Re-use `Atom`s in `InjectGlobalVariables` minifier plugin.
Instead of allocating a new `Atom` on every replacement, create `Atom` lazily when making first replacement, and cache it.
As discussed in: https://github.com/oxc-project/oxc/pull/4759#discussion_r1711669464
2024-08-10 13:46:14 +00:00
Dunqing
62f759c1f2
fix(transformer/typescript): generated assignment for constructor arguments with access modifiers should be injected to the top of the constructor ( #4808 )
...
fix : #4789
2024-08-10 11:21:45 +00:00
oxc-bot
857bc73302
Release crates v0.24.1 ( #4798 )
...
## [0.24.1] - 2024-08-10
### Features
- b3c3125 linter: Overhaul unicorn/no-useless-spread (#4791 ) (DonIsaac)
- c519295 minifier: Add `InjectGlobalVariables` plugin
(`@rollup/plugin-inject`) (#4759 ) (Boshen)
### Bug Fixes
- fff9da3 ast, ast_codegen: Use `generate_derive` instead of visitable
for generating span derives. (#4747 ) (rzvxa)
- f5eeebd ast_macros: Raise compile error on invalid `generate_derive`
input. (#4766 ) (rzvxa)
- 4d0b40a napi/transform: Fix wrong isolated declarations emit (Boshen)
### Refactor
- daa0b2e ast: `oxc_ast` crate re-export AST types from other crates
(#4773 ) (overlookmotel)
- d4a3be8 ast_codegen: Line breaks between types in layout assertions
(#4781 ) (overlookmotel)
- dbb5f4c ast_codegen: Remove unnecessary imports from generated files
(#4774 ) (overlookmotel)
- 7ea058d ast_codegen: Replace Windows-style line breaks with Unix-style
(#4769 ) (overlookmotel)
- 2dea0ca ast_codegen: Consistent import order (#4761 ) (overlookmotel)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-08-10 15:26:40 +08:00
dalaoshu
970c36942c
chore: support windows shell for just ( #4795 )
...
closes #4794
2024-08-10 14:24:14 +08:00
DonIsaac
8f2a566f9f
test(linter): ensure rule docs have valid syntax ( #4644 )
...
Adds tests for rule documentation by
1. Compiling doc markdown into HTML, which ensures docs use valid markdown syntax
2. Converts the generated HTML into JSX and parses the results with the parser, ensuring the generated HTML is valid
Has the added benefit of adding a lot of JSX test cases to the parser. I've also fixed all violations for these tests in this PR.
2024-08-10 05:03:09 +00:00
DonIsaac
b3c3125138
feat(linter): overhaul unicorn/no-useless-spread ( #4791 )
...
I got tired of seeing useless spreads on ternaries and `arr.reduce()` within my company's internal codebase so I overhauled this rule.
## Changes
- add fixer for object spreads
```js
const before = { a, ...{ b, c }, d }
const after = { a, b, c, d } // fixer does not dedupe spaces before `b`
```
- recursively check for useless clones on complex expressions. This rule now catches and auto-fixes the following cases:
```js
// ternaries when both branches create a new array or object
const obj = { ...(foo ? { a: 1 } : { b: 2 }) }
// recursive, so this can support complex cases
const arr = [ ...(foo ? a.map(fn) : bar ? Array.from(iter) : await Promise.all(bar)) ]
// reduce functions where the initial accumulator creates a new object or array
const obj = { ...(arr.reduce(fn, {}) }
```
2024-08-10 04:50:09 +00:00
Jelle van der Waa
5992b7575e
feat(linter): implement eslint-plugin-promise/no-return-in-finally, prefer-await-to-then rule ( #4318 )
...
Part of https://github.com/oxc-project/oxc/pull/4252
---------
Co-authored-by: wenzhe <mysteryven@gmail.com>
2024-08-10 10:41:29 +08:00
Boshen
c51929558d
feat(minifier): add InjectGlobalVariables plugin (@rollup/plugin-inject) ( #4759 )
2024-08-10 01:12:31 +00:00
DonIsaac
f62951411d
feat(website): auto-generate rule docs pages ( #4640 )
...
> AI-generated description because I'm lazy
### TL;DR
This PR introduces the ability to generate documentation for linter rules and adds new methods and metadata for rule fix capabilities.
To see what this looks like, please check out https://github.com/oxc-project/oxc-project.github.io/pull/165 .
## Screenshots
Hyperlinks to rule doc pages in auto-generated rules table
<img width="809" alt="image" src="https://github.com/user-attachments/assets/e09eb47d-e86a-4ed1-b1f9-5034f33c71a2 ">
Example of a docs page
<img width="1273" alt="image" src="https://github.com/user-attachments/assets/78f7e9e6-f4dd-4cc9-aebc-1cdd64b024ec ">
### What changed?
- Added `RuleFixMeta` to indicate rule fix capabilities
- Introduced methods `is_none` and `is_pending` in `RuleFixMeta`
- Modified `render_markdown_table` in `RuleTableSection` to accept an optional link prefix
- Created new modules for rule documentation and HTML rendering
- Updated `print_rules` function to generate markdown for rules and detailed documentation pages
### How to test?
Run the `linter-rules` task with appropriate arguments to generate the markdown table and documentation pages.
Verify the generated files for correctness and that all metadata is correctly displayed.
### Why make this change?
To enhance the project documentation and provide clear rule fix capabilities, thereby improving the developer experience and easing the integration process.
---
2024-08-10 00:13:06 +00:00
lucab
d191823a0a
perf(linter): optmize allocations in jest fn parsing ( #4787 )
2024-08-10 00:09:27 +00:00
heygsc
4dd29dbc2b
test(linter): add fixer test for unicorn/no-zero-fractions ( #4783 )
...
Add fixer test.
Some of them have not passed yet, so I have temporarily made comments as
todo.
2024-08-09 16:46:24 +03:30
Jelle van der Waa
c3c5766601
feat(linter/eslint-plugin-promise): implement valid-params ( #4598 )
2024-08-09 09:02:51 -04:00
heygsc
b259f47007
feat(linter): add fixer for unicorn/no-length-as-slice-end ( #4780 )
...
part of #4179
test:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/snapshots/no-length-as-slice-end.mjs.md
2024-08-09 15:11:52 +03:30
overlookmotel
92777d0aae
refactor(ast_codegen): replace ///@@ with ///@@line_break ( #4786 )
...
Follow-on after #4778 . `///@@line_break` is more verbose, but it's clearer what it does.
2024-08-09 10:52:22 +00:00
overlookmotel
ec82a79ebe
refactor(ast_codegen): trim r# from start of field names ( #4785 )
...
Some struct fields are reserved names e.g. `type`. They are written in source as `r#type`. Trim off the `r#` prefix in `FieldDef::name` and add it back when generating output.
Main motivation is to have the unescaped field names in JSON schema.
2024-08-09 10:52:21 +00:00
overlookmotel
31311877f1
refactor(ast_codegen): alter JSON schema format ( #4784 )
...
Change the format of schema JSON by altering `serde` attrs.
2024-08-09 10:52:20 +00:00
overlookmotel
c79ca40b77
refactor(ast_codegen): remove excess space from start of doc comments ( #4782 )
...
I noticed that in JSON schema the `docs` property contains e.g. `" The name of the identifier being referenced."` (with an excess space on the start). Trim that off.
2024-08-09 10:25:28 +00:00
overlookmotel
d4a3be86ed
refactor(ast_codegen): line breaks between types in layout assertions ( #4781 )
...
Small style nit. Add line breaks between types in generated layout assertions, to make the file easier to read.
2024-08-09 10:17:21 +00:00
overlookmotel
966fcc925a
refactor(ast_codegen): re-order code in fmt module ( #4779 )
...
Pure refactor. Just move code which is most used to top of `fmt` module. And rename `pprint` to `pretty_print` to be a little clearer.
2024-08-09 10:01:14 +00:00
overlookmotel
2c1c7050ea
refactor(ast_codegen): use doc comments instead of endl! ( #4778 )
...
Similar to #4777 .
Use `///@@` instead of `endl!();` in AST codegen to create line breaks.
NB: `///@@` needs to be before an item, not after it.
2024-08-09 08:57:18 +00:00
overlookmotel
f418f62e7b
refactor(ast_codegen): use doc comments instead of insert! ( #4777 )
...
Avoid the `insert!` macro in AST codegen. Use doc comments starting with special symbol `@` instead.
* Before: `insert!("// plain comment");`
* After: `///@ plain comment`
* Or: `//!@ plain comment`
Either `///@` or `//!@` is converted to plain `//` in output.
`//!@` is legal in top-of-file position, which allows us to inline `#![allow(...)]` attributes, which in my opinion makes the generators a bit easier to read.
2024-08-09 08:19:15 +00:00
Burlin
b22ed4512d
fix(linter): improve prefer_namespace_keyword rule ( #4751 )
...
fix : #4651
This commit enhances the `prefer_namespace_keyword` rule in the
TypeScript linter: Add support for detecting and fixing nested module
declarations (e.g., module A.B {})
- Introduce helper functions `is_nest_module`, `is_valid_module`, and
`is_invalid_module` to improve code readability and maintainability
- Refactor the main `run` function to use these new helper functions
- Update test cases to cover nested module scenarios
- Improve error reporting for nested modules
2024-08-09 11:46:50 +03:30
overlookmotel
c15c931a3f
refactor(ast_codegen): move formatting regex definitions ( #4775 )
...
Pure refactor. Move the regex definitions used in formatting to next to the `Replacer`s for those regexes.
2024-08-09 07:48:13 +00:00
overlookmotel
dbb5f4c75e
refactor(ast_codegen): remove unnecessary imports from generated files ( #4774 )
...
#4773 makes types like `Span` importable from `oxc_ast::ast`, so remove the imports from other crates in generated code.
I'm not sure why clippy's `wildcard_imports` rule was not being triggered for `use crate::ast::*;`, but add `#[allow(clippy::wildcard_imports)]` on these statements just to make sure.
2024-08-09 07:48:09 +00:00
overlookmotel
daa0b2e66e
refactor(ast): oxc_ast crate re-export AST types from other crates ( #4773 )
...
Some AST types are defined in crates outside `oxc_ast` crate. Re-export these types from `oxc_ast` crate for ease - so you don't need to remember where they're defined to use them.
2024-08-09 07:13:56 +00:00