oxlint 1.52.0 → 1.53.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/dist/bindings.js +26 -26
- package/dist/js_config.js +5 -2
- package/dist/lint.js +93 -71
- package/package.json +20 -20
package/dist/bindings.js
CHANGED
|
@@ -37,7 +37,7 @@ function requireNative() {
|
|
|
37
37
|
}
|
|
38
38
|
try {
|
|
39
39
|
let binding = require("@oxlint/binding-android-arm64"), bindingPackageVersion = require("@oxlint/binding-android-arm64/package.json").version;
|
|
40
|
-
if (bindingPackageVersion !== "1.
|
|
40
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
41
41
|
return binding;
|
|
42
42
|
} catch (e) {
|
|
43
43
|
loadErrors.push(e);
|
|
@@ -50,7 +50,7 @@ function requireNative() {
|
|
|
50
50
|
}
|
|
51
51
|
try {
|
|
52
52
|
let binding = require("@oxlint/binding-android-arm-eabi"), bindingPackageVersion = require("@oxlint/binding-android-arm-eabi/package.json").version;
|
|
53
|
-
if (bindingPackageVersion !== "1.
|
|
53
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
54
54
|
return binding;
|
|
55
55
|
} catch (e) {
|
|
56
56
|
loadErrors.push(e);
|
|
@@ -64,7 +64,7 @@ function requireNative() {
|
|
|
64
64
|
}
|
|
65
65
|
try {
|
|
66
66
|
let binding = require("@oxlint/binding-win32-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-win32-x64-gnu/package.json").version;
|
|
67
|
-
if (bindingPackageVersion !== "1.
|
|
67
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
68
68
|
return binding;
|
|
69
69
|
} catch (e) {
|
|
70
70
|
loadErrors.push(e);
|
|
@@ -77,7 +77,7 @@ function requireNative() {
|
|
|
77
77
|
}
|
|
78
78
|
try {
|
|
79
79
|
let binding = require("@oxlint/binding-win32-x64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-x64-msvc/package.json").version;
|
|
80
|
-
if (bindingPackageVersion !== "1.
|
|
80
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
81
81
|
return binding;
|
|
82
82
|
} catch (e) {
|
|
83
83
|
loadErrors.push(e);
|
|
@@ -91,7 +91,7 @@ function requireNative() {
|
|
|
91
91
|
}
|
|
92
92
|
try {
|
|
93
93
|
let binding = require("@oxlint/binding-win32-ia32-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-ia32-msvc/package.json").version;
|
|
94
|
-
if (bindingPackageVersion !== "1.
|
|
94
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
95
95
|
return binding;
|
|
96
96
|
} catch (e) {
|
|
97
97
|
loadErrors.push(e);
|
|
@@ -104,7 +104,7 @@ function requireNative() {
|
|
|
104
104
|
}
|
|
105
105
|
try {
|
|
106
106
|
let binding = require("@oxlint/binding-win32-arm64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-arm64-msvc/package.json").version;
|
|
107
|
-
if (bindingPackageVersion !== "1.
|
|
107
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
108
108
|
return binding;
|
|
109
109
|
} catch (e) {
|
|
110
110
|
loadErrors.push(e);
|
|
@@ -118,7 +118,7 @@ function requireNative() {
|
|
|
118
118
|
}
|
|
119
119
|
try {
|
|
120
120
|
let binding = require("@oxlint/binding-darwin-universal"), bindingPackageVersion = require("@oxlint/binding-darwin-universal/package.json").version;
|
|
121
|
-
if (bindingPackageVersion !== "1.
|
|
121
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
122
122
|
return binding;
|
|
123
123
|
} catch (e) {
|
|
124
124
|
loadErrors.push(e);
|
|
@@ -131,7 +131,7 @@ function requireNative() {
|
|
|
131
131
|
}
|
|
132
132
|
try {
|
|
133
133
|
let binding = require("@oxlint/binding-darwin-x64"), bindingPackageVersion = require("@oxlint/binding-darwin-x64/package.json").version;
|
|
134
|
-
if (bindingPackageVersion !== "1.
|
|
134
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
135
135
|
return binding;
|
|
136
136
|
} catch (e) {
|
|
137
137
|
loadErrors.push(e);
|
|
@@ -144,7 +144,7 @@ function requireNative() {
|
|
|
144
144
|
}
|
|
145
145
|
try {
|
|
146
146
|
let binding = require("@oxlint/binding-darwin-arm64"), bindingPackageVersion = require("@oxlint/binding-darwin-arm64/package.json").version;
|
|
147
|
-
if (bindingPackageVersion !== "1.
|
|
147
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
148
148
|
return binding;
|
|
149
149
|
} catch (e) {
|
|
150
150
|
loadErrors.push(e);
|
|
@@ -158,7 +158,7 @@ function requireNative() {
|
|
|
158
158
|
}
|
|
159
159
|
try {
|
|
160
160
|
let binding = require("@oxlint/binding-freebsd-x64"), bindingPackageVersion = require("@oxlint/binding-freebsd-x64/package.json").version;
|
|
161
|
-
if (bindingPackageVersion !== "1.
|
|
161
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
162
162
|
return binding;
|
|
163
163
|
} catch (e) {
|
|
164
164
|
loadErrors.push(e);
|
|
@@ -171,7 +171,7 @@ function requireNative() {
|
|
|
171
171
|
}
|
|
172
172
|
try {
|
|
173
173
|
let binding = require("@oxlint/binding-freebsd-arm64"), bindingPackageVersion = require("@oxlint/binding-freebsd-arm64/package.json").version;
|
|
174
|
-
if (bindingPackageVersion !== "1.
|
|
174
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
175
175
|
return binding;
|
|
176
176
|
} catch (e) {
|
|
177
177
|
loadErrors.push(e);
|
|
@@ -185,7 +185,7 @@ function requireNative() {
|
|
|
185
185
|
}
|
|
186
186
|
try {
|
|
187
187
|
let binding = require("@oxlint/binding-linux-x64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-x64-musl/package.json").version;
|
|
188
|
-
if (bindingPackageVersion !== "1.
|
|
188
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
189
189
|
return binding;
|
|
190
190
|
} catch (e) {
|
|
191
191
|
loadErrors.push(e);
|
|
@@ -198,7 +198,7 @@ function requireNative() {
|
|
|
198
198
|
}
|
|
199
199
|
try {
|
|
200
200
|
let binding = require("@oxlint/binding-linux-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-x64-gnu/package.json").version;
|
|
201
|
-
if (bindingPackageVersion !== "1.
|
|
201
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
202
202
|
return binding;
|
|
203
203
|
} catch (e) {
|
|
204
204
|
loadErrors.push(e);
|
|
@@ -212,7 +212,7 @@ function requireNative() {
|
|
|
212
212
|
}
|
|
213
213
|
try {
|
|
214
214
|
let binding = require("@oxlint/binding-linux-arm64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-musl/package.json").version;
|
|
215
|
-
if (bindingPackageVersion !== "1.
|
|
215
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
216
216
|
return binding;
|
|
217
217
|
} catch (e) {
|
|
218
218
|
loadErrors.push(e);
|
|
@@ -225,7 +225,7 @@ function requireNative() {
|
|
|
225
225
|
}
|
|
226
226
|
try {
|
|
227
227
|
let binding = require("@oxlint/binding-linux-arm64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-gnu/package.json").version;
|
|
228
|
-
if (bindingPackageVersion !== "1.
|
|
228
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
229
229
|
return binding;
|
|
230
230
|
} catch (e) {
|
|
231
231
|
loadErrors.push(e);
|
|
@@ -239,7 +239,7 @@ function requireNative() {
|
|
|
239
239
|
}
|
|
240
240
|
try {
|
|
241
241
|
let binding = require("@oxlint/binding-linux-arm-musleabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-musleabihf/package.json").version;
|
|
242
|
-
if (bindingPackageVersion !== "1.
|
|
242
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
243
243
|
return binding;
|
|
244
244
|
} catch (e) {
|
|
245
245
|
loadErrors.push(e);
|
|
@@ -252,7 +252,7 @@ function requireNative() {
|
|
|
252
252
|
}
|
|
253
253
|
try {
|
|
254
254
|
let binding = require("@oxlint/binding-linux-arm-gnueabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-gnueabihf/package.json").version;
|
|
255
|
-
if (bindingPackageVersion !== "1.
|
|
255
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
256
256
|
return binding;
|
|
257
257
|
} catch (e) {
|
|
258
258
|
loadErrors.push(e);
|
|
@@ -266,7 +266,7 @@ function requireNative() {
|
|
|
266
266
|
}
|
|
267
267
|
try {
|
|
268
268
|
let binding = require("@oxlint/binding-linux-loong64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-musl/package.json").version;
|
|
269
|
-
if (bindingPackageVersion !== "1.
|
|
269
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
270
270
|
return binding;
|
|
271
271
|
} catch (e) {
|
|
272
272
|
loadErrors.push(e);
|
|
@@ -279,7 +279,7 @@ function requireNative() {
|
|
|
279
279
|
}
|
|
280
280
|
try {
|
|
281
281
|
let binding = require("@oxlint/binding-linux-loong64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-gnu/package.json").version;
|
|
282
|
-
if (bindingPackageVersion !== "1.
|
|
282
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
283
283
|
return binding;
|
|
284
284
|
} catch (e) {
|
|
285
285
|
loadErrors.push(e);
|
|
@@ -293,7 +293,7 @@ function requireNative() {
|
|
|
293
293
|
}
|
|
294
294
|
try {
|
|
295
295
|
let binding = require("@oxlint/binding-linux-riscv64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-musl/package.json").version;
|
|
296
|
-
if (bindingPackageVersion !== "1.
|
|
296
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
297
297
|
return binding;
|
|
298
298
|
} catch (e) {
|
|
299
299
|
loadErrors.push(e);
|
|
@@ -306,7 +306,7 @@ function requireNative() {
|
|
|
306
306
|
}
|
|
307
307
|
try {
|
|
308
308
|
let binding = require("@oxlint/binding-linux-riscv64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-gnu/package.json").version;
|
|
309
|
-
if (bindingPackageVersion !== "1.
|
|
309
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
310
310
|
return binding;
|
|
311
311
|
} catch (e) {
|
|
312
312
|
loadErrors.push(e);
|
|
@@ -320,7 +320,7 @@ function requireNative() {
|
|
|
320
320
|
}
|
|
321
321
|
try {
|
|
322
322
|
let binding = require("@oxlint/binding-linux-ppc64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-ppc64-gnu/package.json").version;
|
|
323
|
-
if (bindingPackageVersion !== "1.
|
|
323
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
324
324
|
return binding;
|
|
325
325
|
} catch (e) {
|
|
326
326
|
loadErrors.push(e);
|
|
@@ -333,7 +333,7 @@ function requireNative() {
|
|
|
333
333
|
}
|
|
334
334
|
try {
|
|
335
335
|
let binding = require("@oxlint/binding-linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-s390x-gnu/package.json").version;
|
|
336
|
-
if (bindingPackageVersion !== "1.
|
|
336
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
337
337
|
return binding;
|
|
338
338
|
} catch (e) {
|
|
339
339
|
loadErrors.push(e);
|
|
@@ -347,7 +347,7 @@ function requireNative() {
|
|
|
347
347
|
}
|
|
348
348
|
try {
|
|
349
349
|
let binding = require("@oxlint/binding-openharmony-arm64"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm64/package.json").version;
|
|
350
|
-
if (bindingPackageVersion !== "1.
|
|
350
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
351
351
|
return binding;
|
|
352
352
|
} catch (e) {
|
|
353
353
|
loadErrors.push(e);
|
|
@@ -360,7 +360,7 @@ function requireNative() {
|
|
|
360
360
|
}
|
|
361
361
|
try {
|
|
362
362
|
let binding = require("@oxlint/binding-openharmony-x64"), bindingPackageVersion = require("@oxlint/binding-openharmony-x64/package.json").version;
|
|
363
|
-
if (bindingPackageVersion !== "1.
|
|
363
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
364
364
|
return binding;
|
|
365
365
|
} catch (e) {
|
|
366
366
|
loadErrors.push(e);
|
|
@@ -373,7 +373,7 @@ function requireNative() {
|
|
|
373
373
|
}
|
|
374
374
|
try {
|
|
375
375
|
let binding = require("@oxlint/binding-openharmony-arm"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm/package.json").version;
|
|
376
|
-
if (bindingPackageVersion !== "1.
|
|
376
|
+
if (bindingPackageVersion !== "1.53.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.53.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
377
377
|
return binding;
|
|
378
378
|
} catch (e) {
|
|
379
379
|
loadErrors.push(e);
|
package/dist/js_config.js
CHANGED
|
@@ -44,8 +44,11 @@ async function loadJsConfigs(paths) {
|
|
|
44
44
|
let config = (await import(new URL(`file://${path}?cache=${cacheKey}`).href)).default;
|
|
45
45
|
if (config === void 0) throw Error("Configuration file has no default export.");
|
|
46
46
|
if (typeof config != "object" || !config || ArrayIsArray(config)) throw Error("Configuration file must have a default export that is an object.");
|
|
47
|
-
if (!
|
|
48
|
-
|
|
47
|
+
if (!path.endsWith("/vite.config.ts")) {
|
|
48
|
+
if (!isDefineConfig(config)) throw Error("Configuration file must wrap its default export with defineConfig() from \"oxlint\".");
|
|
49
|
+
validateConfigExtends(config);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
49
52
|
path,
|
|
50
53
|
config
|
|
51
54
|
};
|
package/dist/lint.js
CHANGED
|
@@ -12095,7 +12095,7 @@ function getScope(node) {
|
|
|
12095
12095
|
* @returns `true` if a variable with the given name was found and marked as used, otherwise `false`
|
|
12096
12096
|
*/
|
|
12097
12097
|
function markVariableAsUsed(name, refNode) {
|
|
12098
|
-
throw Error("`
|
|
12098
|
+
throw Error("`sourceCode.markVariableAsUsed` not implemented yet");
|
|
12099
12099
|
}
|
|
12100
12100
|
//#endregion
|
|
12101
12101
|
//#region src-js/plugins/tokens_methods.ts
|
|
@@ -13242,7 +13242,7 @@ function resetSettings() {
|
|
|
13242
13242
|
}
|
|
13243
13243
|
//#endregion
|
|
13244
13244
|
//#region package.json
|
|
13245
|
-
var version = "1.
|
|
13245
|
+
var version = "1.53.0";
|
|
13246
13246
|
//#endregion
|
|
13247
13247
|
//#region src-js/plugins/context.ts
|
|
13248
13248
|
let filePath = null, cwd = null;
|
|
@@ -22211,28 +22211,16 @@ for (let i = 138; i !== 0; i--) compilingNonLeafVisitor.push({
|
|
|
22211
22211
|
for (let i = 7; i !== 0; i--) compilingCfgVisitor.push([]);
|
|
22212
22212
|
const compiledVisitor = [];
|
|
22213
22213
|
for (let i = 172; i !== 0; i--) compiledVisitor.push(null);
|
|
22214
|
-
const activeLeafVisitorTypeIds =
|
|
22215
|
-
|
|
22216
|
-
for (let i = 138; i !== 0; i--) activeNonLeafVisitorTypeIds.push(0);
|
|
22217
|
-
for (let i = 7; i !== 0; i--) activeCfgVisitorTypeIds.push(0);
|
|
22218
|
-
activeLeafVisitorTypeIds.length = 0, activeNonLeafVisitorTypeIds.length = 0, activeCfgVisitorTypeIds.length = 0;
|
|
22219
|
-
let hasActiveVisitors = !1;
|
|
22214
|
+
const activeTypeIdsBuffer = /* @__PURE__ */ new ArrayBuffer(172), activeLeafVisitorTypeIds = new Uint8Array(activeTypeIdsBuffer, 0, 27), activeNonLeafVisitorTypeIds = new Uint8Array(activeTypeIdsBuffer, 27, 138), activeCfgVisitorTypeIds = new Uint8Array(activeTypeIdsBuffer, 165, 7);
|
|
22215
|
+
let activeLeafVisitorsCount = 0, activeNonLeafVisitorsCount = 0, activeCfgVisitorsCount = 0, hasActiveVisitors = !1;
|
|
22220
22216
|
const enterExitObjectCache = [];
|
|
22221
|
-
let
|
|
22217
|
+
for (let i = 138; i !== 0; i--) enterExitObjectCache.push({
|
|
22218
|
+
enter: null,
|
|
22219
|
+
exit: null
|
|
22220
|
+
});
|
|
22222
22221
|
const visitPropsCache = [];
|
|
22223
22222
|
let visitPropsCacheNextIndex = 0;
|
|
22224
22223
|
/**
|
|
22225
|
-
* Initialize compiled visitor, ready for calls to `addVisitor`.
|
|
22226
|
-
*/
|
|
22227
|
-
function initCompiledVisitor() {
|
|
22228
|
-
for (let i = 0; i < 172; i++) compiledVisitor[i] = null;
|
|
22229
|
-
for (let i = 0; i < enterExitObjectCacheNextIndex; i++) {
|
|
22230
|
-
let enterExit = enterExitObjectCache[i];
|
|
22231
|
-
enterExit.enter = null, enterExit.exit = null;
|
|
22232
|
-
}
|
|
22233
|
-
enterExitObjectCacheNextIndex = 0;
|
|
22234
|
-
}
|
|
22235
|
-
/**
|
|
22236
22224
|
* Add a visitor to compiled visitor.
|
|
22237
22225
|
*
|
|
22238
22226
|
* @param visitor - Visitor object
|
|
@@ -22240,39 +22228,40 @@ function initCompiledVisitor() {
|
|
|
22240
22228
|
function addVisitorToCompiled(visitor) {
|
|
22241
22229
|
if (typeof visitor != "object" || !visitor) throw TypeError("Visitor returned from `create` method must be an object");
|
|
22242
22230
|
let keys = ObjectKeys(visitor), keysLen = keys.length;
|
|
22243
|
-
if (keysLen
|
|
22244
|
-
|
|
22245
|
-
|
|
22246
|
-
|
|
22247
|
-
|
|
22248
|
-
|
|
22249
|
-
|
|
22250
|
-
|
|
22251
|
-
|
|
22252
|
-
|
|
22253
|
-
|
|
22254
|
-
|
|
22255
|
-
|
|
22256
|
-
|
|
22257
|
-
|
|
22258
|
-
|
|
22259
|
-
|
|
22260
|
-
|
|
22261
|
-
|
|
22262
|
-
|
|
22263
|
-
|
|
22264
|
-
|
|
22265
|
-
|
|
22266
|
-
|
|
22267
|
-
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22231
|
+
if (keysLen === 0) return;
|
|
22232
|
+
hasActiveVisitors = !0;
|
|
22233
|
+
let visitPropsCacheRequiredLen = visitPropsCacheNextIndex + keysLen;
|
|
22234
|
+
for (; visitPropsCache.length < visitPropsCacheRequiredLen;) visitPropsCache.push({
|
|
22235
|
+
fn: null,
|
|
22236
|
+
specificity: 0,
|
|
22237
|
+
selectorStr: null
|
|
22238
|
+
});
|
|
22239
|
+
for (let i = 0; i < keysLen; i++) {
|
|
22240
|
+
let name = keys[i], visitFn = visitor[name];
|
|
22241
|
+
if (typeof visitFn != "function") throw TypeError(`'${name}' property of visitor object is not a function`);
|
|
22242
|
+
let specificity = 0, isExit = name.endsWith(":exit");
|
|
22243
|
+
isExit && (name = name.slice(0, -5), specificity = 536870912);
|
|
22244
|
+
let visitProp = visitPropsCache[visitPropsCacheNextIndex++];
|
|
22245
|
+
visitProp.fn = visitFn, visitProp.specificity = specificity, visitProp.selectorStr = name;
|
|
22246
|
+
let typeId = NODE_TYPE_IDS_MAP.get(name);
|
|
22247
|
+
if (typeId !== void 0) {
|
|
22248
|
+
visitProp.specificity |= 1, typeId < 27 ? addLeafVisitFn(typeId, visitProp) : typeId < 165 ? addNonLeafVisitFn(typeId, visitProp, isExit) : addCfgVisitFn(typeId, visitProp, isExit);
|
|
22249
|
+
continue;
|
|
22250
|
+
}
|
|
22251
|
+
if (name !== "*") {
|
|
22252
|
+
let selector = parseSelector(name);
|
|
22253
|
+
visitProp.specificity |= selector.specificity, selector.isComplex && (visitProp.fn = wrapVisitFnWithSelectorMatch(visitFn, selector.esquerySelector));
|
|
22254
|
+
let { typeIds } = selector;
|
|
22255
|
+
if (typeIds !== null) {
|
|
22256
|
+
for (let i = 0, len = typeIds.length; i < len; i++) {
|
|
22257
|
+
let typeId = typeIds[i];
|
|
22258
|
+
typeId < 27 ? addLeafVisitFn(typeId, visitProp) : addNonLeafVisitFn(typeId, visitProp, isExit);
|
|
22271
22259
|
}
|
|
22260
|
+
continue;
|
|
22272
22261
|
}
|
|
22273
|
-
for (typeId = 0; typeId < 27; typeId++) addLeafVisitFn(typeId, visitProp);
|
|
22274
|
-
for (; typeId < 165; typeId++) addNonLeafVisitFn(typeId, visitProp, isExit);
|
|
22275
22262
|
}
|
|
22263
|
+
for (typeId = 0; typeId < 27; typeId++) addLeafVisitFn(typeId, visitProp);
|
|
22264
|
+
for (; typeId < 165; typeId++) addNonLeafVisitFn(typeId, visitProp, isExit);
|
|
22276
22265
|
}
|
|
22277
22266
|
}
|
|
22278
22267
|
/**
|
|
@@ -22285,7 +22274,7 @@ function addVisitorToCompiled(visitor) {
|
|
|
22285
22274
|
*/
|
|
22286
22275
|
function addLeafVisitFn(typeId, visitProp) {
|
|
22287
22276
|
let visitProps = compilingLeafVisitor[typeId];
|
|
22288
|
-
visitProps.length === 0 && activeLeafVisitorTypeIds
|
|
22277
|
+
visitProps.length === 0 && (activeLeafVisitorTypeIds[activeLeafVisitorsCount++] = typeId), visitProps.push(visitProp);
|
|
22289
22278
|
}
|
|
22290
22279
|
/**
|
|
22291
22280
|
* Add visit function for a non-leaf node to compiled visitor.
|
|
@@ -22298,7 +22287,7 @@ function addLeafVisitFn(typeId, visitProp) {
|
|
|
22298
22287
|
*/
|
|
22299
22288
|
function addNonLeafVisitFn(typeId, visitProp, isExit) {
|
|
22300
22289
|
let { enter, exit } = compilingNonLeafVisitor[typeId - 27];
|
|
22301
|
-
enter.length === 0 && exit.length === 0 && activeNonLeafVisitorTypeIds
|
|
22290
|
+
enter.length === 0 && exit.length === 0 && (activeNonLeafVisitorTypeIds[activeNonLeafVisitorsCount++] = typeId), isExit ? exit.push(visitProp) : enter.push(visitProp);
|
|
22302
22291
|
}
|
|
22303
22292
|
/**
|
|
22304
22293
|
* Add visit function for a CFG event to compiled visitor.
|
|
@@ -22312,7 +22301,7 @@ function addNonLeafVisitFn(typeId, visitProp, isExit) {
|
|
|
22312
22301
|
function addCfgVisitFn(typeId, visitProp, isExit) {
|
|
22313
22302
|
if (isExit) throw Error(`Invalid visitor key: \`${visitProp.selectorStr}:exit\``);
|
|
22314
22303
|
let visitProps = compilingCfgVisitor[typeId - 165];
|
|
22315
|
-
visitProps.length === 0 && activeCfgVisitorTypeIds
|
|
22304
|
+
visitProps.length === 0 && (activeCfgVisitorTypeIds[activeCfgVisitorsCount++] = typeId), visitProps.push(visitProp);
|
|
22316
22305
|
}
|
|
22317
22306
|
/**
|
|
22318
22307
|
* Finalize compiled visitor.
|
|
@@ -22323,32 +22312,42 @@ function addCfgVisitFn(typeId, visitProp, isExit) {
|
|
|
22323
22312
|
*/
|
|
22324
22313
|
function finalizeCompiledVisitor() {
|
|
22325
22314
|
if (hasActiveVisitors === !1) return 0;
|
|
22326
|
-
for (let i =
|
|
22315
|
+
for (let i = activeLeafVisitorsCount - 1; i >= 0; i--) {
|
|
22327
22316
|
let typeId = activeLeafVisitorTypeIds[i];
|
|
22328
22317
|
compiledVisitor[typeId] = mergeVisitFns(compilingLeafVisitor[typeId]);
|
|
22329
22318
|
}
|
|
22330
|
-
for (let i =
|
|
22331
|
-
let typeId = activeNonLeafVisitorTypeIds[i], entry = compilingNonLeafVisitor[typeId - 27], enterExit;
|
|
22332
|
-
enterExitObjectCacheNextIndex < enterExitObjectCache.length ? enterExit = enterExitObjectCache[enterExitObjectCacheNextIndex] : (enterExit = {
|
|
22333
|
-
enter: null,
|
|
22334
|
-
exit: null
|
|
22335
|
-
}, enterExitObjectCache.push(enterExit)), enterExitObjectCacheNextIndex++;
|
|
22336
|
-
let enterArr = entry.enter;
|
|
22319
|
+
for (let i = 0; i < activeNonLeafVisitorsCount; i++) {
|
|
22320
|
+
let typeId = activeNonLeafVisitorTypeIds[i], entry = compilingNonLeafVisitor[typeId - 27], enterExit = enterExitObjectCache[i], enterArr = entry.enter;
|
|
22337
22321
|
enterArr.length !== 0 && (enterExit.enter = mergeVisitFns(enterArr));
|
|
22338
22322
|
let exitArr = entry.exit;
|
|
22339
22323
|
exitArr.length !== 0 && (enterExit.exit = mergeVisitFns(exitArr)), compiledVisitor[typeId] = enterExit;
|
|
22340
22324
|
}
|
|
22341
22325
|
let visitState = 1;
|
|
22342
|
-
if (
|
|
22326
|
+
if (activeCfgVisitorsCount > 0) {
|
|
22343
22327
|
visitState = 2;
|
|
22344
|
-
for (let i =
|
|
22328
|
+
for (let i = activeCfgVisitorsCount - 1; i >= 0; i--) {
|
|
22345
22329
|
let typeId = activeCfgVisitorTypeIds[i];
|
|
22346
22330
|
compiledVisitor[typeId] = mergeCfgVisitFns(compilingCfgVisitor[typeId - 165]);
|
|
22347
22331
|
}
|
|
22348
|
-
|
|
22332
|
+
activeCfgVisitorsCount = 0;
|
|
22349
22333
|
}
|
|
22350
22334
|
for (let i = visitPropsCacheNextIndex - 1; i >= 0; i--) visitPropsCache[i].fn = null, visitPropsCache[i].selectorStr = null;
|
|
22351
|
-
return visitPropsCacheNextIndex = 0,
|
|
22335
|
+
return visitPropsCacheNextIndex = 0, activeLeafVisitorsCount = 0, hasActiveVisitors = !1, visitState;
|
|
22336
|
+
}
|
|
22337
|
+
/**
|
|
22338
|
+
* Reset compiled visitor.
|
|
22339
|
+
*
|
|
22340
|
+
* This frees visit functions stored in `compiledVisitor`, and makes them eligible for garbage collection.
|
|
22341
|
+
*
|
|
22342
|
+
* After calling this function, `compiledVisitor` is in a clean state, ready for next file's visitor to be compiled.
|
|
22343
|
+
*/
|
|
22344
|
+
function resetCompiledVisitor() {
|
|
22345
|
+
compiledVisitor.fill(null);
|
|
22346
|
+
for (let i = 0; i < activeNonLeafVisitorsCount; i++) {
|
|
22347
|
+
let enterExit = enterExitObjectCache[i];
|
|
22348
|
+
enterExit.enter = null, enterExit.exit = null;
|
|
22349
|
+
}
|
|
22350
|
+
activeNonLeafVisitorsCount = 0;
|
|
22352
22351
|
}
|
|
22353
22352
|
const visitFns = [];
|
|
22354
22353
|
/**
|
|
@@ -22521,7 +22520,7 @@ function lintFileImpl(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJ
|
|
|
22521
22520
|
}
|
|
22522
22521
|
workspaceUri !== null && switchWorkspace(workspaceUri), setupFileContext(filePath);
|
|
22523
22522
|
let hasBOM = buffer[2147483614] === 1;
|
|
22524
|
-
setupSourceForFile(buffer, hasBOM), setSettingsForFile(settingsJSON), setGlobalsForFile(globalsJSON)
|
|
22523
|
+
setupSourceForFile(buffer, hasBOM), setSettingsForFile(settingsJSON), setGlobalsForFile(globalsJSON);
|
|
22525
22524
|
for (let i = 0, len = ruleIds.length; i < len; i++) {
|
|
22526
22525
|
let ruleDetails = registeredRules[ruleIds[i]];
|
|
22527
22526
|
ruleDetails.ruleIndex = i;
|
|
@@ -22537,12 +22536,35 @@ function lintFileImpl(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJ
|
|
|
22537
22536
|
addVisitorToCompiled(visitor);
|
|
22538
22537
|
}
|
|
22539
22538
|
let visitorState = finalizeCompiledVisitor();
|
|
22540
|
-
visitorState !== 0 && (ast === null && initAst(), visitorState === 2 ? walkProgramWithCfg(ast, compiledVisitor) : walkProgram(ast, compiledVisitor));
|
|
22539
|
+
visitorState !== 0 && (ast === null && initAst(), visitorState === 2 ? walkProgramWithCfg(ast, compiledVisitor) : walkProgram(ast, compiledVisitor), resetCompiledVisitor()), runAfterHooks(!0);
|
|
22540
|
+
}
|
|
22541
|
+
/**
|
|
22542
|
+
* Run any `after` hooks.
|
|
22543
|
+
*
|
|
22544
|
+
* Rules using `before` and `after` hooks likely maintain some internal state in their `createOnce` method.
|
|
22545
|
+
* To keep that state in sync, it's critical that `after` hooks always run, even if an error is thrown during any of:
|
|
22546
|
+
*
|
|
22547
|
+
* 1. A later rule's `before` hook.
|
|
22548
|
+
* 2. AST walk.
|
|
22549
|
+
* 3. An earlier rule's `after` hook.
|
|
22550
|
+
*
|
|
22551
|
+
* So if any `after` hook throws an error, this function continues running remaining hooks, and re-throws the error
|
|
22552
|
+
* only at the very end. This ensures an error in one rule does not affect any other rules.
|
|
22553
|
+
*
|
|
22554
|
+
* This function is called by `resetStateAfterError` to ensure `after` hooks are run no matter where an error occurs.
|
|
22555
|
+
*
|
|
22556
|
+
* @param shouldThrowIfError - `true` if any errors thrown in after hooks should be re-thrown
|
|
22557
|
+
*/
|
|
22558
|
+
function runAfterHooks(shouldThrowIfError) {
|
|
22541
22559
|
let afterHooksLen = afterHooks.length;
|
|
22542
|
-
if (afterHooksLen
|
|
22543
|
-
|
|
22544
|
-
|
|
22560
|
+
if (afterHooksLen === 0) return;
|
|
22561
|
+
let error, didError = !1;
|
|
22562
|
+
for (let i = 0; i < afterHooksLen; i++) try {
|
|
22563
|
+
(0, afterHooks[i])();
|
|
22564
|
+
} catch (err) {
|
|
22565
|
+
didError === !1 && (error = err, didError = !0);
|
|
22545
22566
|
}
|
|
22567
|
+
if (afterHooks.length = 0, didError && shouldThrowIfError) throw error;
|
|
22546
22568
|
}
|
|
22547
22569
|
/**
|
|
22548
22570
|
* Reset file context, source, AST, and settings, to free memory.
|
|
@@ -22555,7 +22577,7 @@ function resetFile() {
|
|
|
22555
22577
|
* in the correct initial state for linting the next file.
|
|
22556
22578
|
*/
|
|
22557
22579
|
function resetStateAfterError() {
|
|
22558
|
-
diagnostics.length = 0, ancestors.length = 0, resetFile(), resetCfgWalk();
|
|
22580
|
+
runAfterHooks(!1), finalizeCompiledVisitor(), resetCompiledVisitor(), diagnostics.length = 0, ancestors.length = 0, resetFile(), resetCfgWalk();
|
|
22559
22581
|
}
|
|
22560
22582
|
//#endregion
|
|
22561
22583
|
export { BUFFER_SIZE as _, loadPlugin as a, __toESM as b, allOptions as c, diagnostics as d, replacePlaceholders as f, BUFFER_ALIGN as g, ACTIVE_SIZE as h, resetStateAfterError as i, setOptions as l, getNodeByRangeIndex as m, lintFile as n, registerPlugin as o, getLineColumnFromOffset as p, lintFileImpl as r, registeredRules as s, buffers as t, PLACEHOLDER_REGEX as u, DATA_POINTER_POS_32 as v, __commonJSMin as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.53.0",
|
|
4
4
|
"description": "Linter for the JavaScript Oxidation Compiler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -82,24 +82,24 @@
|
|
|
82
82
|
},
|
|
83
83
|
"preferUnplugged": true,
|
|
84
84
|
"optionalDependencies": {
|
|
85
|
-
"@oxlint/binding-darwin-arm64": "1.
|
|
86
|
-
"@oxlint/binding-android-arm64": "1.
|
|
87
|
-
"@oxlint/binding-win32-arm64-msvc": "1.
|
|
88
|
-
"@oxlint/binding-linux-arm64-gnu": "1.
|
|
89
|
-
"@oxlint/binding-linux-arm64-musl": "1.
|
|
90
|
-
"@oxlint/binding-openharmony-arm64": "1.
|
|
91
|
-
"@oxlint/binding-android-arm-eabi": "1.
|
|
92
|
-
"@oxlint/binding-linux-arm-gnueabihf": "1.
|
|
93
|
-
"@oxlint/binding-linux-arm-musleabihf": "1.
|
|
94
|
-
"@oxlint/binding-win32-ia32-msvc": "1.
|
|
95
|
-
"@oxlint/binding-linux-ppc64-gnu": "1.
|
|
96
|
-
"@oxlint/binding-linux-riscv64-gnu": "1.
|
|
97
|
-
"@oxlint/binding-linux-riscv64-musl": "1.
|
|
98
|
-
"@oxlint/binding-linux-s390x-gnu": "1.
|
|
99
|
-
"@oxlint/binding-darwin-x64": "1.
|
|
100
|
-
"@oxlint/binding-win32-x64-msvc": "1.
|
|
101
|
-
"@oxlint/binding-freebsd-x64": "1.
|
|
102
|
-
"@oxlint/binding-linux-x64-gnu": "1.
|
|
103
|
-
"@oxlint/binding-linux-x64-musl": "1.
|
|
85
|
+
"@oxlint/binding-darwin-arm64": "1.53.0",
|
|
86
|
+
"@oxlint/binding-android-arm64": "1.53.0",
|
|
87
|
+
"@oxlint/binding-win32-arm64-msvc": "1.53.0",
|
|
88
|
+
"@oxlint/binding-linux-arm64-gnu": "1.53.0",
|
|
89
|
+
"@oxlint/binding-linux-arm64-musl": "1.53.0",
|
|
90
|
+
"@oxlint/binding-openharmony-arm64": "1.53.0",
|
|
91
|
+
"@oxlint/binding-android-arm-eabi": "1.53.0",
|
|
92
|
+
"@oxlint/binding-linux-arm-gnueabihf": "1.53.0",
|
|
93
|
+
"@oxlint/binding-linux-arm-musleabihf": "1.53.0",
|
|
94
|
+
"@oxlint/binding-win32-ia32-msvc": "1.53.0",
|
|
95
|
+
"@oxlint/binding-linux-ppc64-gnu": "1.53.0",
|
|
96
|
+
"@oxlint/binding-linux-riscv64-gnu": "1.53.0",
|
|
97
|
+
"@oxlint/binding-linux-riscv64-musl": "1.53.0",
|
|
98
|
+
"@oxlint/binding-linux-s390x-gnu": "1.53.0",
|
|
99
|
+
"@oxlint/binding-darwin-x64": "1.53.0",
|
|
100
|
+
"@oxlint/binding-win32-x64-msvc": "1.53.0",
|
|
101
|
+
"@oxlint/binding-freebsd-x64": "1.53.0",
|
|
102
|
+
"@oxlint/binding-linux-x64-gnu": "1.53.0",
|
|
103
|
+
"@oxlint/binding-linux-x64-musl": "1.53.0"
|
|
104
104
|
}
|
|
105
105
|
}
|