Skip to content

Commit 2eb8b0d

Browse files
committed
feat: add oxlint
1 parent 1f98a9c commit 2eb8b0d

File tree

3 files changed

+235
-0
lines changed

3 files changed

+235
-0
lines changed

.oxlintrc.json

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": [],
4+
"categories": {
5+
"correctness": "off"
6+
},
7+
"env": {
8+
"builtin": true
9+
},
10+
"ignorePatterns": [
11+
"**/dist/",
12+
"**/temp/",
13+
"**/coverage/",
14+
".idea/",
15+
"explorations/",
16+
"dts-build/packages"
17+
],
18+
"overrides": [
19+
{
20+
"files": ["**/*.js", "**/*.ts", "**/*.tsx"],
21+
"rules": {
22+
"no-debugger": "error",
23+
"no-console": [
24+
"error",
25+
{
26+
"allow": ["warn", "error", "info"]
27+
}
28+
],
29+
"no-restricted-globals": [
30+
"error",
31+
"window",
32+
"document",
33+
"module",
34+
"require"
35+
],
36+
"oxc/no-const-enum": "error",
37+
"oxc/no-rest-spread-properties": "error",
38+
"oxc/no-async-await": "error",
39+
"oxc/no-optional-chaining": "error",
40+
"sort-imports": [
41+
"error",
42+
{
43+
"ignoreDeclarationSort": true
44+
}
45+
],
46+
"unicorn/prefer-node-protocol": "error",
47+
"@typescript-eslint/prefer-ts-expect-error": "error",
48+
"@typescript-eslint/consistent-type-imports": [
49+
"error",
50+
{
51+
"fixStyle": "inline-type-imports",
52+
"disallowTypeAnnotations": false
53+
}
54+
],
55+
"@typescript-eslint/no-import-type-side-effects": "error"
56+
},
57+
"plugins": ["typescript"]
58+
},
59+
{
60+
"files": [
61+
"**/__tests__/**",
62+
"packages-private/dts-test/**",
63+
"packages-private/dts-build-test/**"
64+
],
65+
"rules": {
66+
"no-console": "off",
67+
"no-restricted-globals": "off",
68+
"vitest/no-disabled-tests": "error",
69+
"vitest/no-focused-tests": "error"
70+
},
71+
"globals": {
72+
"suite": "writeable",
73+
"test": "writeable",
74+
"describe": "writeable",
75+
"it": "writeable",
76+
"expectTypeOf": "writeable",
77+
"assertType": "writeable",
78+
"expect": "writeable",
79+
"assert": "writeable",
80+
"chai": "writeable",
81+
"vitest": "writeable",
82+
"vi": "writeable",
83+
"beforeAll": "writeable",
84+
"afterAll": "writeable",
85+
"beforeEach": "writeable",
86+
"afterEach": "writeable",
87+
"onTestFailed": "writeable",
88+
"onTestFinished": "writeable"
89+
},
90+
"plugins": ["vitest"]
91+
},
92+
{
93+
"files": ["packages/shared/**", "eslint.config.js"],
94+
"rules": {
95+
"no-restricted-globals": "off"
96+
}
97+
},
98+
{
99+
"files": ["packages/{vue,vue-compat,runtime-dom}/**"],
100+
"rules": {
101+
"no-restricted-globals": ["error", "module", "require"]
102+
}
103+
},
104+
{
105+
"files": ["packages/{compiler-sfc,compiler-ssr,server-renderer}/**"],
106+
"rules": {
107+
"no-restricted-globals": ["error", "window", "document"],
108+
"oxc/no-const-enum": "error"
109+
}
110+
},
111+
{
112+
"files": [
113+
"packages-private/template-explorer/**",
114+
"packages-private/sfc-playground/**"
115+
],
116+
"rules": {
117+
"no-restricted-globals": ["error", "module", "require"],
118+
"oxc/no-const-enum": "error",
119+
"no-console": "off"
120+
}
121+
},
122+
{
123+
"files": ["*.js"],
124+
"rules": {
125+
"no-unused-vars": [
126+
"error",
127+
{
128+
"vars": "all",
129+
"args": "none"
130+
}
131+
]
132+
}
133+
},
134+
{
135+
"files": [
136+
"eslint.config.js",
137+
"rollup*.config.js",
138+
"scripts/**",
139+
"./*.{js,ts}",
140+
"packages/*/*.js",
141+
"packages/vue/*/*.js"
142+
],
143+
"rules": {
144+
"no-restricted-globals": "off",
145+
"oxc/no-const-enum": "error",
146+
"no-console": "off"
147+
}
148+
}
149+
]
150+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"size-esm": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler",
1515
"check": "tsc --incremental --noEmit",
1616
"lint": "eslint --cache .",
17+
"lint:ox": "oxlint",
1718
"format": "prettier --write --cache .",
1819
"format-check": "prettier --check --cache .",
1920
"test": "vitest",
@@ -91,6 +92,7 @@
9192
"markdown-table": "^3.0.4",
9293
"marked": "13.0.3",
9394
"npm-run-all2": "^7.0.2",
95+
"oxlint": "^0.16.10",
9496
"picocolors": "^1.1.1",
9597
"prettier": "^3.5.3",
9698
"pretty-bytes": "^6.1.1",

pnpm-lock.yaml

Lines changed: 83 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)