Boshen
9fd9f4f5b9
feat(linter)!: sync sindresorhus/globals; removed Object.prototype properties from builtin and es* globals ( #6991 )
2024-10-29 04:13:20 +00:00
Boshen
8cbf3f09d6
chore: replace bacon with watchexec
2024-10-29 11:50:58 +08:00
DonIsaac
8f1460eba3
refactor(linter): move LintPlugins from LintOptions to LintConfig ( #6932 )
...
Pure refactor. Moves plugin settings from linter options (which control the linter's behavior on a global level) and linter config ("which may or may not get adjusted on each file).
2024-10-29 01:28:21 +00:00
DonIsaac
1691cab507
feat(linter): support user-configurable secrets for oxc-security/api-keys ( #5938 )
2024-10-28 18:55:19 +00:00
Boshen
4b450cc985
chore(transformer): mark all CompilerAssumptions as not Implemented ( #6984 )
2024-10-28 15:35:32 +00:00
Boshen
4551baaf4a
docs(linter): document rules ( #6983 )
...
closes #6370
2024-10-28 14:49:16 +00:00
Boshen
46e5360372
chore(deps): update crate-ci/typos action to v1.26.8 ( #6981 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-28 22:02:05 +08:00
Boshen
b518670582
chore(coverage): remove known runtime issues
2024-10-28 21:38:37 +08:00
camchenry
c35d3f2ea2
test(linter): improve test failure output ( #6975 )
...
Improves the test output when a test fails, based on the type of expectation. The output now includes the config that was passed, as well as the source code that failed. Additional formatting makes it a little bit easier to parse.
Before:
<img width="818" alt="Screenshot 2024-10-27 at 11 54 02 PM" src="https://github.com/user-attachments/assets/bac4079c-566a-403b-adde-acdc709baceb ">
<img width="792" alt="Screenshot 2024-10-27 at 11 54 56 PM" src="https://github.com/user-attachments/assets/16074216-00ad-4cdc-9f47-09142242111d ">
---
After:
<img width="784" alt="Screenshot 2024-10-27 at 11 49 36 PM" src="https://github.com/user-attachments/assets/5d687562-55f4-4e4f-aa3a-c90b90b714e8 ">
<img width="820" alt="Screenshot 2024-10-27 at 11 58 56 PM" src="https://github.com/user-attachments/assets/0725d362-7aed-4fd0-9fab-93a7687aca6d ">
2024-10-28 12:55:24 +00:00
Boshen
fa9a4ecd4a
perf(parser): check . before [ in parse_member_expression_rest ( #6979 )
2024-10-28 11:00:28 +00:00
camchenry
da199c7476
fix(ecmascript): allow getting PropName for object methods ( #6967 )
...
Working on some lint rules and noticed that PropName didn't seem to be working as intended. According to the spec, we should definitely allow get/set/methods to have prop names:
https://tc39.es/ecma262/#sec-static-semantics-propname
<img width="694" alt="image" src="https://github.com/user-attachments/assets/60fdfeec-2320-4cd9-a786-901728e459b2 ">
However, we still need to retain this logic for checking `__proto__` because it has special rules.
2024-10-28 09:34:27 +00:00
dalaoshu
7aa496ab33
fix(linter): remove unsafe fixer of no-useless-spread ( #6655 )
...
closes #6618
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-10-28 17:32:02 +08:00
Boshen
14f36ce3f9
chore(task/lint_rules): change not supported to "no need to implement"
...
closes #6822
2024-10-28 17:29:29 +08:00
renovate
56f5506ca9
chore(deps): update rust crates ( #6961 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [encoding_rs](https://docs.rs/encoding_rs/ ) ([source](https://redirect.github.com/hsivonen/encoding_rs )) | workspace.dependencies | patch | `0.8.34` -> `0.8.35` |
| [handlebars](https://redirect.github.com/sunng87/handlebars-rust ) | workspace.dependencies | minor | `6.1.0` -> `6.2.0` |
| [insta](https://insta.rs/ ) ([source](https://redirect.github.com/mitsuhiko/insta )) | workspace.dependencies | minor | `1.40.0` -> `1.41.0` |
| [prettyplease](https://redirect.github.com/dtolnay/prettyplease ) | workspace.dependencies | patch | `0.2.24` -> `0.2.25` |
| [regex](https://redirect.github.com/rust-lang/regex ) | workspace.dependencies | patch | `1.11.0` -> `1.11.1` |
| [saphyr](https://redirect.github.com/saphyr-rs/saphyr ) | workspace.dependencies | patch | `0.0.1` -> `0.0.3` |
| [serde](https://serde.rs ) ([source](https://redirect.github.com/serde-rs/serde )) | workspace.dependencies | patch | `1.0.210` -> `1.0.213` |
| [tokio](https://tokio.rs ) ([source](https://redirect.github.com/tokio-rs/tokio )) | workspace.dependencies | minor | `1.40.0` -> `1.41.0` |
---
### Release Notes
<details>
<summary>hsivonen/encoding_rs (encoding_rs)</summary>
### [`v0.8.35`](https://redirect.github.com/hsivonen/encoding_rs/compare/v0.8.34...v0.8.35 )
[Compare Source](https://redirect.github.com/hsivonen/encoding_rs/compare/v0.8.34...v0.8.35 )
</details>
<details>
<summary>sunng87/handlebars-rust (handlebars)</summary>
### [`v6.2.0`](https://redirect.github.com/sunng87/handlebars-rust/blob/HEAD/CHANGELOG.md#620---2024-10-26 )
[Compare Source](https://redirect.github.com/sunng87/handlebars-rust/compare/v6.1.0...v6.2.0 )
- \[Added] `@index` variable for object iteration \[[#​682](https://redirect.github.com/sunng87/handlebars-rust/issues/682 )]
- \[Changed] improve number comparison between different types \[[#​679](https://redirect.github.com/sunng87/handlebars-rust/issues/679 )]
</details>
<details>
<summary>mitsuhiko/insta (insta)</summary>
### [`v1.41.0`](https://redirect.github.com/mitsuhiko/insta/blob/HEAD/CHANGELOG.md#1410 )
[Compare Source](https://redirect.github.com/mitsuhiko/insta/compare/1.40.0...1.41.0 )
- Experimental support for binary snapshots. [#​610](https://redirect.github.com/mitsuhiko/insta/issues/610 ) (Florian Plattner)
- `--force-update-snapshots` now causes `cargo-insta` to write every snapshot, regardless of whether
snapshots fully match, and now implies `--accept`. This
allows for `--force-update-snapshots` to update inline snapshots'
delimiters and indentation.
For the previous behavior of `--force-update-snapshots`, which limited writes to
snapshots which didn't fully match, use `--require-full-match`.
The main difference between `--require-full-match` and the existing behavior of `--force-update-snapshots`
is a non-zero exit code on any snapshots which don't fully match.
Like the previous behavior or `--force-update-snapshots`, `--require-full-match`
doesn't track inline snapshots' delimiters or
indentation, so can't update if those don't match. [#​644](https://redirect.github.com/mitsuhiko/insta/issues/644 )
- Inline snapshots only use `#` characters as delimiters when required. [#​603](https://redirect.github.com/mitsuhiko/insta/issues/603 )
- Warnings for undiscovered snapshots are more robust, and include files with
custom snapshot extensions. [#​637](https://redirect.github.com/mitsuhiko/insta/issues/637 )
- Insta runs correctly on packages which reference rust files in a parent path. [#​626](https://redirect.github.com/mitsuhiko/insta/issues/626 )
- Warnings are printed when any snapshot uses a legacy format. [#​599](https://redirect.github.com/mitsuhiko/insta/issues/599 )
- `cargo insta --version` now prints a version. [#​665](https://redirect.github.com/mitsuhiko/insta/issues/665 )
- `insta` now internally uses `INSTA_UPDATE=force` rather than
`INSTA_FORCE_UPDATE=1`. (This doesn't affect users of `cargo-insta`, which
handles this internally.) [#​482](https://redirect.github.com/mitsuhiko/insta/issues/482 )
- `cargo-insta`'s integration tests continue to grow over the past couple of versions,
and now offer coverage of most of `cargo-insta`'s interface.
</details>
<details>
<summary>dtolnay/prettyplease (prettyplease)</summary>
### [`v0.2.25`](https://redirect.github.com/dtolnay/prettyplease/releases/tag/0.2.25 )
[Compare Source](https://redirect.github.com/dtolnay/prettyplease/compare/0.2.24...0.2.25 )
- Print safe and explicitly unsafe foreign items ([#​85](https://redirect.github.com/dtolnay/prettyplease/issues/85 ), [https://github.com/rust-lang/rust/issues/123743 ](https://redirect.github.com/rust-lang/rust/issues/123743 ))
</details>
<details>
<summary>rust-lang/regex (regex)</summary>
### [`v1.11.1`](https://redirect.github.com/rust-lang/regex/blob/HEAD/CHANGELOG.md#1111-2024-10-24 )
[Compare Source](https://redirect.github.com/rust-lang/regex/compare/1.11.0...1.11.1 )
\===================
This is a new patch release of `regex` that fixes compilation on nightly
Rust when the unstable `pattern` crate feature is enabled. Users on nightly
Rust without this feature enabled are unaffected.
Bug fixes:
- [BUG #​1231](https://redirect.github.com/rust-lang/regex/issues/1231 ):
Fix the `Pattern` trait implementation as a result of nightly API breakage.
</details>
<details>
<summary>saphyr-rs/saphyr (saphyr)</summary>
### [`v0.0.3`](https://redirect.github.com/saphyr-rs/saphyr/compare/v0.0.1...v0.0.3 )
[Compare Source](https://redirect.github.com/saphyr-rs/saphyr/compare/v0.0.1...v0.0.3 )
</details>
<details>
<summary>serde-rs/serde (serde)</summary>
### [`v1.0.213`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.213 )
[Compare Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.212...v1.0.213 )
- Fix support for macro-generated `with` attributes inside a newtype struct ([#​2847](https://redirect.github.com/serde-rs/serde/issues/2847 ))
### [`v1.0.212`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.212 )
[Compare Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.211...v1.0.212 )
- Fix hygiene of macro-generated local variable accesses in serde(with) wrappers ([#​2845](https://redirect.github.com/serde-rs/serde/issues/2845 ))
### [`v1.0.211`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.211 )
[Compare Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.210...v1.0.211 )
- Improve error reporting about mismatched signature in `with` and `default` attributes ([#​2558](https://redirect.github.com/serde-rs/serde/issues/2558 ), thanks [@​Mingun](https://redirect.github.com/Mingun ))
- Show variant aliases in error message when variant deserialization fails ([#​2566](https://redirect.github.com/serde-rs/serde/issues/2566 ), thanks [@​Mingun](https://redirect.github.com/Mingun ))
- Improve binary size of untagged enum and internally tagged enum deserialization by about 12% ([#​2821](https://redirect.github.com/serde-rs/serde/issues/2821 ))
</details>
<details>
<summary>tokio-rs/tokio (tokio)</summary>
### [`v1.41.0`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.41.0 ): Tokio v1.41.0
[Compare Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.40.0...tokio-1.41.0 )
##### 1.41.0 (Oct 22th, 2024)
##### Added
- metrics: stabilize `global_queue_depth` ([#​6854], [#​6918])
- net: add conversions for unix `SocketAddr` ([#​6868])
- sync: add `watch::Sender::sender_count` ([#​6836])
- sync: add `mpsc::Receiver::blocking_recv_many` ([#​6867])
- task: stabilize `Id` apis ([#​6793], [#​6891])
##### Added (unstable)
- metrics: add H2 Histogram option to improve histogram granularity ([#​6897])
- metrics: rename some histogram apis ([#​6924])
- runtime: add `LocalRuntime` ([#​6808])
##### Changed
- runtime: box futures larger than 16k on release mode ([#​6826])
- sync: add `#[must_use]` to `Notified` ([#​6828])
- sync: make `watch` cooperative ([#​6846])
- sync: make `broadcast::Receiver` cooperative ([#​6870])
- task: add task size to tracing instrumentation ([#​6881])
- wasm: enable `cfg_fs` for `wasi` target ([#​6822])
##### Fixed
- net: fix regression of abstract socket path in unix socket ([#​6838])
##### Documented
- io: recommend `OwnedFd` with `AsyncFd` ([#​6821])
- io: document cancel safety of `AsyncFd` methods ([#​6890])
- macros: render more comprehensible documentation for `join` and `try_join` ([#​6814], [#​6841])
- net: fix swapped examples for `TcpSocket::set_nodelay` and `TcpSocket::nodelay` ([#​6840])
- sync: document runtime compatibility ([#​6833])
[#​6793]: https://redirect.github.com/tokio-rs/tokio/pull/6793
[#​6808]: https://redirect.github.com/tokio-rs/tokio/pull/6808
[#​6810]: https://redirect.github.com/tokio-rs/tokio/pull/6810
[#​6814]: https://redirect.github.com/tokio-rs/tokio/pull/6814
[#​6821]: https://redirect.github.com/tokio-rs/tokio/pull/6821
[#​6822]: https://redirect.github.com/tokio-rs/tokio/pull/6822
[#​6826]: https://redirect.github.com/tokio-rs/tokio/pull/6826
[#​6828]: https://redirect.github.com/tokio-rs/tokio/pull/6828
[#​6833]: https://redirect.github.com/tokio-rs/tokio/pull/6833
[#​6836]: https://redirect.github.com/tokio-rs/tokio/pull/6836
[#​6838]: https://redirect.github.com/tokio-rs/tokio/pull/6838
[#​6840]: https://redirect.github.com/tokio-rs/tokio/pull/6840
[#​6841]: https://redirect.github.com/tokio-rs/tokio/pull/6841
[#​6846]: https://redirect.github.com/tokio-rs/tokio/pull/6846
[#​6854]: https://redirect.github.com/tokio-rs/tokio/pull/6854
[#​6867]: https://redirect.github.com/tokio-rs/tokio/pull/6867
[#​6868]: https://redirect.github.com/tokio-rs/tokio/pull/6868
[#​6870]: https://redirect.github.com/tokio-rs/tokio/pull/6870
[#​6881]: https://redirect.github.com/tokio-rs/tokio/pull/6881
[#​6890]: https://redirect.github.com/tokio-rs/tokio/pull/6890
[#​6891]: https://redirect.github.com/tokio-rs/tokio/pull/6891
[#​6897]: https://redirect.github.com/tokio-rs/tokio/pull/6897
[#​6918]: https://redirect.github.com/tokio-rs/tokio/pull/6918
[#​6924]: https://redirect.github.com/tokio-rs/tokio/pull/6924
</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 is behind base branch, or you tick the rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.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://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjM4LjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2024-10-28 06:22:28 +00:00
overlookmotel
9e66c2949d
refactor(transformer/react-refresh): small refactor ( #6973 )
...
Follow-on after #6937 . Refactor 2 small blocks of code.
* Replace 2 `if` statements with 1.
* Obey the mighty clippy!
2024-10-28 02:57:55 +00:00
Albert Kaaman
610621cadf
feat(linter): implement react/style-prop-object ( #6342 )
...
Implements not recommended rule `react/style-prop-object`
(https://github.com/oxc-project/oxc/issues/1022 )
---------
Co-authored-by: Don Isaac <donald.isaac@gmail.com>
2024-10-27 22:51:09 -04:00
ottomated
9725e3c2ec
feat(ast_tools): Add #[estree(always_flatten)] to Span ( #6935 )
...
Part of #6347
Other changes:
- added #[estree(skip)] to thisSpan in TSThisParameter
- Flattened the span in BoundaryAssertion (regex)
2024-10-28 02:13:24 +00:00
ottomated
fbc297ec7b
feat(ast_tools): Move tsify custom types to estree attribute macro ( #6934 )
...
Part of #6347
2024-10-28 01:45:27 +00:00
ottomated
169fa22350
feat(ast_tools): Default enums to rename_all = "camelCase" ( #6933 )
...
Part of #6347
2024-10-28 01:39:25 +00:00
Dunqing
1ca8cd2fd9
refactor(transformer/react-refresh): avoid panic for init of VariableDeclarator isn't a BindingIdentifier ( #6937 )
...
related: https://github.com/oxc-project/oxc/pull/6881#discussion_r1816597462
2024-10-28 01:19:53 +00:00
overlookmotel
335eb38be6
refactor(ast_tools): faster formatting Rust code ( #6972 )
...
Speed up formatting Rust code. Don't convert to string and then re-parse, allow `syn` to skip a step by using existing `TokenStream`.
2024-10-28 01:13:36 +00:00
Boshen
149b02c535
ci: run napi build and test for all changes
2024-10-28 09:10:54 +08:00
Boshen
dcdb9ead4e
fix(napi/transform): fix test
2024-10-28 09:10:54 +08:00
Boshen
5d6997502b
chore(renovate): let renovate bump all npm versions because this is a pnpmm onorepo now
2024-10-28 09:10:54 +08:00
overlookmotel
7fcc4f7211
refactor(ast_tools): one function to add header to generated files ( #6971 )
...
Centralize logic for adding header to generated files.
2024-10-28 00:47:49 +00:00
overlookmotel
c7bec098fa
docs(ast_tools): correct doc comments for Output ( #6970 )
2024-10-28 00:47:48 +00:00
overlookmotel
3aed3eb543
refactor(ast_tools): remove well_known! macro ( #6957 )
...
Remove `well_known!` macro by expanding code manually.
2024-10-28 00:47:46 +00:00
overlookmotel
54e78d9ea3
refactor(ast_tools): reduce macro usage ( #6956 )
...
Pure refactor. Expand simple macros.
2024-10-28 00:47:45 +00:00
renovate[bot]
7827bec826
chore(deps): update vscode npm packages ( #6963 )
2024-10-28 08:44:18 +08:00
Nicholas Rayburn
6cb1973f4a
fix(editor): Publish diagnostics on open for all run modes except disabled ( #6965 )
2024-10-28 08:39:47 +08:00
Nicholas Rayburn
6b619da23a
feat(editor): Listen to config file changes and trigger a didChangeConfiguration update ( #6964 )
...
Watch eslint and oxlint config files for changes. When these files
change, a `didChangeConfiguration` event will be sent to the language
server.
Ref https://github.com/oxc-project/backlog/issues/132 .
2024-10-28 08:39:24 +08:00
Nicholas Rayburn
ebf37539c0
fix(editor): Fix onConfigChange to send the correct config for didChangeConfiguration notification ( #6962 )
...
This currently fails because it sends over data that the language server
isn't prepared to deserialize. This updates to send over the correct
`LanguageServerConfig` type.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-28 08:38:57 +08:00
overlookmotel
83d1f69f75
refactor(ast_tools): replace str::replace with CowUtils::cow_replace ( #6954 )
...
Obey our clippy-enforced policy to prefer `CowUtils::cow_replace`.
2024-10-28 00:23:34 +00:00
overlookmotel
ac6b3091ab
refactor(ast_tools): remove repeated code in Output methods ( #6953 )
...
`generator_path.replace('\\', "/")` was repeated in each module for that generates outputs. Move it, to reduce repetition.
2024-10-28 00:23:33 +00:00
overlookmotel
2b10e5cd52
refactor(ast_tools): move logger into separate module ( #6952 )
...
Reduce the amount of code in `main.rs` by moving logger functionality to a separate module.
2024-10-28 00:23:33 +00:00
overlookmotel
06f05659c5
refactor(ast_tools): refactor writing outputs ( #6951 )
...
`write_all_to` no longer needs to be public. Remove it, and compact the code for writing files.
2024-10-27 23:56:22 +00:00
overlookmotel
6b88798253
refactor(ast_tools): generate JSON schema as Output::Raw ( #6950 )
...
Add `Output::Raw`, and use it for the JSON schema file.
2024-10-27 23:56:21 +00:00
overlookmotel
2fc6ca374f
refactor(ast_tools): hardcode schema output path ( #6949 )
...
Hard-code the output file path for JSON schema file. This will allow generating it as an `Output`, same as all other generated files.
2024-10-27 23:40:57 +00:00
overlookmotel
ef2f73ebed
refactor(ast_tools): rename Output::into_raw method ( #6948 )
...
Rename `Output::output` to `Output::into_raw` - more descriptive name.
2024-10-27 23:40:56 +00:00
overlookmotel
524d9c069f
refactor(ast_tools): generate CI filter as Output::Yaml ( #6947 )
...
Add `Output::Yaml` and use it for generating CI filter file.
2024-10-27 19:18:10 +00:00
overlookmotel
11539e61fd
refactor(ast_tools): add CI filter file to outputs ( #6946 )
...
Generate CI filter file as a `RawOutput`, same as the rest, rather than
specific code to write it to a file.
2024-10-27 19:09:42 +00:00
overlookmotel
87db9eeeed
refactor(ast_tools): simplify logging ( #6945 )
...
* Replace `logln!` macro with `log_result!` to log result of an action.
* Move logging for writing files into one place.
2024-10-27 18:53:24 +00:00
DonIsaac
f5a7134834
fix(linter/no-unused-vars): false positive for discarded reads within sequences ( #6907 )
...
Fixes a case where no-unused-vars incorectly reports a read as unused in edge
cases where a logical/binary expression is used as a conditional shorthand to
write a variable within sequence expressions.
Some code examples will make this more clear.
```js
function foo(a) {
let x = somePropertyIWantToCheck();
(x in a && x.hasPropA = true, console.log(a))
}
```
Since the logical expression is not in the last position within the sequence
expression list, it's getting discarded as unused. However, the right expression
(`x.hasPropA = true`) has side effects, so it _is_ being used.
2024-10-27 17:06:58 +00:00
overlookmotel
dde095c7e1
refactor(ast_tools): combine derives into generators ( #6944 )
...
`Generator`s and `Derive`s now work the same. Combine them into a single `Vec`.
2024-10-27 15:37:25 +00:00
overlookmotel
80a163e691
refactor(ast_tools): reduce repeated code ( #6943 )
...
Use one function to process all passes.
2024-10-27 15:37:24 +00:00
overlookmotel
e1b747ddd6
refactor(ast_tools): all runners produce Vec<Output> ( #6942 )
...
Standardize all the different `Runner`s to produce `Vec<Output>`.
2024-10-27 15:29:17 +00:00
overlookmotel
c83b758507
refactor(ast_tools): simplify Pass ( #6941 )
...
Pure refactor. Remove dead code and structure like the other `Runner`s.
2024-10-27 14:38:18 +00:00
Boshen
9a6a2f99c6
refactor(semantic)!: remove SymbolTable::get_symbol_id_from_span API ( #6955 )
...
closes #6867
2024-10-27 14:31:36 +00:00
overlookmotel
c4c0865cb3
refactor(ast_tools): clarify code ( #6940 )
...
Small refactor.
2024-10-27 14:30:36 +00:00
Boshen
6d97af46c7
feat(rust): use oxc-miette ( #6938 )
2024-10-27 13:30:20 +00:00