overlookmotel
71898ffdd5
refactor(parser): move source length check into lexer ( #2206 )
...
This change makes little difference in itself, but moving the check into
the lexer will allow some optimizations in lexer using unsafe code which
depend on this invariant.
2024-01-29 22:29:02 +08:00
overlookmotel
e123be0a00
fix(parser): correct MAX_LEN for 32-bit systems ( #2204 )
...
Maximum length of source parser can accept is limited on 32-bit systems
to `isize::MAX` (i.e. `i32::MAX` not `u32::MAX`) because Rust [limits
the size of
allocations](https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.from_size_align )
to `isize::MAX`.
This PR takes that constraint into account when calculating
`Parser::MAX_LEN`.
It also speeds up the `overlong_source` test so it runs in under 500ms
(previously it took ~4 secs on a M1 Macbook Pro).
2024-01-29 21:45:45 +08:00
Boshen
a1271af5df
docs(allocator): document behaviour of Box
2024-01-29 21:34:45 +08:00
Boshen
a647a47a3c
ci: update renovate bot schedule
2024-01-29 21:32:37 +08:00
kaykdm
da3b3057a2
feat(linter): implement @next/next/no-before-interactive-script-outsi… ( #2203 )
...
…de-document
implement @next/next/no-before-interactive-script-outside-document
Related issue: https://github.com/oxc-project/oxc/issues/1929
original implementation
- code:
https://github.com/vercel/next.js/blob/canary/packages/eslint-plugin-next/src/rules/no-before-interactive-script-outside-document.ts
- test:
https://github.com/vercel/next.js/blob/canary/test/unit/eslint-plugin-next/no-before-interactive-script-outside-document.test.ts
- doc:
https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
2024-01-29 21:01:50 +08:00
Dunqing
f59e87f9c4
refactor(semantic): checking label in ContinueStatement based on LabelBuilder ( #2202 )
2024-01-29 18:24:42 +08:00
kaykdm
b694a6a76e
feat(linter): implement @next/next/no-unwanted-polyfillio ( #2197 )
...
implement @next/next/no-unwanted-polyfillio
Related issue: https://github.com/oxc-project/oxc/issues/1929
original implementation
- code:
https://github.com/vercel/next.js/blob/canary/packages/eslint-plugin-next/src/rules/no-unwanted-polyfillio.ts
- test:
https://github.com/vercel/next.js/blob/canary/test/unit/eslint-plugin-next/no-unwanted-polyfillio.test.ts
- doc: https://nextjs.org/docs/messages/no-unwanted-polyfillio
2024-01-29 16:45:09 +08:00
renovate[bot]
35ff52aa31
chore(deps): update website npm packages ( #2200 )
...
[](https://renovatebot.com )
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@codemirror/view](https://togithub.com/codemirror/view ) | [`6.23.0`
->
`6.23.1`](https://renovatebot.com/diffs/npm/@codemirror%2fview/6.23.0/6.23.1 )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
| [pnpm](https://pnpm.io ) ([source](https://togithub.com/pnpm/pnpm )) |
[`8.14.3` ->
`8.15.0`](https://renovatebot.com/diffs/npm/pnpm/8.14.3/8.15.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/ )
|
---
### Release Notes
<details>
<summary>codemirror/view (@​codemirror/view)</summary>
###
[`v6.23.1`](https://togithub.com/codemirror/view/blob/HEAD/CHANGELOG.md#6231-2024-01-24 )
[Compare
Source](https://togithub.com/codemirror/view/compare/6.23.0...6.23.1 )
##### Bug fixes
Fix a bug that caused `Tooltip.above` to not take effect for tooltips
that were already present when the tooltip plugin is initialized.
Automatically reposition tooltips when their size changes.
</details>
<details>
<summary>pnpm/pnpm (pnpm)</summary>
### [`v8.15.0`](https://togithub.com/pnpm/pnpm/releases/tag/v8.15.0 )
[Compare
Source](https://togithub.com/pnpm/pnpm/compare/v8.14.3...v8.15.0 )
#### Minor Changes
- When the license field does not exist in `package.json` but a license
file exists, try to match and extract the license name
[#​7530](https://togithub.com/pnpm/pnpm/pull/7530 ).
#### Patch Changes
- Running `pnpm update -r --latest` will no longer downgrade prerelease
dependencies [#​7436](https://togithub.com/pnpm/pnpm/issues/7436 ).
- `--aggregate-output` should work on scripts executed from the same
project [#​7556](https://togithub.com/pnpm/pnpm/issues/7556 ).
- Prefer hard links over reflinks on Windows as they perform better
[#​7564](https://togithub.com/pnpm/pnpm/pull/7564 ).
- Reduce the length of the side-effects cache key. Instead of saving a
stringified object composed from the dependency versions of the package,
use the hash calculated from the said object
[#​7563](https://togithub.com/pnpm/pnpm/pull/7563 ).
- Throw an error if `pnpm update --latest` runs with arguments
containing versions specs. For instance, `pnpm update --latest foo@next`
is not allowed [#​7567](https://togithub.com/pnpm/pnpm/pull/7567 ).
- Don't fail in Windows CoW if the file already exists
[#​7554](https://togithub.com/pnpm/pnpm/issues/7554 ).
#### Platinum Sponsors
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://bit.dev/?utm_source=pnpm&utm_medium=release_notes "
target="_blank"><img src="https://pnpm.io/img/users/bit.svg "
width="80"></a>
</td>
<td align="center" valign="middle">
<a href="https://figma.com/?utm_source=pnpm&utm_medium=release_notes "
target="_blank"><img src="https://pnpm.io/img/users/figma.svg "
width="80"></a>
</td>
</tr>
</tbody>
</table>
#### Gold Sponsors
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://discord.com/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/discord.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/discord_light.svg " />
<img src="https://pnpm.io/img/users/discord.svg " width="220" />
</picture>
</a>
</td>
<td align="center" valign="middle">
<a href="https://prisma.io/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/prisma.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/prisma_light.svg " />
<img src="https://pnpm.io/img/users/prisma.svg " width="180" />
</picture>
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://uscreen.de/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/uscreen.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/uscreen_light.svg " />
<img src="https://pnpm.io/img/users/uscreen.svg " width="180" />
</picture>
</a>
</td>
<td align="center" valign="middle">
<a
href="https://www.jetbrains.com/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/jetbrains.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/jetbrains.svg " />
<img src="https://pnpm.io/img/users/jetbrains.svg " width="85" />
</picture>
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://nx.dev/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/nx.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/nx_light.svg " />
<img src="https://pnpm.io/img/users/nx.svg " width="120" />
</picture>
</a>
</td>
</tr>
</tbody>
</table>
#### Our Silver Sponsors
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a
href="https://leniolabs.com/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<img src="https://pnpm.io/img/users/leniolabs.jpg " width="80">
</a>
</td>
<td align="center" valign="middle">
<a href="https://vercel.com/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/vercel.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/vercel_light.svg " />
<img src="https://pnpm.io/img/users/vercel.svg " width="180" />
</picture>
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://depot.dev/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/depot.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/depot_light.svg " />
<img src="https://pnpm.io/img/users/depot.svg " width="200" />
</picture>
</a>
</td>
<td align="center" valign="middle">
<a href="https://moonrepo.dev/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/moonrepo.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/moonrepo_light.svg " />
<img src="https://pnpm.io/img/users/moonrepo.svg " width="200" />
</picture>
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a
href="https://www.thinkmill.com.au/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/thinkmill.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/thinkmill_light.svg " />
<img src="https://pnpm.io/img/users/thinkmill.svg " width="200" />
</picture>
</a>
</td>
<td align="center" valign="middle">
<a href="https://devowl.io/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/devowlio.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/devowlio.svg " />
<img src="https://pnpm.io/img/users/devowlio.svg " width="200" />
</picture>
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://macpaw.com/?utm_source=pnpm&utm_medium=release_notes "
target="_blank">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/macpaw.svg " />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/macpaw_light.svg " />
<img src="https://pnpm.io/img/users/macpaw.svg " width="200" />
</picture>
</a>
</td>
</tr>
</tbody>
</table>
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "on monday" (UTC), Automerge - At any
time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **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:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjE1My4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-29 16:16:48 +08:00
Dunqing
56adfb1a86
refactor(semantic): use LabelBuilder instead of UnusedLabeled ( #2184 )
...
I think `UnusedLabeled` can do more than that.
1. Collect unused label
2. Support check duplication label
3. Support check label in `BreakStatement`
4. Support check label in `ContinueStatement` (Not yet)
But then the `UnusedLabeled` name wouldn't fit, so I renamed it
`LabelBuilder` and moved it to `label.rs`
2024-01-29 15:15:07 +08:00
Dunqing
972be831e9
fix(semantic): fix incorrect semantic example ( #2198 )
2024-01-29 06:48:47 +00:00
Boshen
8e7c376898
chore(renovate): update groups names
2024-01-29 11:41:33 +08:00
renovate[bot]
55e33befc6
chore(deps): update vscode ( #2192 )
2024-01-29 11:40:14 +08:00
renovate[bot]
4b83d97c3b
chore(deps): update cargo ( #2191 )
2024-01-29 11:38:47 +08:00
Yunfei He
d34650a1ac
fix(codegen): print necessary spaces for ExportAllDeclaration ( #2190 )
2024-01-29 01:05:09 +08:00
Yuji Sugiura
41fb7ef7e7
chore(tasks/lint_rules): Arrange UI ( #2187 )
...
Part of #2020
- [x] rule counters
- [x] show two tables
- [x] omit all the deprecated rules
Eventually I decided to split them into 3 tables.
In order to be aware of the newly deprecated rules in the future, the
deprecated rules are hidden by default, rather than omitted altogether.
2024-01-28 22:25:33 +08:00
Boshen
87b9978859
refactor: move all miette usages to oxc_diagnostics
2024-01-28 16:52:16 +08:00
Wenzhe Wang
f039ad6007
fix(linter): ban --fix for variety files(vue, astro, svelte) ( #2189 )
...
closes : #2122
2024-01-28 13:46:39 +08:00
Wenzhe Wang
1de3518046
refactor(linter): remove Regex and change error position ( #2188 )
2024-01-28 11:48:23 +08:00
西了意
f32228e0b7
fix(linter): jsx no undef match scope should check with ancestors ( #2027 )
2024-01-27 11:38:32 +08:00
Boshen
1b5bbb954c
Release oxlint and vscode extension v0.2.6
2024-01-26 22:35:35 +08:00
Boshen
ab8a3114a2
feat(cli): add --version ( #2182 )
...
closes #2154
2024-01-26 19:13:17 +08:00
Boshen
a17e43eefe
refactor(linter): move settings and env to the config module ( #2181 )
2024-01-26 18:51:06 +08:00
Boshen
87bc19830e
chore(tasks/lint_rules): change typescript issue number
2024-01-26 16:20:39 +08:00
Dunqing
122abd56ef
fix(semantic): replace ClassStatickBlockAwait with ClassStaticBlockAwait ( #2179 )
2024-01-26 15:52:32 +08:00
Dunqing
080e78c647
feat(ast): complete AccessorProperty todo in has_decorator ( #2178 )
2024-01-26 15:47:26 +08:00
Yuji Sugiura
cba8a4c131
feat(tasks): Enable tasks/lint_rules(JS ver) ( #2177 )
...
- [x] Remove old task(Rust ver)
- [x] Migrate to new task(JS ver)
- [x] Confirm CI works w/o `--output`
-
https://github.com/oxc-project/oxc/actions/runs/7663961642/job/20887579432?pr=2177
- [x] Confirm CI works w/ fake issue no
- https://github.com/oxc-project/oxc/issues/2117
- [x] Enable
- - -
I've noticed that
- eslint/no-extra-semi
- eslint/no-mixed-spaces-and-tabs
are maked as deprecated and also recommended.
This is ESLint side
[issue](https://github.com/eslint/eslint/pull/17696#issuecomment-1792452766 )
and will fix after v9.
2024-01-26 15:45:05 +08:00
Dunqing
ea8cc98c34
fix(ast): AcessorProperty is missing decorators ( #2176 )
2024-01-26 15:43:05 +08:00
Yuji Sugiura
2e3153e16f
fix(linter): Rename react_perf/jsx_no_new_function_as_props to jsx_no_new_function_as_prop ( #2175 )
...
s/props/prop/
>
https://github.com/cvazac/eslint-plugin-react-perf/blob/master/docs/rules/jsx-no-new-function-as-prop.md
Sorry, I overlooked this in #2169 😨
2024-01-26 11:06:50 +08:00
Julien Tanay
d5b378a891
feat(vscode): allow config path configuration ( #2172 )
...
Fixes #1944
2024-01-26 10:49:25 +08:00
Yuji Sugiura
b268cb2545
feat(tasks): tasks/lint_rules2 re-implement --update ( #2173 )
...
- Add `pluginMeta` field to make issue more informative
- Implement `--update` flag to update GitHub issue
With lots of refactoring.
2024-01-26 10:48:26 +08:00
fi3ework
ee5b9682ae
feat(linter): support read env from eslintrc ( #2130 )
...
## target
resolve #732
## contexts
- globals definition from
https://github.com/sindresorhus/globals/blob/main/globals.json
- port https://github.com/eslint/eslintrc/blob/main/conf/environments.js
to derive environments
2024-01-26 10:43:44 +08:00
Dunqing
e5719e9b4d
feat(transformer/decorators): support transform member decorators ( #2171 )
2024-01-26 10:14:19 +08:00
Boshen
fc1592bc97
refactor(semantic): remove all #[dead_code[ from tester
2024-01-25 20:27:46 +08:00
Boshen
889837704c
feat(semantic): cfg prototype ( #2019 )
...
Co-authored-by: U9G <git@u9g.dev>
2024-01-25 20:19:35 +08:00
underfin
2794064eef
feat(transfrom): transform-json-strings ( #2168 )
...
The pr intends to implement the plugin
`babel-plugin-transform-json-strings`. But here is only mutate
`Directive`, the `StringLiteral` is not implement. It need to changed
the `StringLiteral` printer.
I'm intend to add the raw of `StringLiteral`, it will be mutate at
plugin, and using the `raw` to print `StringLiteral`. If you other
ideas, please let me know.
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-01-25 10:39:02 +00:00
Boshen
8ca1812ad1
Release oxlint and vscode extension v0.2.5
2024-01-25 17:17:59 +08:00
Boshen
7f114d4d98
chore(linter): clean up unused snapshots
2024-01-25 17:01:17 +08:00
Boshen
ed87cbf1f0
chore(linter): remove type info rule consistent-type-exports
2024-01-25 16:56:23 +08:00
Yuji Sugiura
c18619ee4c
fix(linter): use correct rule name ( #2169 )
...
Found by accident but it should be.
- [x] react/jsx-no-comment-text-nodes
- `jsx-no-comment-textnodes` is correct
-
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-no-comment-textnodes.js
- [x] react/no-dangerously-set-inner-html
- `no-danger` is correct
-
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/no-danger.js
- [x] react-perf/no-jsx-as-prop
- Correct name has `jsx-` prefix
-
https://github.com/cvazac/eslint-plugin-react-perf/tree/master/lib/rules
- [x] react-perf/no-new-array-as-prop
- The same as above
- [x] react-perf/no-new-function-as-props
- The same as above
- [x] react-perf/no-new-object-as-prop
- The same as above
- [x] jsx-a11y/tab-index-no-positive
- `tabindex-no-positive` is correct
-
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/rules/tabindex-no-positive.js
- [x] jsx-a11y/role-support-aria-props
- `role-suports-aria-props` is correct
-
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/rules/role-supports-aria-props.js
- - -
+1,
- typescript/consistent-type-exports
- Listed in `disable-type-checked` config == This is type checking rule
but implemented
-
8622286207/packages/eslint-plugin/src/configs/disable-type-checked.ts (L12)
- Should remove it..?
2024-01-25 16:54:52 +08:00
Yuji Sugiura
83a54e0d06
feat(tasks): Add more plugins for tasks/lint_rules2 ( #2167 )
...
Part pf #2020
- [x] jsx-a11y
- [x] react, react-hooks, react-perf
- [x] nextjs
Now, we can track all target plugins(AFAIK)? 🕵🏻
2024-01-25 16:32:26 +08:00
underfin
989ab88bc6
fix(codegen): print Directive original string ( #2157 )
...
> A Use Strict Directive may not contain an EscapeSequence or
LineContinuation.
It is `Use Strict Directive` spec, but the `expression` of `Directive`
isn't original string value, it has error if using it to codegen, so
here using `directive` of `Directive` to codegen and not to escape it.
Here is crashed test cases.
``` js
'use str\
ict';
```
The babel will print the original string, I follow it and avoid using
`print_str` because it will escape string.
I also changed some code using the `expression` of `Directive` to check
`Use Strict Directive` .
2024-01-25 15:24:05 +08:00
cin
ac1d318dc3
feat(linter): eslint-plugin-jest: prefer-called-with ( #2163 )
...
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-called-with.ts )
2024-01-25 14:01:51 +08:00
Yuji Sugiura
80a454630a
feat(tasks): Re-introduce tasks/lint_rules ( #2166 )
...
Part of #2020
2024-01-25 13:14:40 +08:00
Dunqing
51cecbb3ea
refactor(transformer/decorators): align the implementation of all versions ( #2159 )
2024-01-25 13:11:24 +08:00
cin
38914308e7
feat(linter): eslint: no-void ( #2162 )
...
Rule Detail:
[link](https://github.com/eslint/eslint/blob/main/lib/rules/no-void.js )
2024-01-25 12:40:30 +08:00
hjio
a5d7c67982
feat(linter) eslint-plugin-react/jsx-no-target-blank ( #2149 )
...
#1022 try to implement `jsx-no-target-blank`
* code:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-no-target-blank.js
* doc:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
* test:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/tests/lib/rules/jsx-no-target-blank.js
---------
Co-authored-by: huangjunjie.coder <huangjunjie.coder@bytedance.com>
2024-01-25 09:42:05 +08:00
Maurice Nicholson
26022322ff
fix(linter): explicit-length-check inside ternary ( #2165 )
2024-01-25 08:09:35 +08:00
Boshen
3d184d56a8
deps: bump
2024-01-24 15:08:47 +08:00
Boshen
1c44e0a510
deps(website): bump dependencies
2024-01-24 13:04:35 +08:00
Boshen
fb6eeef0a1
deps(vscode): bump deps
2024-01-24 11:25:18 +08:00