Skip to content

Commit 49dd7cd

Browse files
committed
Merge remote-tracking branch 'upstream/main' into linter/issue-20465-vue-js-plugin-ranges
# Conflicts: # crates/oxc_linter/src/context/host.rs # crates/oxc_linter/src/lib.rs # crates/oxc_linter/src/service/runtime.rs
2 parents 4aaab0d + 07afbb6 commit 49dd7cd

1,264 files changed

Lines changed: 103432 additions & 26484 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/migrate-oxlint/SKILL.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,21 @@ After migration, review the generated `.oxlintrc.json`.
4848

4949
The migration tool automatically maps ESLint plugins to oxlint's built-in equivalents. The following table is for reference when reviewing the generated config:
5050

51-
| ESLint Plugin | Oxlint Plugin Name |
52-
| --------------------------------------------------- | ------------------ |
53-
| `@typescript-eslint/eslint-plugin` | `typescript` |
54-
| `eslint-plugin-react` / `eslint-plugin-react-hooks` | `react` |
55-
| `eslint-plugin-import` / `eslint-plugin-import-x` | `import` |
56-
| `eslint-plugin-unicorn` | `unicorn` |
57-
| `eslint-plugin-jsx-a11y` | `jsx-a11y` |
58-
| `eslint-plugin-react-perf` | `react-perf` |
59-
| `eslint-plugin-promise` | `promise` |
60-
| `eslint-plugin-jest` | `jest` |
61-
| `@vitest/eslint-plugin` | `vitest` |
62-
| `eslint-plugin-jsdoc` | `jsdoc` |
63-
| `eslint-plugin-next` | `nextjs` |
64-
| `eslint-plugin-node` | `node` |
65-
| `eslint-plugin-vue` | `vue` |
51+
| ESLint Plugin | Oxlint Plugin Name |
52+
| ----------------------------------------------------- | ------------------ |
53+
| `@typescript-eslint/eslint-plugin` | `typescript` |
54+
| `eslint-plugin-react` / `eslint-plugin-react-hooks` | `react` |
55+
| `eslint-plugin-import` / `eslint-plugin-import-x` | `import` |
56+
| `eslint-plugin-unicorn` | `unicorn` |
57+
| `eslint-plugin-jsx-a11y` / `eslint-plugin-jsx-a11y-x` | `jsx-a11y` |
58+
| `eslint-plugin-react-perf` | `react-perf` |
59+
| `eslint-plugin-promise` | `promise` |
60+
| `eslint-plugin-jest` | `jest` |
61+
| `@vitest/eslint-plugin` | `vitest` |
62+
| `eslint-plugin-jsdoc` | `jsdoc` |
63+
| `eslint-plugin-next` | `nextjs` |
64+
| `eslint-plugin-node` | `node` |
65+
| `eslint-plugin-vue` | `vue` |
6666

