oxlint 1.66.0 → 1.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configuration_schema.json +64 -1
- package/dist/bindings.js +32 -30
- package/dist/index.d.ts +29 -1
- package/dist/js_config.js +44 -26
- package/dist/lint.js +11 -3
- package/package.json +25 -21
|
@@ -649,6 +649,9 @@
|
|
|
649
649
|
"jsdoc/require-yields": {
|
|
650
650
|
"$ref": "#/definitions/DummyRule"
|
|
651
651
|
},
|
|
652
|
+
"jsdoc/require-yields-description": {
|
|
653
|
+
"$ref": "#/definitions/DummyRule"
|
|
654
|
+
},
|
|
652
655
|
"jsdoc/require-yields-type": {
|
|
653
656
|
"$ref": "#/definitions/DummyRule"
|
|
654
657
|
},
|
|
@@ -1219,6 +1222,9 @@
|
|
|
1219
1222
|
"no-with": {
|
|
1220
1223
|
"$ref": "#/definitions/DummyRule"
|
|
1221
1224
|
},
|
|
1225
|
+
"node/callback-return": {
|
|
1226
|
+
"$ref": "#/definitions/DummyRule"
|
|
1227
|
+
},
|
|
1222
1228
|
"node/global-require": {
|
|
1223
1229
|
"$ref": "#/definitions/DummyRule"
|
|
1224
1230
|
},
|
|
@@ -1333,6 +1339,9 @@
|
|
|
1333
1339
|
"prefer-exponentiation-operator": {
|
|
1334
1340
|
"$ref": "#/definitions/DummyRule"
|
|
1335
1341
|
},
|
|
1342
|
+
"prefer-named-capture-group": {
|
|
1343
|
+
"$ref": "#/definitions/DummyRule"
|
|
1344
|
+
},
|
|
1336
1345
|
"prefer-numeric-literals": {
|
|
1337
1346
|
"$ref": "#/definitions/DummyRule"
|
|
1338
1347
|
},
|
|
@@ -1681,6 +1690,9 @@
|
|
|
1681
1690
|
"typescript/explicit-module-boundary-types": {
|
|
1682
1691
|
"$ref": "#/definitions/DummyRule"
|
|
1683
1692
|
},
|
|
1693
|
+
"typescript/method-signature-style": {
|
|
1694
|
+
"$ref": "#/definitions/DummyRule"
|
|
1695
|
+
},
|
|
1684
1696
|
"typescript/no-array-delete": {
|
|
1685
1697
|
"$ref": "#/definitions/DummyRule"
|
|
1686
1698
|
},
|
|
@@ -1996,6 +2008,9 @@
|
|
|
1996
2008
|
"unicorn/filename-case": {
|
|
1997
2009
|
"$ref": "#/definitions/DummyRule"
|
|
1998
2010
|
},
|
|
2011
|
+
"unicorn/import-style": {
|
|
2012
|
+
"$ref": "#/definitions/DummyRule"
|
|
2013
|
+
},
|
|
1999
2014
|
"unicorn/new-for-builtins": {
|
|
2000
2015
|
"$ref": "#/definitions/DummyRule"
|
|
2001
2016
|
},
|
|
@@ -2572,6 +2587,9 @@
|
|
|
2572
2587
|
"vitest/warn-todo": {
|
|
2573
2588
|
"$ref": "#/definitions/DummyRule"
|
|
2574
2589
|
},
|
|
2590
|
+
"vue/component-definition-name-casing": {
|
|
2591
|
+
"$ref": "#/definitions/DummyRule"
|
|
2592
|
+
},
|
|
2575
2593
|
"vue/define-emits-declaration": {
|
|
2576
2594
|
"$ref": "#/definitions/DummyRule"
|
|
2577
2595
|
},
|
|
@@ -2587,6 +2605,9 @@
|
|
|
2587
2605
|
"vue/no-arrow-functions-in-watch": {
|
|
2588
2606
|
"$ref": "#/definitions/DummyRule"
|
|
2589
2607
|
},
|
|
2608
|
+
"vue/no-computed-properties-in-data": {
|
|
2609
|
+
"$ref": "#/definitions/DummyRule"
|
|
2610
|
+
},
|
|
2590
2611
|
"vue/no-deprecated-data-object-declaration": {
|
|
2591
2612
|
"$ref": "#/definitions/DummyRule"
|
|
2592
2613
|
},
|
|
@@ -2602,12 +2623,18 @@
|
|
|
2602
2623
|
"vue/no-deprecated-model-definition": {
|
|
2603
2624
|
"$ref": "#/definitions/DummyRule"
|
|
2604
2625
|
},
|
|
2626
|
+
"vue/no-deprecated-props-default-this": {
|
|
2627
|
+
"$ref": "#/definitions/DummyRule"
|
|
2628
|
+
},
|
|
2605
2629
|
"vue/no-deprecated-vue-config-keycodes": {
|
|
2606
2630
|
"$ref": "#/definitions/DummyRule"
|
|
2607
2631
|
},
|
|
2608
2632
|
"vue/no-export-in-script-setup": {
|
|
2609
2633
|
"$ref": "#/definitions/DummyRule"
|
|
2610
2634
|
},
|
|
2635
|
+
"vue/no-expose-after-await": {
|
|
2636
|
+
"$ref": "#/definitions/DummyRule"
|
|
2637
|
+
},
|
|
2611
2638
|
"vue/no-import-compiler-macros": {
|
|
2612
2639
|
"$ref": "#/definitions/DummyRule"
|
|
2613
2640
|
},
|
|
@@ -2620,27 +2647,54 @@
|
|
|
2620
2647
|
"vue/no-required-prop-with-default": {
|
|
2621
2648
|
"$ref": "#/definitions/DummyRule"
|
|
2622
2649
|
},
|
|
2650
|
+
"vue/no-reserved-component-names": {
|
|
2651
|
+
"$ref": "#/definitions/DummyRule"
|
|
2652
|
+
},
|
|
2653
|
+
"vue/no-shared-component-data": {
|
|
2654
|
+
"$ref": "#/definitions/DummyRule"
|
|
2655
|
+
},
|
|
2623
2656
|
"vue/no-this-in-before-route-enter": {
|
|
2624
2657
|
"$ref": "#/definitions/DummyRule"
|
|
2625
2658
|
},
|
|
2659
|
+
"vue/no-watch-after-await": {
|
|
2660
|
+
"$ref": "#/definitions/DummyRule"
|
|
2661
|
+
},
|
|
2626
2662
|
"vue/prefer-import-from-vue": {
|
|
2627
2663
|
"$ref": "#/definitions/DummyRule"
|
|
2628
2664
|
},
|
|
2629
2665
|
"vue/require-default-export": {
|
|
2630
2666
|
"$ref": "#/definitions/DummyRule"
|
|
2631
2667
|
},
|
|
2668
|
+
"vue/require-prop-type-constructor": {
|
|
2669
|
+
"$ref": "#/definitions/DummyRule"
|
|
2670
|
+
},
|
|
2671
|
+
"vue/require-render-return": {
|
|
2672
|
+
"$ref": "#/definitions/DummyRule"
|
|
2673
|
+
},
|
|
2674
|
+
"vue/require-slots-as-functions": {
|
|
2675
|
+
"$ref": "#/definitions/DummyRule"
|
|
2676
|
+
},
|
|
2632
2677
|
"vue/require-typed-ref": {
|
|
2633
2678
|
"$ref": "#/definitions/DummyRule"
|
|
2634
2679
|
},
|
|
2635
2680
|
"vue/return-in-computed-property": {
|
|
2636
2681
|
"$ref": "#/definitions/DummyRule"
|
|
2637
2682
|
},
|
|
2683
|
+
"vue/return-in-emits-validator": {
|
|
2684
|
+
"$ref": "#/definitions/DummyRule"
|
|
2685
|
+
},
|
|
2638
2686
|
"vue/valid-define-emits": {
|
|
2639
2687
|
"$ref": "#/definitions/DummyRule"
|
|
2640
2688
|
},
|
|
2689
|
+
"vue/valid-define-options": {
|
|
2690
|
+
"$ref": "#/definitions/DummyRule"
|
|
2691
|
+
},
|
|
2641
2692
|
"vue/valid-define-props": {
|
|
2642
2693
|
"$ref": "#/definitions/DummyRule"
|
|
2643
2694
|
},
|
|
2695
|
+
"vue/valid-next-tick": {
|
|
2696
|
+
"$ref": "#/definitions/DummyRule"
|
|
2697
|
+
},
|
|
2644
2698
|
"yoda": {
|
|
2645
2699
|
"$ref": "#/definitions/DummyRule"
|
|
2646
2700
|
}
|
|
@@ -2983,6 +3037,15 @@
|
|
|
2983
3037
|
],
|
|
2984
3038
|
"markdownDescription": "Environments enable and disable collections of global variables."
|
|
2985
3039
|
},
|
|
3040
|
+
"excludeFiles": {
|
|
3041
|
+
"description": "A list of glob patterns to exclude from this override.\n\nFiles matching these patterns are not globally ignored; this override\nsimply does not apply to them.\n\n## Example\n`[ \"*.generated.ts\", \"fixtures/**\" ]`",
|
|
3042
|
+
"allOf": [
|
|
3043
|
+
{
|
|
3044
|
+
"$ref": "#/definitions/GlobSet"
|
|
3045
|
+
}
|
|
3046
|
+
],
|
|
3047
|
+
"markdownDescription": "A list of glob patterns to exclude from this override.\n\nFiles matching these patterns are not globally ignored; this override\nsimply does not apply to them.\n\n## Example\n`[ \"*.generated.ts\", \"fixtures/**\" ]`"
|
|
3048
|
+
},
|
|
2986
3049
|
"files": {
|
|
2987
3050
|
"description": "A list of glob patterns to override.\n\n## Example\n`[ \"*.test.ts\", \"*.spec.ts\" ]`",
|
|
2988
3051
|
"allOf": [
|
|
@@ -3219,4 +3282,4 @@
|
|
|
3219
3282
|
}
|
|
3220
3283
|
},
|
|
3221
3284
|
"markdownDescription": "Oxlint Configuration File\n\nThis configuration is aligned with ESLint v8's configuration schema (`eslintrc.json`).\n\nUsage: `oxlint -c oxlintrc.json`\n\nExample\n\n`.oxlintrc.json`\n\n```json\n{\n\"$schema\": \"./node_modules/oxlint/configuration_schema.json\",\n\"plugins\": [\"import\", \"typescript\", \"unicorn\"],\n\"env\": {\n\"browser\": true\n},\n\"globals\": {\n\"foo\": \"readonly\"\n},\n\"settings\": {\n\"react\": {\n\"version\": \"18.2.0\"\n},\n\"custom\": { \"option\": true }\n},\n\"rules\": {\n\"eqeqeq\": \"warn\",\n\"import/no-cycle\": \"error\",\n\"react/self-closing-comp\": [\"error\", { \"html\": false }]\n},\n\"overrides\": [\n{\n\"files\": [\"*.test.ts\", \"*.spec.ts\"],\n\"rules\": {\n\"@typescript-eslint/no-explicit-any\": \"off\"\n}\n}\n]\n}\n```\n\n`oxlint.config.ts`\n\n```ts\nimport { defineConfig } from \"oxlint\";\n\nexport default defineConfig({\nplugins: [\"import\", \"typescript\", \"unicorn\"],\nenv: {\n\"browser\": true\n},\nglobals: {\n\"foo\": \"readonly\"\n},\nsettings: {\nreact: {\nversion: \"18.2.0\"\n},\ncustom: { option: true }\n},\nrules: {\n\"eqeqeq\": \"warn\",\n\"import/no-cycle\": \"error\",\n\"react/self-closing-comp\": [\"error\", { \"html\": false }]\n},\noverrides: [\n{\nfiles: [\"*.test.ts\", \"*.spec.ts\"],\nrules: {\n\"@typescript-eslint/no-explicit-any\": \"off\"\n}\n}\n]\n});\n```"
|
|
3222
|
-
}
|
|
3285
|
+
}
|
package/dist/bindings.js
CHANGED
|
@@ -38,7 +38,7 @@ function requireNative() {
|
|
|
38
38
|
}
|
|
39
39
|
try {
|
|
40
40
|
let binding = require("@oxlint/binding-android-arm64"), bindingPackageVersion = require("@oxlint/binding-android-arm64/package.json").version;
|
|
41
|
-
if (bindingPackageVersion !== "1.
|
|
41
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
42
42
|
return binding;
|
|
43
43
|
} catch (e) {
|
|
44
44
|
loadErrors.push(e);
|
|
@@ -51,7 +51,7 @@ function requireNative() {
|
|
|
51
51
|
}
|
|
52
52
|
try {
|
|
53
53
|
let binding = require("@oxlint/binding-android-arm-eabi"), bindingPackageVersion = require("@oxlint/binding-android-arm-eabi/package.json").version;
|
|
54
|
-
if (bindingPackageVersion !== "1.
|
|
54
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
55
55
|
return binding;
|
|
56
56
|
} catch (e) {
|
|
57
57
|
loadErrors.push(e);
|
|
@@ -65,7 +65,7 @@ function requireNative() {
|
|
|
65
65
|
}
|
|
66
66
|
try {
|
|
67
67
|
let binding = require("@oxlint/binding-win32-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-win32-x64-gnu/package.json").version;
|
|
68
|
-
if (bindingPackageVersion !== "1.
|
|
68
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
69
69
|
return binding;
|
|
70
70
|
} catch (e) {
|
|
71
71
|
loadErrors.push(e);
|
|
@@ -78,7 +78,7 @@ function requireNative() {
|
|
|
78
78
|
}
|
|
79
79
|
try {
|
|
80
80
|
let binding = require("@oxlint/binding-win32-x64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-x64-msvc/package.json").version;
|
|
81
|
-
if (bindingPackageVersion !== "1.
|
|
81
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
82
82
|
return binding;
|
|
83
83
|
} catch (e) {
|
|
84
84
|
loadErrors.push(e);
|
|
@@ -92,7 +92,7 @@ function requireNative() {
|
|
|
92
92
|
}
|
|
93
93
|
try {
|
|
94
94
|
let binding = require("@oxlint/binding-win32-ia32-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-ia32-msvc/package.json").version;
|
|
95
|
-
if (bindingPackageVersion !== "1.
|
|
95
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
96
96
|
return binding;
|
|
97
97
|
} catch (e) {
|
|
98
98
|
loadErrors.push(e);
|
|
@@ -105,7 +105,7 @@ function requireNative() {
|
|
|
105
105
|
}
|
|
106
106
|
try {
|
|
107
107
|
let binding = require("@oxlint/binding-win32-arm64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-arm64-msvc/package.json").version;
|
|
108
|
-
if (bindingPackageVersion !== "1.
|
|
108
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
109
109
|
return binding;
|
|
110
110
|
} catch (e) {
|
|
111
111
|
loadErrors.push(e);
|
|
@@ -119,7 +119,7 @@ function requireNative() {
|
|
|
119
119
|
}
|
|
120
120
|
try {
|
|
121
121
|
let binding = require("@oxlint/binding-darwin-universal"), bindingPackageVersion = require("@oxlint/binding-darwin-universal/package.json").version;
|
|
122
|
-
if (bindingPackageVersion !== "1.
|
|
122
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
123
123
|
return binding;
|
|
124
124
|
} catch (e) {
|
|
125
125
|
loadErrors.push(e);
|
|
@@ -132,7 +132,7 @@ function requireNative() {
|
|
|
132
132
|
}
|
|
133
133
|
try {
|
|
134
134
|
let binding = require("@oxlint/binding-darwin-x64"), bindingPackageVersion = require("@oxlint/binding-darwin-x64/package.json").version;
|
|
135
|
-
if (bindingPackageVersion !== "1.
|
|
135
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
136
136
|
return binding;
|
|
137
137
|
} catch (e) {
|
|
138
138
|
loadErrors.push(e);
|
|
@@ -145,7 +145,7 @@ function requireNative() {
|
|
|
145
145
|
}
|
|
146
146
|
try {
|
|
147
147
|
let binding = require("@oxlint/binding-darwin-arm64"), bindingPackageVersion = require("@oxlint/binding-darwin-arm64/package.json").version;
|
|
148
|
-
if (bindingPackageVersion !== "1.
|
|
148
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
149
149
|
return binding;
|
|
150
150
|
} catch (e) {
|
|
151
151
|
loadErrors.push(e);
|
|
@@ -159,7 +159,7 @@ function requireNative() {
|
|
|
159
159
|
}
|
|
160
160
|
try {
|
|
161
161
|
let binding = require("@oxlint/binding-freebsd-x64"), bindingPackageVersion = require("@oxlint/binding-freebsd-x64/package.json").version;
|
|
162
|
-
if (bindingPackageVersion !== "1.
|
|
162
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
163
163
|
return binding;
|
|
164
164
|
} catch (e) {
|
|
165
165
|
loadErrors.push(e);
|
|
@@ -172,7 +172,7 @@ function requireNative() {
|
|
|
172
172
|
}
|
|
173
173
|
try {
|
|
174
174
|
let binding = require("@oxlint/binding-freebsd-arm64"), bindingPackageVersion = require("@oxlint/binding-freebsd-arm64/package.json").version;
|
|
175
|
-
if (bindingPackageVersion !== "1.
|
|
175
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
176
176
|
return binding;
|
|
177
177
|
} catch (e) {
|
|
178
178
|
loadErrors.push(e);
|
|
@@ -186,7 +186,7 @@ function requireNative() {
|
|
|
186
186
|
}
|
|
187
187
|
try {
|
|
188
188
|
let binding = require("@oxlint/binding-linux-x64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-x64-musl/package.json").version;
|
|
189
|
-
if (bindingPackageVersion !== "1.
|
|
189
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
190
190
|
return binding;
|
|
191
191
|
} catch (e) {
|
|
192
192
|
loadErrors.push(e);
|
|
@@ -199,7 +199,7 @@ function requireNative() {
|
|
|
199
199
|
}
|
|
200
200
|
try {
|
|
201
201
|
let binding = require("@oxlint/binding-linux-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-x64-gnu/package.json").version;
|
|
202
|
-
if (bindingPackageVersion !== "1.
|
|
202
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
203
203
|
return binding;
|
|
204
204
|
} catch (e) {
|
|
205
205
|
loadErrors.push(e);
|
|
@@ -213,7 +213,7 @@ function requireNative() {
|
|
|
213
213
|
}
|
|
214
214
|
try {
|
|
215
215
|
let binding = require("@oxlint/binding-linux-arm64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-musl/package.json").version;
|
|
216
|
-
if (bindingPackageVersion !== "1.
|
|
216
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
217
217
|
return binding;
|
|
218
218
|
} catch (e) {
|
|
219
219
|
loadErrors.push(e);
|
|
@@ -226,7 +226,7 @@ function requireNative() {
|
|
|
226
226
|
}
|
|
227
227
|
try {
|
|
228
228
|
let binding = require("@oxlint/binding-linux-arm64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-gnu/package.json").version;
|
|
229
|
-
if (bindingPackageVersion !== "1.
|
|
229
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
230
230
|
return binding;
|
|
231
231
|
} catch (e) {
|
|
232
232
|
loadErrors.push(e);
|
|
@@ -240,7 +240,7 @@ function requireNative() {
|
|
|
240
240
|
}
|
|
241
241
|
try {
|
|
242
242
|
let binding = require("@oxlint/binding-linux-arm-musleabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-musleabihf/package.json").version;
|
|
243
|
-
if (bindingPackageVersion !== "1.
|
|
243
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
244
244
|
return binding;
|
|
245
245
|
} catch (e) {
|
|
246
246
|
loadErrors.push(e);
|
|
@@ -253,7 +253,7 @@ function requireNative() {
|
|
|
253
253
|
}
|
|
254
254
|
try {
|
|
255
255
|
let binding = require("@oxlint/binding-linux-arm-gnueabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-gnueabihf/package.json").version;
|
|
256
|
-
if (bindingPackageVersion !== "1.
|
|
256
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
257
257
|
return binding;
|
|
258
258
|
} catch (e) {
|
|
259
259
|
loadErrors.push(e);
|
|
@@ -267,7 +267,7 @@ function requireNative() {
|
|
|
267
267
|
}
|
|
268
268
|
try {
|
|
269
269
|
let binding = require("@oxlint/binding-linux-loong64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-musl/package.json").version;
|
|
270
|
-
if (bindingPackageVersion !== "1.
|
|
270
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
271
271
|
return binding;
|
|
272
272
|
} catch (e) {
|
|
273
273
|
loadErrors.push(e);
|
|
@@ -280,7 +280,7 @@ function requireNative() {
|
|
|
280
280
|
}
|
|
281
281
|
try {
|
|
282
282
|
let binding = require("@oxlint/binding-linux-loong64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-gnu/package.json").version;
|
|
283
|
-
if (bindingPackageVersion !== "1.
|
|
283
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
284
284
|
return binding;
|
|
285
285
|
} catch (e) {
|
|
286
286
|
loadErrors.push(e);
|
|
@@ -294,7 +294,7 @@ function requireNative() {
|
|
|
294
294
|
}
|
|
295
295
|
try {
|
|
296
296
|
let binding = require("@oxlint/binding-linux-riscv64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-musl/package.json").version;
|
|
297
|
-
if (bindingPackageVersion !== "1.
|
|
297
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
298
298
|
return binding;
|
|
299
299
|
} catch (e) {
|
|
300
300
|
loadErrors.push(e);
|
|
@@ -307,7 +307,7 @@ function requireNative() {
|
|
|
307
307
|
}
|
|
308
308
|
try {
|
|
309
309
|
let binding = require("@oxlint/binding-linux-riscv64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-gnu/package.json").version;
|
|
310
|
-
if (bindingPackageVersion !== "1.
|
|
310
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
311
311
|
return binding;
|
|
312
312
|
} catch (e) {
|
|
313
313
|
loadErrors.push(e);
|
|
@@ -321,7 +321,7 @@ function requireNative() {
|
|
|
321
321
|
}
|
|
322
322
|
try {
|
|
323
323
|
let binding = require("@oxlint/binding-linux-ppc64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-ppc64-gnu/package.json").version;
|
|
324
|
-
if (bindingPackageVersion !== "1.
|
|
324
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
325
325
|
return binding;
|
|
326
326
|
} catch (e) {
|
|
327
327
|
loadErrors.push(e);
|
|
@@ -334,7 +334,7 @@ function requireNative() {
|
|
|
334
334
|
}
|
|
335
335
|
try {
|
|
336
336
|
let binding = require("@oxlint/binding-linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-s390x-gnu/package.json").version;
|
|
337
|
-
if (bindingPackageVersion !== "1.
|
|
337
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
338
338
|
return binding;
|
|
339
339
|
} catch (e) {
|
|
340
340
|
loadErrors.push(e);
|
|
@@ -348,7 +348,7 @@ function requireNative() {
|
|
|
348
348
|
}
|
|
349
349
|
try {
|
|
350
350
|
let binding = require("@oxlint/binding-openharmony-arm64"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm64/package.json").version;
|
|
351
|
-
if (bindingPackageVersion !== "1.
|
|
351
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
352
352
|
return binding;
|
|
353
353
|
} catch (e) {
|
|
354
354
|
loadErrors.push(e);
|
|
@@ -361,7 +361,7 @@ function requireNative() {
|
|
|
361
361
|
}
|
|
362
362
|
try {
|
|
363
363
|
let binding = require("@oxlint/binding-openharmony-x64"), bindingPackageVersion = require("@oxlint/binding-openharmony-x64/package.json").version;
|
|
364
|
-
if (bindingPackageVersion !== "1.
|
|
364
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
365
365
|
return binding;
|
|
366
366
|
} catch (e) {
|
|
367
367
|
loadErrors.push(e);
|
|
@@ -374,7 +374,7 @@ function requireNative() {
|
|
|
374
374
|
}
|
|
375
375
|
try {
|
|
376
376
|
let binding = require("@oxlint/binding-openharmony-arm"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm/package.json").version;
|
|
377
|
-
if (bindingPackageVersion !== "1.
|
|
377
|
+
if (bindingPackageVersion !== "1.68.0" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw Error(`Native binding package version mismatch, expected 1.68.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
378
378
|
return binding;
|
|
379
379
|
} catch (e) {
|
|
380
380
|
loadErrors.push(e);
|
|
@@ -382,17 +382,19 @@ function requireNative() {
|
|
|
382
382
|
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
383
383
|
else loadErrors.push(/* @__PURE__ */ Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
384
384
|
}
|
|
385
|
-
|
|
385
|
+
nativeBinding = requireNative();
|
|
386
|
+
const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || process.env.NAPI_RS_FORCE_WASI === "error";
|
|
387
|
+
if (!nativeBinding || forceWasi) {
|
|
386
388
|
let wasiBinding = null, wasiBindingError = null;
|
|
387
389
|
try {
|
|
388
390
|
wasiBinding = require("./oxlint.wasi.cjs"), nativeBinding = wasiBinding;
|
|
389
391
|
} catch (err) {
|
|
390
|
-
|
|
392
|
+
forceWasi && (wasiBindingError = err);
|
|
391
393
|
}
|
|
392
|
-
if (!nativeBinding ||
|
|
394
|
+
if (!nativeBinding || forceWasi) try {
|
|
393
395
|
wasiBinding = require("@oxlint/binding-wasm32-wasi"), nativeBinding = wasiBinding;
|
|
394
396
|
} catch (err) {
|
|
395
|
-
|
|
397
|
+
forceWasi && (wasiBindingError ? wasiBindingError.cause = err : wasiBindingError = err, loadErrors.push(err));
|
|
396
398
|
}
|
|
397
399
|
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
|
|
398
400
|
let error = /* @__PURE__ */ Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
package/dist/index.d.ts
CHANGED
|
@@ -450,6 +450,16 @@ interface OxlintOverride {
|
|
|
450
450
|
* Environments enable and disable collections of global variables.
|
|
451
451
|
*/
|
|
452
452
|
env?: OxlintEnv;
|
|
453
|
+
/**
|
|
454
|
+
* A list of glob patterns to exclude from this override.
|
|
455
|
+
*
|
|
456
|
+
* Files matching these patterns are not globally ignored; this override
|
|
457
|
+
* simply does not apply to them.
|
|
458
|
+
*
|
|
459
|
+
* ## Example
|
|
460
|
+
* `[ "*.generated.ts", "fixtures/**" ]`
|
|
461
|
+
*/
|
|
462
|
+
excludeFiles?: GlobSet;
|
|
453
463
|
/**
|
|
454
464
|
* A list of glob patterns to override.
|
|
455
465
|
*
|
|
@@ -617,6 +627,7 @@ interface DummyRuleMap {
|
|
|
617
627
|
"jsdoc/require-throws-description"?: DummyRule;
|
|
618
628
|
"jsdoc/require-throws-type"?: DummyRule;
|
|
619
629
|
"jsdoc/require-yields"?: DummyRule;
|
|
630
|
+
"jsdoc/require-yields-description"?: DummyRule;
|
|
620
631
|
"jsdoc/require-yields-type"?: DummyRule;
|
|
621
632
|
"jsx-a11y/alt-text"?: DummyRule;
|
|
622
633
|
"jsx-a11y/anchor-ambiguous-text"?: DummyRule;
|
|
@@ -807,6 +818,7 @@ interface DummyRuleMap {
|
|
|
807
818
|
"no-void"?: DummyRule;
|
|
808
819
|
"no-warning-comments"?: DummyRule;
|
|
809
820
|
"no-with"?: DummyRule;
|
|
821
|
+
"node/callback-return"?: DummyRule;
|
|
810
822
|
"node/global-require"?: DummyRule;
|
|
811
823
|
"node/handle-callback-err"?: DummyRule;
|
|
812
824
|
"node/no-exports-assign"?: DummyRule;
|
|
@@ -845,6 +857,7 @@ interface DummyRuleMap {
|
|
|
845
857
|
"prefer-const"?: DummyRule;
|
|
846
858
|
"prefer-destructuring"?: DummyRule;
|
|
847
859
|
"prefer-exponentiation-operator"?: DummyRule;
|
|
860
|
+
"prefer-named-capture-group"?: DummyRule;
|
|
848
861
|
"prefer-numeric-literals"?: DummyRule;
|
|
849
862
|
"prefer-object-has-own"?: DummyRule;
|
|
850
863
|
"prefer-object-spread"?: DummyRule;
|
|
@@ -961,6 +974,7 @@ interface DummyRuleMap {
|
|
|
961
974
|
"typescript/explicit-function-return-type"?: DummyRule;
|
|
962
975
|
"typescript/explicit-member-accessibility"?: DummyRule;
|
|
963
976
|
"typescript/explicit-module-boundary-types"?: DummyRule;
|
|
977
|
+
"typescript/method-signature-style"?: DummyRule;
|
|
964
978
|
"typescript/no-array-delete"?: DummyRule;
|
|
965
979
|
"typescript/no-base-to-string"?: DummyRule;
|
|
966
980
|
"typescript/no-confusing-non-null-assertion"?: DummyRule;
|
|
@@ -1066,6 +1080,7 @@ interface DummyRuleMap {
|
|
|
1066
1080
|
"unicorn/escape-case"?: DummyRule;
|
|
1067
1081
|
"unicorn/explicit-length-check"?: DummyRule;
|
|
1068
1082
|
"unicorn/filename-case"?: DummyRule;
|
|
1083
|
+
"unicorn/import-style"?: DummyRule;
|
|
1069
1084
|
"unicorn/new-for-builtins"?: DummyRule;
|
|
1070
1085
|
"unicorn/no-abusive-eslint-disable"?: DummyRule;
|
|
1071
1086
|
"unicorn/no-accessor-recursion"?: DummyRule;
|
|
@@ -1258,31 +1273,44 @@ interface DummyRuleMap {
|
|
|
1258
1273
|
"vitest/valid-expect-in-promise"?: DummyRule;
|
|
1259
1274
|
"vitest/valid-title"?: DummyRule;
|
|
1260
1275
|
"vitest/warn-todo"?: DummyRule;
|
|
1276
|
+
"vue/component-definition-name-casing"?: DummyRule;
|
|
1261
1277
|
"vue/define-emits-declaration"?: DummyRule;
|
|
1262
1278
|
"vue/define-props-declaration"?: DummyRule;
|
|
1263
1279
|
"vue/define-props-destructuring"?: DummyRule;
|
|
1264
1280
|
"vue/max-props"?: DummyRule;
|
|
1265
1281
|
"vue/no-arrow-functions-in-watch"?: DummyRule;
|
|
1282
|
+
"vue/no-computed-properties-in-data"?: DummyRule;
|
|
1266
1283
|
"vue/no-deprecated-data-object-declaration"?: DummyRule;
|
|
1267
1284
|
"vue/no-deprecated-delete-set"?: DummyRule;
|
|
1268
1285
|
"vue/no-deprecated-destroyed-lifecycle"?: DummyRule;
|
|
1269
1286
|
"vue/no-deprecated-events-api"?: DummyRule;
|
|
1270
1287
|
"vue/no-deprecated-model-definition"?: DummyRule;
|
|
1288
|
+
"vue/no-deprecated-props-default-this"?: DummyRule;
|
|
1271
1289
|
"vue/no-deprecated-vue-config-keycodes"?: DummyRule;
|
|
1272
1290
|
"vue/no-export-in-script-setup"?: DummyRule;
|
|
1291
|
+
"vue/no-expose-after-await"?: DummyRule;
|
|
1273
1292
|
"vue/no-import-compiler-macros"?: DummyRule;
|
|
1274
1293
|
"vue/no-lifecycle-after-await"?: DummyRule;
|
|
1275
1294
|
"vue/no-multiple-slot-args"?: DummyRule;
|
|
1276
1295
|
"vue/no-required-prop-with-default"?: DummyRule;
|
|
1296
|
+
"vue/no-reserved-component-names"?: DummyRule;
|
|
1297
|
+
"vue/no-shared-component-data"?: DummyRule;
|
|
1277
1298
|
"vue/no-this-in-before-route-enter"?: DummyRule;
|
|
1299
|
+
"vue/no-watch-after-await"?: DummyRule;
|
|
1278
1300
|
"vue/prefer-import-from-vue"?: DummyRule;
|
|
1279
1301
|
"vue/require-default-export"?: DummyRule;
|
|
1302
|
+
"vue/require-prop-type-constructor"?: DummyRule;
|
|
1303
|
+
"vue/require-render-return"?: DummyRule;
|
|
1304
|
+
"vue/require-slots-as-functions"?: DummyRule;
|
|
1280
1305
|
"vue/require-typed-ref"?: DummyRule;
|
|
1281
1306
|
"vue/return-in-computed-property"?: DummyRule;
|
|
1307
|
+
"vue/return-in-emits-validator"?: DummyRule;
|
|
1282
1308
|
"vue/valid-define-emits"?: DummyRule;
|
|
1309
|
+
"vue/valid-define-options"?: DummyRule;
|
|
1283
1310
|
"vue/valid-define-props"?: DummyRule;
|
|
1311
|
+
"vue/valid-next-tick"?: DummyRule;
|
|
1284
1312
|
yoda?: DummyRule;
|
|
1285
|
-
[k: string]: DummyRule;
|
|
1313
|
+
[k: string]: DummyRule | undefined;
|
|
1286
1314
|
}
|
|
1287
1315
|
/**
|
|
1288
1316
|
* Configure the behavior of linter plugins.
|
package/dist/js_config.js
CHANGED
|
@@ -2,8 +2,8 @@ import { a as JSONStringify, n as ArrayIsArray, r as DateNow } from "./globals.j
|
|
|
2
2
|
import { t as getErrorMessage$1 } from "./utils.js";
|
|
3
3
|
import { extname } from "node:path";
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
-
//#region ../shared/src-js/
|
|
6
|
-
const TS_MODULE_EXTENSIONS = new Set([
|
|
5
|
+
//#region ../shared/src-js/utils.ts
|
|
6
|
+
const isObject$1 = (v) => typeof v == "object" && !!v && !ArrayIsArray(v), TS_MODULE_EXTENSIONS = new Set([
|
|
7
7
|
".ts",
|
|
8
8
|
".mts",
|
|
9
9
|
".cts"
|
|
@@ -37,19 +37,19 @@ function getUnsupportedTypeScriptModuleLoadHintForError(err, specifier, nodeVers
|
|
|
37
37
|
return !isTypeScriptModuleSpecifier(specifier) || !isUnknownFileExtensionError(err) ? null : `${getErrorMessage(err)}\n\nTypeScript config files require Node.js ^20.19.0 || >=22.18.0.\nDetected Node.js ${nodeVersion}.\nPlease upgrade Node.js or use a JSON config file instead.`;
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region ../shared/src-js/js_config.ts
|
|
40
|
+
//#region ../shared/src-js/js_config/index.ts
|
|
41
41
|
/**
|
|
42
|
-
* Import a JS/TS config file and return its `default` export.
|
|
42
|
+
* Import a JS/TS config file and return its `default` export as a plain object.
|
|
43
43
|
*
|
|
44
44
|
* - Bypasses Node.js module cache (uses `?cache=<key>`) so changed files reload (used for LSP).
|
|
45
|
-
* - On `ERR_UNKNOWN_FILE_EXTENSION` for TS specifiers,
|
|
46
|
-
*
|
|
45
|
+
* - On `ERR_UNKNOWN_FILE_EXTENSION` for TS specifiers, wraps the error with a Node.js upgrade hint message;
|
|
46
|
+
* The original error is preserved via `Error.cause`.
|
|
47
47
|
*
|
|
48
48
|
* @param path - Absolute path to the JS/TS config file
|
|
49
49
|
* @param cacheKey - Cache-busting key.
|
|
50
50
|
* Callers decide whether to use a fresh value per call or share one across a batch.
|
|
51
|
-
* @throws When the file has no `default` export,
|
|
52
|
-
* or import fails (with
|
|
51
|
+
* @throws When the file has no `default` export, the export is not a plain object,
|
|
52
|
+
* or import fails (wrapped with hint message for unsupported TS module load).
|
|
53
53
|
*/
|
|
54
54
|
async function importJsConfig(path, cacheKey) {
|
|
55
55
|
let fileUrl = pathToFileURL(path);
|
|
@@ -59,12 +59,36 @@ async function importJsConfig(path, cacheKey) {
|
|
|
59
59
|
module = await import(fileUrl.href);
|
|
60
60
|
} catch (err) {
|
|
61
61
|
let hint = getUnsupportedTypeScriptModuleLoadHintForError(err, path);
|
|
62
|
-
throw hint
|
|
62
|
+
throw hint ? Error(hint, { cause: err }) : err;
|
|
63
63
|
}
|
|
64
64
|
if (module.default === void 0) throw Error("Configuration file has no default export.");
|
|
65
|
+
if (!isObject$1(module.default)) throw Error("Configuration file must have a default export that is an object.");
|
|
65
66
|
return module.default;
|
|
66
67
|
}
|
|
67
68
|
//#endregion
|
|
69
|
+
//#region ../shared/src-js/vite_plus_config.ts
|
|
70
|
+
let vitePlusCache = null;
|
|
71
|
+
/**
|
|
72
|
+
* Resolve a Vite+ config via `vite-plus`'s `resolveConfig` and extract the given field.
|
|
73
|
+
*
|
|
74
|
+
* `vite-plus` is loaded lazily and memoized for the process.
|
|
75
|
+
* Consumers declare it as an optional peer dependency; tsdown leaves the specifier external
|
|
76
|
+
* so the user-installed copy is used at runtime.
|
|
77
|
+
*
|
|
78
|
+
* @param path - Absolute path to the Vite config file
|
|
79
|
+
* @param fieldName - Field name to extract from the resolved config (e.g. `"fmt"`, `"lint"`)
|
|
80
|
+
* @returns The field as an object, or `null` when the field is missing (signals "skip")
|
|
81
|
+
* @throws When the field exists but is not a plain object
|
|
82
|
+
*/
|
|
83
|
+
async function loadViteConfigField(path, fieldName) {
|
|
84
|
+
vitePlusCache ??= import("vite-plus");
|
|
85
|
+
let { resolveConfig } = await vitePlusCache, config = await resolveConfig({ configFile: path }, "build");
|
|
86
|
+
if (!(fieldName in config)) return null;
|
|
87
|
+
let fieldValue = config[fieldName];
|
|
88
|
+
if (!isObject$1(fieldValue)) throw Error(`The \`${fieldName}\` field in the default export must be an object.`);
|
|
89
|
+
return fieldValue;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
68
92
|
//#region src-js/js_config.ts
|
|
69
93
|
const isObject = (v) => typeof v == "object" && !!v && !ArrayIsArray(v);
|
|
70
94
|
function validateConfigExtends(root) {
|
|
@@ -101,40 +125,31 @@ ${refPath} points back to ${cycleStart}\nCycle: ${idx === -1 ? `${cycleStart} ->
|
|
|
101
125
|
*/
|
|
102
126
|
async function resolveJsConfig(path, cacheKey) {
|
|
103
127
|
let config = await importJsConfig(path, cacheKey);
|
|
104
|
-
if (!isObject(config)) throw Error("Configuration file must have a default export that is an object.");
|
|
105
128
|
return validateConfigExtends(config), {
|
|
106
129
|
path,
|
|
107
130
|
config
|
|
108
131
|
};
|
|
109
132
|
}
|
|
110
|
-
const VITE_OXLINT_CONFIG_FIELD = "lint";
|
|
111
133
|
/**
|
|
112
134
|
* Resolve a single Vite+ config path to a `JsConfigResult`.
|
|
113
|
-
* Extracts the `.lint` field
|
|
135
|
+
* Extracts the `.lint` field via `vite-plus`. Returns `null` config when missing (signals "skip").
|
|
114
136
|
*/
|
|
115
|
-
async function resolveVitePlusConfig(path
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
path,
|
|
119
|
-
config: null
|
|
120
|
-
};
|
|
121
|
-
let lintConfig = config[VITE_OXLINT_CONFIG_FIELD];
|
|
122
|
-
if (lintConfig === void 0) return {
|
|
137
|
+
async function resolveVitePlusConfig(path) {
|
|
138
|
+
let lintConfig = await loadViteConfigField(path, "lint");
|
|
139
|
+
return lintConfig === null ? {
|
|
123
140
|
path,
|
|
124
141
|
config: null
|
|
125
|
-
}
|
|
126
|
-
if (!isObject(lintConfig)) throw Error(`The \`${VITE_OXLINT_CONFIG_FIELD}\` field in the default export must be an object.`);
|
|
127
|
-
return validateConfigExtends(lintConfig), {
|
|
142
|
+
} : (validateConfigExtends(lintConfig), {
|
|
128
143
|
path,
|
|
129
144
|
config: lintConfig
|
|
130
|
-
};
|
|
145
|
+
});
|
|
131
146
|
}
|
|
132
147
|
/**
|
|
133
148
|
* Load config files in parallel using the given resolver, and return JSON-stringified result.
|
|
134
149
|
*/
|
|
135
150
|
async function loadConfigs(paths, resolver) {
|
|
136
151
|
try {
|
|
137
|
-
let
|
|
152
|
+
let results = await Promise.allSettled(paths.map(resolver)), successes = [], errors = [];
|
|
138
153
|
for (let i = 0; i < results.length; i++) {
|
|
139
154
|
let result = results[i];
|
|
140
155
|
result.status === "fulfilled" ? successes.push(result.value) : errors.push({
|
|
@@ -150,6 +165,9 @@ async function loadConfigs(paths, resolver) {
|
|
|
150
165
|
/**
|
|
151
166
|
* Load standard oxlint JS/TS config files in parallel.
|
|
152
167
|
*/
|
|
153
|
-
const loadJsConfigs = (paths) =>
|
|
168
|
+
const loadJsConfigs = (paths) => {
|
|
169
|
+
let cacheKey = DateNow();
|
|
170
|
+
return loadConfigs(paths, (path) => resolveJsConfig(path, cacheKey));
|
|
171
|
+
}, loadVitePlusConfigs = (paths) => loadConfigs(paths, resolveVitePlusConfig);
|
|
154
172
|
//#endregion
|
|
155
173
|
export { loadJsConfigs, loadVitePlusConfigs };
|
package/dist/lint.js
CHANGED
|
@@ -14099,7 +14099,7 @@ function resetSettings() {
|
|
|
14099
14099
|
}
|
|
14100
14100
|
//#endregion
|
|
14101
14101
|
//#region package.json
|
|
14102
|
-
var version = "1.
|
|
14102
|
+
var version = "1.68.0";
|
|
14103
14103
|
//#endregion
|
|
14104
14104
|
//#region src-js/plugins/context.ts
|
|
14105
14105
|
let filePath = null, cwd = null;
|
|
@@ -17706,7 +17706,7 @@ function conformHookFn(hookFn, hookName) {
|
|
|
17706
17706
|
return hookFn;
|
|
17707
17707
|
}
|
|
17708
17708
|
//#endregion
|
|
17709
|
-
//#region ../../node_modules/.pnpm/eslint@10.
|
|
17709
|
+
//#region ../../node_modules/.pnpm/eslint@10.4.0/node_modules/eslint/lib/shared/assert.js
|
|
17710
17710
|
/**
|
|
17711
17711
|
* @fileoverview Assertion utilities equivalent to the Node.js node:asserts module.
|
|
17712
17712
|
* @author Josh Goldberg
|
|
@@ -18276,6 +18276,14 @@ var require_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
18276
18276
|
default: return `${node.type}${suffix}`;
|
|
18277
18277
|
}
|
|
18278
18278
|
}
|
|
18279
|
+
/**
|
|
18280
|
+
* Escape text for use in a DOT label.
|
|
18281
|
+
* @param {string} value The value to escape.
|
|
18282
|
+
* @returns {string} The escaped value.
|
|
18283
|
+
*/
|
|
18284
|
+
function escapeDotLabelText(value) {
|
|
18285
|
+
return value.replace(/\\/gu, String.raw`\\`).replace(/"/gu, String.raw`\"`);
|
|
18286
|
+
}
|
|
18279
18287
|
module.exports = {
|
|
18280
18288
|
/**
|
|
18281
18289
|
* A flag that debug dumping is enabled or not.
|
|
@@ -18319,7 +18327,7 @@ var require_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
18319
18327
|
let traceMap = Object.create(null), arrows = this.makeDotArrows(codePath, traceMap);
|
|
18320
18328
|
for (let id in traceMap) {
|
|
18321
18329
|
let segment = traceMap[id];
|
|
18322
|
-
text += `${id}[`, segment.reachable ? text += "label=\"" : text += "style=\"rounded,dashed,filled\",fillcolor=\"#FF9800\",label=\"<<unreachable>>\\n", segment.internal.nodes.length > 0 ? text += segment.internal.nodes.join("\\n") : text += "????", text += "\"];\n";
|
|
18330
|
+
text += `${id}[`, segment.reachable ? text += "label=\"" : text += "style=\"rounded,dashed,filled\",fillcolor=\"#FF9800\",label=\"<<unreachable>>\\n", segment.internal.nodes.length > 0 ? text += segment.internal.nodes.map(escapeDotLabelText).join("\\n") : text += "????", text += "\"];\n";
|
|
18323
18331
|
}
|
|
18324
18332
|
text += `${arrows}\n`, text += "}", debug("DOT", text);
|
|
18325
18333
|
} : debug,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.68.0",
|
|
4
4
|
"description": "Linter for the JavaScript Oxidation Compiler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -46,11 +46,15 @@
|
|
|
46
46
|
"./package.json": "./package.json"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"oxlint-tsgolint": ">=0.22.1"
|
|
49
|
+
"oxlint-tsgolint": ">=0.22.1",
|
|
50
|
+
"vite-plus": "*"
|
|
50
51
|
},
|
|
51
52
|
"peerDependenciesMeta": {
|
|
52
53
|
"oxlint-tsgolint": {
|
|
53
54
|
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"vite-plus": {
|
|
57
|
+
"optional": true
|
|
54
58
|
}
|
|
55
59
|
},
|
|
56
60
|
"napi": {
|
|
@@ -83,24 +87,24 @@
|
|
|
83
87
|
},
|
|
84
88
|
"preferUnplugged": true,
|
|
85
89
|
"optionalDependencies": {
|
|
86
|
-
"@oxlint/binding-darwin-arm64": "1.
|
|
87
|
-
"@oxlint/binding-android-arm64": "1.
|
|
88
|
-
"@oxlint/binding-win32-arm64-msvc": "1.
|
|
89
|
-
"@oxlint/binding-linux-arm64-gnu": "1.
|
|
90
|
-
"@oxlint/binding-linux-arm64-musl": "1.
|
|
91
|
-
"@oxlint/binding-openharmony-arm64": "1.
|
|
92
|
-
"@oxlint/binding-android-arm-eabi": "1.
|
|
93
|
-
"@oxlint/binding-linux-arm-gnueabihf": "1.
|
|
94
|
-
"@oxlint/binding-linux-arm-musleabihf": "1.
|
|
95
|
-
"@oxlint/binding-win32-ia32-msvc": "1.
|
|
96
|
-
"@oxlint/binding-linux-ppc64-gnu": "1.
|
|
97
|
-
"@oxlint/binding-linux-riscv64-gnu": "1.
|
|
98
|
-
"@oxlint/binding-linux-riscv64-musl": "1.
|
|
99
|
-
"@oxlint/binding-linux-s390x-gnu": "1.
|
|
100
|
-
"@oxlint/binding-darwin-x64": "1.
|
|
101
|
-
"@oxlint/binding-win32-x64-msvc": "1.
|
|
102
|
-
"@oxlint/binding-freebsd-x64": "1.
|
|
103
|
-
"@oxlint/binding-linux-x64-gnu": "1.
|
|
104
|
-
"@oxlint/binding-linux-x64-musl": "1.
|
|
90
|
+
"@oxlint/binding-darwin-arm64": "1.68.0",
|
|
91
|
+
"@oxlint/binding-android-arm64": "1.68.0",
|
|
92
|
+
"@oxlint/binding-win32-arm64-msvc": "1.68.0",
|
|
93
|
+
"@oxlint/binding-linux-arm64-gnu": "1.68.0",
|
|
94
|
+
"@oxlint/binding-linux-arm64-musl": "1.68.0",
|
|
95
|
+
"@oxlint/binding-openharmony-arm64": "1.68.0",
|
|
96
|
+
"@oxlint/binding-android-arm-eabi": "1.68.0",
|
|
97
|
+
"@oxlint/binding-linux-arm-gnueabihf": "1.68.0",
|
|
98
|
+
"@oxlint/binding-linux-arm-musleabihf": "1.68.0",
|
|
99
|
+
"@oxlint/binding-win32-ia32-msvc": "1.68.0",
|
|
100
|
+
"@oxlint/binding-linux-ppc64-gnu": "1.68.0",
|
|
101
|
+
"@oxlint/binding-linux-riscv64-gnu": "1.68.0",
|
|
102
|
+
"@oxlint/binding-linux-riscv64-musl": "1.68.0",
|
|
103
|
+
"@oxlint/binding-linux-s390x-gnu": "1.68.0",
|
|
104
|
+
"@oxlint/binding-darwin-x64": "1.68.0",
|
|
105
|
+
"@oxlint/binding-win32-x64-msvc": "1.68.0",
|
|
106
|
+
"@oxlint/binding-freebsd-x64": "1.68.0",
|
|
107
|
+
"@oxlint/binding-linux-x64-gnu": "1.68.0",
|
|
108
|
+
"@oxlint/binding-linux-x64-musl": "1.68.0"
|
|
105
109
|
}
|
|
106
110
|
}
|