6767
Default plugins (enabled when `plugins` field is omitted): `unicorn`, `typescript`, `oxc`.
6868
Setting the `plugins` array explicitly overrides these defaults.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: performance-lint-rules
3+
description: Tips for writing performant Oxc linter rules. Use only when editing Rust rule implementations under crates/oxc_linter/src/rules/.
4+
---
5+
6+
This skill gives performance guidance for Oxc linter rule implementations.
7+
8+
## Scope
9+
10+
Use this skill **only** for Rust code under `crates/oxc_linter/src/rules/`.
11+
12+
Do not use this skill for linter infrastructure, parser code, semantic analysis, formatter code, tests outside the rules directory, or unrelated crates.
13+
14+
## Performance Guidelines
15+
16+
### Prefer top-level node kind checks
17+
18+
Put node kind checks at the top level of the rule when possible. Rule runner implementations generated by lintgen can recognize implemented node types, which helps avoid invoking rules on unrelated AST nodes.
19+
20+
### Do cheaper checks first
21+
22+
Order checks from cheapest and most selective to most expensive. Simple equality checks, early returns, and fast paths such as ASCII-only checks should come before semantic lookups, allocations, or deeper AST traversal.
23+
24+
Most rules trigger on only a small set of nodes, so quickly return for the common non-matching cases.
25+
26+
### Optimize for success
27+
28+
Most files do not contain lint errors. Avoid preparing diagnostics, labels, help text, fix data, or other extra context until the rule knows it needs to report an issue.
29+
30+
### Iterate over the smallest set possible
31+
32+
Avoid walking more syntax than necessary.
33+
34+
- Use `run_once` when the rule only needs a whole-file pass and does not need to run on every node.
35+
- Iterate over symbols instead of AST nodes when looking for references to specific names.
36+
- Prefer targeted lists or semantic data over broad AST traversal when available.
37+
38+
### Avoid unnecessary regular expressions
39+
40+
Do not construct regular expressions internally when byte or string checks are enough. Prefer simple operations such as checking whether a string contains a character, starts with a prefix, ends with a suffix, or matches a small fixed set of values.
41+
42+
### Avoid heap allocations
43+
44+
Minimize allocations in hot lint paths.
45+
46+
- Use copy-on-write utilities when a value usually does not need to change.
47+
- Avoid intermediate `Vec`s and `String`s when iteration or borrowed data is enough.
48+
- Keep temporary data on the stack when practical.
49+
- Delay allocation until a diagnostic, fix, or transformed value is actually needed.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"features": {
99
"ghcr.io/devcontainers/features/sshd:1": {},
10-
"ghcr.io/devcontainers/features/node:1": {},
10+
"ghcr.io/devcontainers/features/node:2": {},
1111
"ghcr.io/devcontainers/features/github-cli:1": {
1212
"version": "latest"
1313
},

.github/scripts/clone-parallel.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import { dirname, join } from "node:path";
1111

1212
// Submodule commit SHAs - updated automatically by .github/workflows/update_submodules.yml
1313
// NOTE: Prettier version is now pinned to `v3.8.2` (not updated by workflow above), Update manually as needed
14-
const TEST262_SHA = "2b2ecead6e828dd9af13a9ec72065e645724a50f";
15-
const BABEL_SHA = "c543b03170260d02138857dc09877d0af71a7931";
16-
const TYPESCRIPT_SHA = "c7a0ae102dfb030c534a7bc31fbbd61a707dc9cf";
14+
const TEST262_SHA = "78fc3f8efe12632ee0344048dff219c078861c1c";
15+
const BABEL_SHA = "3d34928e9124e11bf74fa6e522e697059248283d";
16+
const TYPESCRIPT_SHA = "f350b52331494b68c90ab02e2b6d0828d2a22a74";
1717
const PRETTIER_SHA = "d7108a79ec745c04292aabf22c4c1adbd690b191";
18-
const ESTREE_CONFORMANCE_SHA = "e4104a13904df535b4571c6d1308bea0974ee860";
18+
const ESTREE_CONFORMANCE_SHA = "576e7d82f35682a6879673092653aab8f9b3f96d";
1919
const NODE_COMPAT_TABLE_SHA = "499beb6f1daa36f10c26b85a7f3ec3b3448ded23";
2020

2121
const repoRoot = join(import.meta.dirname, "..", "..");

.github/workflows/autofix.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ jobs:
1818
steps:
1919
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
2020

21-
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
21+
- uses: oxc-project/setup-node@ab97f03642370d79a7e96dd286bd02a1be40e0ba # v1.3.0
2222

2323
- uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
2424
with:
2525
restore-cache: true
2626
cache-key: warm
27-
tools: just,cargo-shear@1.11.2
27+
tools: just,cargo-shear@1.12.4
2828
components: rustfmt
2929

3030
- name: cargo-shear
3131
id: shear
3232
shell: bash
3333
run: |
34-
if ! cargo shear --fix; then
34+
if ! cargo shear --fix --check-test-targets --deny-warnings --format=github; then
3535
echo "shear=true" >> $GITHUB_OUTPUT
3636
fi
3737

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
rm target/codspeed/analysis/oxc_benchmark/*.d
9393
9494
- name: Run benchmark
95-
uses: CodSpeedHQ/action@658a901452bb54c799643e060733b7afe9121b8d # v4.14.0
95+
uses: CodSpeedHQ/action@3194d9a39c4d46684cb44bf7207fc56626aad8fd # v4.15.1
9696
timeout-minutes: 30
9797
with:
9898
mode: simulation

.github/workflows/cargo_llvm_lines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
2323

2424
- name: Install cargo-llvm-lines
25-
uses: taiki-e/install-action@cf525cb33f51aca27cd6fa02034117ab963ff9f1 # v2.75.22
25+
uses: taiki-e/install-action@65851e10cd6c377f11a60e600abc07cb08643468 # v2.79.3
2626
with:
2727
tool: cargo-llvm-lines
2828

0 commit comments

Comments
 (0)