oxlint 1.35.0 → 1.36.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/chunk.js +2 -2
- package/dist/index.d.ts +27 -12
- package/dist/index.js +16 -8
- package/dist/lint.js +689 -69
- package/package.json +9 -9
package/dist/bindings.js
CHANGED
|
@@ -36,7 +36,7 @@ function requireNative() {
|
|
|
36
36
|
}
|
|
37
37
|
try {
|
|
38
38
|
let binding = require("@oxlint/android-arm64"), bindingPackageVersion = require("@oxlint/android-arm64/package.json").version;
|
|
39
|
-
if (bindingPackageVersion !== "1.
|
|
39
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
40
40
|
return binding;
|
|
41
41
|
} catch (e) {
|
|
42
42
|
loadErrors.push(e);
|
|
@@ -49,7 +49,7 @@ function requireNative() {
|
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
51
|
let binding = require("@oxlint/android-arm-eabi"), bindingPackageVersion = require("@oxlint/android-arm-eabi/package.json").version;
|
|
52
|
-
if (bindingPackageVersion !== "1.
|
|
52
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
53
53
|
return binding;
|
|
54
54
|
} catch (e) {
|
|
55
55
|
loadErrors.push(e);
|
|
@@ -63,7 +63,7 @@ function requireNative() {
|
|
|
63
63
|
}
|
|
64
64
|
try {
|
|
65
65
|
let binding = require("@oxlint/win32-x64-gnu"), bindingPackageVersion = require("@oxlint/win32-x64-gnu/package.json").version;
|
|
66
|
-
if (bindingPackageVersion !== "1.
|
|
66
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
67
67
|
return binding;
|
|
68
68
|
} catch (e) {
|
|
69
69
|
loadErrors.push(e);
|
|
@@ -76,7 +76,7 @@ function requireNative() {
|
|
|
76
76
|
}
|
|
77
77
|
try {
|
|
78
78
|
let binding = require("@oxlint/win32-x64"), bindingPackageVersion = require("@oxlint/win32-x64/package.json").version;
|
|
79
|
-
if (bindingPackageVersion !== "1.
|
|
79
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
80
80
|
return binding;
|
|
81
81
|
} catch (e) {
|
|
82
82
|
loadErrors.push(e);
|
|
@@ -90,7 +90,7 @@ function requireNative() {
|
|
|
90
90
|
}
|
|
91
91
|
try {
|
|
92
92
|
let binding = require("@oxlint/win32-ia32"), bindingPackageVersion = require("@oxlint/win32-ia32/package.json").version;
|
|
93
|
-
if (bindingPackageVersion !== "1.
|
|
93
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
94
94
|
return binding;
|
|
95
95
|
} catch (e) {
|
|
96
96
|
loadErrors.push(e);
|
|
@@ -103,7 +103,7 @@ function requireNative() {
|
|
|
103
103
|
}
|
|
104
104
|
try {
|
|
105
105
|
let binding = require("@oxlint/win32-arm64"), bindingPackageVersion = require("@oxlint/win32-arm64/package.json").version;
|
|
106
|
-
if (bindingPackageVersion !== "1.
|
|
106
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
107
107
|
return binding;
|
|
108
108
|
} catch (e) {
|
|
109
109
|
loadErrors.push(e);
|
|
@@ -117,7 +117,7 @@ function requireNative() {
|
|
|
117
117
|
}
|
|
118
118
|
try {
|
|
119
119
|
let binding = require("@oxlint/darwin-universal"), bindingPackageVersion = require("@oxlint/darwin-universal/package.json").version;
|
|
120
|
-
if (bindingPackageVersion !== "1.
|
|
120
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
121
121
|
return binding;
|
|
122
122
|
} catch (e) {
|
|
123
123
|
loadErrors.push(e);
|
|
@@ -130,7 +130,7 @@ function requireNative() {
|
|
|
130
130
|
}
|
|
131
131
|
try {
|
|
132
132
|
let binding = require("@oxlint/darwin-x64"), bindingPackageVersion = require("@oxlint/darwin-x64/package.json").version;
|
|
133
|
-
if (bindingPackageVersion !== "1.
|
|
133
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
134
134
|
return binding;
|
|
135
135
|
} catch (e) {
|
|
136
136
|
loadErrors.push(e);
|
|
@@ -143,7 +143,7 @@ function requireNative() {
|
|
|
143
143
|
}
|
|
144
144
|
try {
|
|
145
145
|
let binding = require("@oxlint/darwin-arm64"), bindingPackageVersion = require("@oxlint/darwin-arm64/package.json").version;
|
|
146
|
-
if (bindingPackageVersion !== "1.
|
|
146
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
147
147
|
return binding;
|
|
148
148
|
} catch (e) {
|
|
149
149
|
loadErrors.push(e);
|
|
@@ -157,7 +157,7 @@ function requireNative() {
|
|
|
157
157
|
}
|
|
158
158
|
try {
|
|
159
159
|
let binding = require("@oxlint/freebsd-x64"), bindingPackageVersion = require("@oxlint/freebsd-x64/package.json").version;
|
|
160
|
-
if (bindingPackageVersion !== "1.
|
|
160
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
161
161
|
return binding;
|
|
162
162
|
} catch (e) {
|
|
163
163
|
loadErrors.push(e);
|
|
@@ -170,7 +170,7 @@ function requireNative() {
|
|
|
170
170
|
}
|
|
171
171
|
try {
|
|
172
172
|
let binding = require("@oxlint/freebsd-arm64"), bindingPackageVersion = require("@oxlint/freebsd-arm64/package.json").version;
|
|
173
|
-
if (bindingPackageVersion !== "1.
|
|
173
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
174
174
|
return binding;
|
|
175
175
|
} catch (e) {
|
|
176
176
|
loadErrors.push(e);
|
|
@@ -184,7 +184,7 @@ function requireNative() {
|
|
|
184
184
|
}
|
|
185
185
|
try {
|
|
186
186
|
let binding = require("@oxlint/linux-x64-musl"), bindingPackageVersion = require("@oxlint/linux-x64-musl/package.json").version;
|
|
187
|
-
if (bindingPackageVersion !== "1.
|
|
187
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
188
188
|
return binding;
|
|
189
189
|
} catch (e) {
|
|
190
190
|
loadErrors.push(e);
|
|
@@ -197,7 +197,7 @@ function requireNative() {
|
|
|
197
197
|
}
|
|
198
198
|
try {
|
|
199
199
|
let binding = require("@oxlint/linux-x64-gnu"), bindingPackageVersion = require("@oxlint/linux-x64-gnu/package.json").version;
|
|
200
|
-
if (bindingPackageVersion !== "1.
|
|
200
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
201
201
|
return binding;
|
|
202
202
|
} catch (e) {
|
|
203
203
|
loadErrors.push(e);
|
|
@@ -211,7 +211,7 @@ function requireNative() {
|
|
|
211
211
|
}
|
|
212
212
|
try {
|
|
213
213
|
let binding = require("@oxlint/linux-arm64-musl"), bindingPackageVersion = require("@oxlint/linux-arm64-musl/package.json").version;
|
|
214
|
-
if (bindingPackageVersion !== "1.
|
|
214
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
215
215
|
return binding;
|
|
216
216
|
} catch (e) {
|
|
217
217
|
loadErrors.push(e);
|
|
@@ -224,7 +224,7 @@ function requireNative() {
|
|
|
224
224
|
}
|
|
225
225
|
try {
|
|
226
226
|
let binding = require("@oxlint/linux-arm64-gnu"), bindingPackageVersion = require("@oxlint/linux-arm64-gnu/package.json").version;
|
|
227
|
-
if (bindingPackageVersion !== "1.
|
|
227
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
228
228
|
return binding;
|
|
229
229
|
} catch (e) {
|
|
230
230
|
loadErrors.push(e);
|
|
@@ -238,7 +238,7 @@ function requireNative() {
|
|
|
238
238
|
}
|
|
239
239
|
try {
|
|
240
240
|
let binding = require("@oxlint/linux-arm-musleabihf"), bindingPackageVersion = require("@oxlint/linux-arm-musleabihf/package.json").version;
|
|
241
|
-
if (bindingPackageVersion !== "1.
|
|
241
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
242
242
|
return binding;
|
|
243
243
|
} catch (e) {
|
|
244
244
|
loadErrors.push(e);
|
|
@@ -251,7 +251,7 @@ function requireNative() {
|
|
|
251
251
|
}
|
|
252
252
|
try {
|
|
253
253
|
let binding = require("@oxlint/linux-arm-gnueabihf"), bindingPackageVersion = require("@oxlint/linux-arm-gnueabihf/package.json").version;
|
|
254
|
-
if (bindingPackageVersion !== "1.
|
|
254
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
255
255
|
return binding;
|
|
256
256
|
} catch (e) {
|
|
257
257
|
loadErrors.push(e);
|
|
@@ -265,7 +265,7 @@ function requireNative() {
|
|
|
265
265
|
}
|
|
266
266
|
try {
|
|
267
267
|
let binding = require("@oxlint/linux-loong64-musl"), bindingPackageVersion = require("@oxlint/linux-loong64-musl/package.json").version;
|
|
268
|
-
if (bindingPackageVersion !== "1.
|
|
268
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
269
269
|
return binding;
|
|
270
270
|
} catch (e) {
|
|
271
271
|
loadErrors.push(e);
|
|
@@ -278,7 +278,7 @@ function requireNative() {
|
|
|
278
278
|
}
|
|
279
279
|
try {
|
|
280
280
|
let binding = require("@oxlint/linux-loong64-gnu"), bindingPackageVersion = require("@oxlint/linux-loong64-gnu/package.json").version;
|
|
281
|
-
if (bindingPackageVersion !== "1.
|
|
281
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
282
282
|
return binding;
|
|
283
283
|
} catch (e) {
|
|
284
284
|
loadErrors.push(e);
|
|
@@ -292,7 +292,7 @@ function requireNative() {
|
|
|
292
292
|
}
|
|
293
293
|
try {
|
|
294
294
|
let binding = require("@oxlint/linux-riscv64-musl"), bindingPackageVersion = require("@oxlint/linux-riscv64-musl/package.json").version;
|
|
295
|
-
if (bindingPackageVersion !== "1.
|
|
295
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
296
296
|
return binding;
|
|
297
297
|
} catch (e) {
|
|
298
298
|
loadErrors.push(e);
|
|
@@ -305,7 +305,7 @@ function requireNative() {
|
|
|
305
305
|
}
|
|
306
306
|
try {
|
|
307
307
|
let binding = require("@oxlint/linux-riscv64-gnu"), bindingPackageVersion = require("@oxlint/linux-riscv64-gnu/package.json").version;
|
|
308
|
-
if (bindingPackageVersion !== "1.
|
|
308
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
309
309
|
return binding;
|
|
310
310
|
} catch (e) {
|
|
311
311
|
loadErrors.push(e);
|
|
@@ -319,7 +319,7 @@ function requireNative() {
|
|
|
319
319
|
}
|
|
320
320
|
try {
|
|
321
321
|
let binding = require("@oxlint/linux-ppc64-gnu"), bindingPackageVersion = require("@oxlint/linux-ppc64-gnu/package.json").version;
|
|
322
|
-
if (bindingPackageVersion !== "1.
|
|
322
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
323
323
|
return binding;
|
|
324
324
|
} catch (e) {
|
|
325
325
|
loadErrors.push(e);
|
|
@@ -332,7 +332,7 @@ function requireNative() {
|
|
|
332
332
|
}
|
|
333
333
|
try {
|
|
334
334
|
let binding = require("@oxlint/linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/linux-s390x-gnu/package.json").version;
|
|
335
|
-
if (bindingPackageVersion !== "1.
|
|
335
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
336
336
|
return binding;
|
|
337
337
|
} catch (e) {
|
|
338
338
|
loadErrors.push(e);
|
|
@@ -346,7 +346,7 @@ function requireNative() {
|
|
|
346
346
|
}
|
|
347
347
|
try {
|
|
348
348
|
let binding = require("@oxlint/openharmony-arm64"), bindingPackageVersion = require("@oxlint/openharmony-arm64/package.json").version;
|
|
349
|
-
if (bindingPackageVersion !== "1.
|
|
349
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
350
350
|
return binding;
|
|
351
351
|
} catch (e) {
|
|
352
352
|
loadErrors.push(e);
|
|
@@ -359,7 +359,7 @@ function requireNative() {
|
|
|
359
359
|
}
|
|
360
360
|
try {
|
|
361
361
|
let binding = require("@oxlint/openharmony-x64"), bindingPackageVersion = require("@oxlint/openharmony-x64/package.json").version;
|
|
362
|
-
if (bindingPackageVersion !== "1.
|
|
362
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
363
363
|
return binding;
|
|
364
364
|
} catch (e) {
|
|
365
365
|
loadErrors.push(e);
|
|
@@ -372,7 +372,7 @@ function requireNative() {
|
|
|
372
372
|
}
|
|
373
373
|
try {
|
|
374
374
|
let binding = require("@oxlint/openharmony-arm"), bindingPackageVersion = require("@oxlint/openharmony-arm/package.json").version;
|
|
375
|
-
if (bindingPackageVersion !== "1.
|
|
375
|
+
if (bindingPackageVersion !== "1.36.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.36.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
376
376
|
return binding;
|
|
377
377
|
} catch (e) {
|
|
378
378
|
loadErrors.push(e);
|
package/dist/chunk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports),
|
|
2
|
+
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), __exportAll = (all, symbols) => {
|
|
3
3
|
let target = {};
|
|
4
4
|
for (var name in all) __defProp(target, name, {
|
|
5
5
|
get: all[name],
|
|
@@ -16,4 +16,4 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
16
16
|
value: mod,
|
|
17
17
|
enumerable: !0
|
|
18
18
|
}) : target, mod)), __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
19
|
-
export { __toESM as i,
|
|
19
|
+
export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
* Globals are deserialized from JSON, so can only contain JSON-compatible values.
|
|
6
6
|
* Each global variable maps to "readonly", "writable", or "off".
|
|
7
7
|
*/
|
|
8
|
-
type Globals
|
|
8
|
+
type Globals = Record<string, "readonly" | "writable" | "off">;
|
|
9
|
+
/**
|
|
10
|
+
* Environments for the file being linted.
|
|
11
|
+
*
|
|
12
|
+
* Only includes environments that are enabled, so all properties are `true`.
|
|
13
|
+
*/
|
|
14
|
+
type Envs = Record<string, true>;
|
|
9
15
|
//#endregion
|
|
10
16
|
//#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
|
|
11
17
|
// ==================================================================================================
|
|
@@ -1334,7 +1340,7 @@ declare function isSpaceBetween(first: NodeOrToken, second: NodeOrToken): boolea
|
|
|
1334
1340
|
*/
|
|
1335
1341
|
declare function isSpaceBetweenTokens(first: NodeOrToken, second: NodeOrToken): boolean;
|
|
1336
1342
|
declare namespace types_d_exports {
|
|
1337
|
-
export { AccessorProperty, AccessorPropertyType, Argument, ArrayAssignmentTarget, ArrayExpression, ArrayExpressionElement, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentTarget, AssignmentTargetMaybeDefault, AssignmentTargetPattern, AssignmentTargetProperty, AssignmentTargetPropertyIdentifier, AssignmentTargetPropertyProperty, AssignmentTargetRest, AssignmentTargetWithDefault, AwaitExpression, BigIntLiteral, BinaryExpression, BinaryOperator, BindingIdentifier, BindingPattern,
|
|
1343
|
+
export { AccessorProperty, AccessorPropertyType, Argument, ArrayAssignmentTarget, ArrayExpression, ArrayExpressionElement, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentTarget, AssignmentTargetMaybeDefault, AssignmentTargetPattern, AssignmentTargetProperty, AssignmentTargetPropertyIdentifier, AssignmentTargetPropertyProperty, AssignmentTargetRest, AssignmentTargetWithDefault, AwaitExpression, BigIntLiteral, BinaryExpression, BinaryOperator, BindingIdentifier, BindingPattern, BindingProperty, BindingRestElement, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CatchClause, ChainElement, ChainExpression, Class, ClassBody, ClassElement, ClassType, Comment, ComputedMemberExpression, ConditionalExpression, ContinueStatement, DebuggerStatement, Declaration, Decorator, Directive, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclaration, ExportDefaultDeclarationKind, ExportNamedDeclaration, ExportSpecifier, Expression, ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, ForStatementInit, ForStatementLeft, FormalParameter, FormalParameterRest, Function$1 as Function, FunctionBody, FunctionType, Hashbang, IdentifierName, IdentifierReference, IfStatement, ImportAttribute, ImportAttributeKey, ImportDeclaration, ImportDeclarationSpecifier, ImportDefaultSpecifier, ImportExpression, ImportNamespaceSpecifier, ImportOrExportKind, ImportPhase, ImportSpecifier, JSDocNonNullableType, JSDocNullableType, JSDocUnknownType, JSXAttribute, JSXAttributeItem, JSXAttributeName, JSXAttributeValue, JSXChild, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementName, JSXEmptyExpression, JSXExpression, JSXExpressionContainer, JSXFragment, JSXIdentifier, JSXMemberExpression, JSXMemberExpressionObject, JSXNamespacedName, JSXOpeningElement, JSXOpeningFragment, JSXSpreadAttribute, JSXSpreadChild, JSXText, LabelIdentifier, LabeledStatement, LogicalExpression, LogicalOperator, MemberExpression, MetaProperty, MethodDefinition, MethodDefinitionKind, MethodDefinitionType, ModuleDeclaration, ModuleExportName, ModuleKind, NewExpression, Node$1 as Node, NullLiteral, NumericLiteral, ObjectAssignmentTarget, ObjectExpression, ObjectPattern, ObjectProperty, ObjectPropertyKind, ParamPattern, ParenthesizedExpression, PrivateFieldExpression, PrivateIdentifier, PrivateInExpression, Program, PropertyDefinition, PropertyDefinitionType, PropertyKey$1 as PropertyKey, PropertyKind, RegExpLiteral, ReturnStatement, SequenceExpression, SimpleAssignmentTarget, Span, SpreadElement, Statement, StaticBlock, StaticMemberExpression, StringLiteral, Super, SwitchCase, SwitchStatement, TSAccessibility, TSAnyKeyword, TSArrayType, TSAsExpression, TSBigIntKeyword, TSBooleanKeyword, TSCallSignatureDeclaration, TSClassImplements, TSConditionalType, TSConstructSignatureDeclaration, TSConstructorType, TSEnumBody, TSEnumDeclaration, TSEnumMember, TSEnumMemberName, TSExportAssignment, TSExternalModuleReference, TSFunctionType, TSGlobalDeclaration, TSImportEqualsDeclaration, TSImportType, TSImportTypeQualifiedName, TSImportTypeQualifier, TSIndexSignature, TSIndexSignatureName, TSIndexedAccessType, TSInferType, TSInstantiationExpression, TSInterfaceBody, TSInterfaceDeclaration, TSInterfaceHeritage, TSIntersectionType, TSIntrinsicKeyword, TSLiteral, TSLiteralType, TSMappedType, TSMappedTypeModifierOperator, TSMethodSignature, TSMethodSignatureKind, TSModuleBlock, TSModuleDeclaration, TSModuleDeclarationKind, TSModuleReference, TSNamedTupleMember, TSNamespaceExportDeclaration, TSNeverKeyword, TSNonNullExpression, TSNullKeyword, TSNumberKeyword, TSObjectKeyword, TSOptionalType, TSParameterProperty, TSParenthesizedType, TSPropertySignature, TSQualifiedName, TSRestType, TSSatisfiesExpression, TSSignature, TSStringKeyword, TSSymbolKeyword, TSTemplateLiteralType, TSThisParameter, TSThisType, TSTupleElement, TSTupleType, TSType, TSTypeAliasDeclaration, TSTypeAnnotation, TSTypeAssertion, TSTypeLiteral, TSTypeName, TSTypeOperator, TSTypeOperatorOperator, TSTypeParameter, TSTypeParameterDeclaration, TSTypeParameterInstantiation, TSTypePredicate, TSTypePredicateName, TSTypeQuery, TSTypeQueryExprName, TSTypeReference, TSUndefinedKeyword, TSUnionType, TSUnknownKeyword, TSVoidKeyword, TaggedTemplateExpression, TemplateElement, TemplateElementValue, TemplateLiteral, ThisExpression, ThrowStatement, Token, TryStatement, UnaryExpression, UnaryOperator, UpdateExpression, UpdateOperator, V8IntrinsicExpression, VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WhileStatement, WithStatement, YieldExpression };
|
|
1338
1344
|
}
|
|
1339
1345
|
interface Program extends Span {
|
|
1340
1346
|
type: "Program";
|
|
@@ -1765,11 +1771,7 @@ interface DebuggerStatement extends Span {
|
|
|
1765
1771
|
type: "DebuggerStatement";
|
|
1766
1772
|
parent: Node$1;
|
|
1767
1773
|
}
|
|
1768
|
-
type BindingPattern =
|
|
1769
|
-
optional?: boolean;
|
|
1770
|
-
typeAnnotation?: TSTypeAnnotation | null;
|
|
1771
|
-
} & (BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern);
|
|
1772
|
-
type BindingPatternKind = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern;
|
|
1774
|
+
type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern;
|
|
1773
1775
|
interface AssignmentPattern extends Span {
|
|
1774
1776
|
type: "AssignmentPattern";
|
|
1775
1777
|
decorators?: [];
|
|
@@ -1832,7 +1834,7 @@ type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest;
|
|
|
1832
1834
|
type FunctionType = "FunctionDeclaration" | "FunctionExpression" | "TSDeclareFunction" | "TSEmptyBodyFunctionExpression";
|
|
1833
1835
|
interface FormalParameterRest extends Span {
|
|
1834
1836
|
type: "RestElement";
|
|
1835
|
-
argument:
|
|
1837
|
+
argument: BindingPattern;
|
|
1836
1838
|
decorators?: [];
|
|
1837
1839
|
optional?: boolean;
|
|
1838
1840
|
typeAnnotation?: TSTypeAnnotation | null;
|
|
@@ -3615,7 +3617,11 @@ declare const LANGUAGE_OPTIONS: {
|
|
|
3615
3617
|
/**
|
|
3616
3618
|
* Globals defined for the file being linted.
|
|
3617
3619
|
*/
|
|
3618
|
-
readonly globals: Readonly<Globals
|
|
3620
|
+
readonly globals: Readonly<Globals>;
|
|
3621
|
+
/**
|
|
3622
|
+
* Environments defined for the file being linted.
|
|
3623
|
+
*/
|
|
3624
|
+
readonly env: Readonly<Envs>;
|
|
3619
3625
|
};
|
|
3620
3626
|
/**
|
|
3621
3627
|
* Language options used when parsing a file.
|
|
@@ -3951,7 +3957,8 @@ interface Config {
|
|
|
3951
3957
|
*/
|
|
3952
3958
|
interface LanguageOptions$1 {
|
|
3953
3959
|
sourceType?: SourceType;
|
|
3954
|
-
globals?: Globals;
|
|
3960
|
+
globals?: Globals$1;
|
|
3961
|
+
env?: Envs$1;
|
|
3955
3962
|
parserOptions?: ParserOptions;
|
|
3956
3963
|
}
|
|
3957
3964
|
/**
|
|
@@ -3970,7 +3977,11 @@ type GlobalValue = boolean | "true" | "writable" | "writeable" | "false" | "read
|
|
|
3970
3977
|
/**
|
|
3971
3978
|
* Globals object.
|
|
3972
3979
|
*/
|
|
3973
|
-
type Globals = Record<string, GlobalValue>;
|
|
3980
|
+
type Globals$1 = Record<string, GlobalValue>;
|
|
3981
|
+
/**
|
|
3982
|
+
* Environments for the file being linted.
|
|
3983
|
+
*/
|
|
3984
|
+
type Envs$1 = Record<string, boolean>;
|
|
3974
3985
|
/**
|
|
3975
3986
|
* Parser options config.
|
|
3976
3987
|
*/
|
|
@@ -4095,6 +4106,8 @@ declare class RuleTester {
|
|
|
4095
4106
|
}
|
|
4096
4107
|
type _Config = Config;
|
|
4097
4108
|
type _LanguageOptions = LanguageOptions$1;
|
|
4109
|
+
type _Globals = Globals$1;
|
|
4110
|
+
type _Envs = Envs$1;
|
|
4098
4111
|
type _ParserOptions = ParserOptions;
|
|
4099
4112
|
type _SourceType = SourceType;
|
|
4100
4113
|
type _Language = Language;
|
|
@@ -4108,6 +4121,8 @@ type _Error = Error;
|
|
|
4108
4121
|
declare namespace RuleTester {
|
|
4109
4122
|
type Config = _Config;
|
|
4110
4123
|
type LanguageOptions = _LanguageOptions;
|
|
4124
|
+
type Globals = _Globals;
|
|
4125
|
+
type Envs = _Envs;
|
|
4111
4126
|
type ParserOptions = _ParserOptions;
|
|
4112
4127
|
type SourceType = _SourceType;
|
|
4113
4128
|
type Language = _Language;
|
|
@@ -4120,4 +4135,4 @@ declare namespace RuleTester {
|
|
|
4120
4135
|
type Error = _Error;
|
|
4121
4136
|
}
|
|
4122
4137
|
//#endregion
|
|
4123
|
-
export { type AfterHook, type BeforeHook, type BooleanToken, type Comment, type Context, type CountOptions, type CreateOnceRule, type CreateRule, type Definition, type DefinitionType, type Diagnostic, type DiagnosticData, type types_d_exports as ESTree, type FilterFn, type Fix, type FixFn, type Fixer, type IdentifierToken, type JSXIdentifierToken, type JSXTextToken, type KeywordToken, type LanguageOptions, type LineColumn, type Location, type Node, type NullToken, type NumericToken, type Options, type Plugin, type PrivateIdentifierToken, type PunctuatorToken, type Range, type RangeOptions, type Ranged, type Reference, type RegularExpressionToken, type Rule, type RuleDeprecatedInfo, type RuleDocs, type RuleMeta, type RuleOptionsSchema, type RuleReplacedByExternalSpecifier, type RuleReplacedByInfo, RuleTester, type Scope, type ScopeManager, type ScopeType, type Settings, type SkipOptions, type SourceCode, type Span, type StringToken, type Suggestion, type TemplateToken, type Token, type Variable, type VisitorObject as Visitor, type VisitorWithHooks, definePlugin, defineRule };
|
|
4138
|
+
export { type AfterHook, type BeforeHook, type BooleanToken, type Comment, type Context, type CountOptions, type CreateOnceRule, type CreateRule, type Definition, type DefinitionType, type Diagnostic, type DiagnosticData, type types_d_exports as ESTree, type Envs, type FilterFn, type Fix, type FixFn, type Fixer, type Globals, type IdentifierToken, type JSXIdentifierToken, type JSXTextToken, type KeywordToken, type LanguageOptions, type LineColumn, type Location, type Node, type NullToken, type NumericToken, type Options, type Plugin, type PrivateIdentifierToken, type PunctuatorToken, type Range, type RangeOptions, type Ranged, type Reference, type RegularExpressionToken, type Rule, type RuleDeprecatedInfo, type RuleDocs, type RuleMeta, type RuleOptionsSchema, type RuleReplacedByExternalSpecifier, type RuleReplacedByInfo, RuleTester, type Scope, type ScopeManager, type ScopeType, type Settings, type SkipOptions, type SourceCode, type Span, type StringToken, type Suggestion, type TemplateToken, type Token, type Variable, type VisitorObject as Visitor, type VisitorWithHooks, definePlugin, defineRule };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __toESM, t as __commonJSMin } from "./chunk.js";
|
|
2
2
|
import { i as rawTransferSupported$1, r as parseRawSync, t as getBufferOffset } from "./bindings.js";
|
|
3
|
-
import { A as
|
|
3
|
+
import { A as ObjectHasOwn, C as ObjectAssign, D as ObjectEntries, E as ObjectDefineProperty, M as ObjectSetPrototypeOf, N as ObjectValues, O as ObjectFreeze, S as JSONStringify, T as ObjectDefineProperties, _ as BUFFER_ALIGN, b as ArrayFrom, d as setOptions, f as PLACEHOLDER_REGEX, g as getNodeByRangeIndex, h as getLineColumnFromOffset, i as resetStateAfterError, j as ObjectKeys, k as ObjectGetPrototypeOf, l as DEFAULT_OPTIONS_ID, m as replacePlaceholders, o as registerPlugin, p as diagnostics, r as lintFileImpl, s as registeredRules, t as buffers, u as allOptions, v as BUFFER_SIZE, w as ObjectCreate, x as ArrayIsArray, y as DATA_POINTER_POS_32 } from "./lint.js";
|
|
4
4
|
import assert, { AssertionError } from "node:assert";
|
|
5
5
|
import util from "node:util";
|
|
6
6
|
const EMPTY_VISITOR = {};
|
|
@@ -449,11 +449,9 @@ function getParseOptions(test) {
|
|
|
449
449
|
return parseOptions;
|
|
450
450
|
}
|
|
451
451
|
function getGlobalsJson(test) {
|
|
452
|
-
let globals = test.languageOptions?.globals;
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
for (let key in cloned) {
|
|
456
|
-
let value = cloned[key];
|
|
452
|
+
let globals = { ...test.languageOptions?.globals }, eslintCompat = !!test.eslintCompat;
|
|
453
|
+
for (let key in globals) {
|
|
454
|
+
let value = globals[key];
|
|
457
455
|
switch (value) {
|
|
458
456
|
case "readonly":
|
|
459
457
|
case "writable":
|
|
@@ -474,9 +472,19 @@ function getGlobalsJson(test) {
|
|
|
474
472
|
}
|
|
475
473
|
default: throw Error(`'${value}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);
|
|
476
474
|
}
|
|
477
|
-
|
|
475
|
+
globals[key] = value;
|
|
478
476
|
}
|
|
479
|
-
|
|
477
|
+
let originalEnvs = test.languageOptions?.env, envs = {};
|
|
478
|
+
if (originalEnvs != null) for (let [key, value] of ObjectEntries(originalEnvs)) value !== !1 && ObjectDefineProperty(envs, key, {
|
|
479
|
+
value: !0,
|
|
480
|
+
writable: !0,
|
|
481
|
+
enumerable: !0,
|
|
482
|
+
configurable: !0
|
|
483
|
+
});
|
|
484
|
+
return JSONStringify({
|
|
485
|
+
globals,
|
|
486
|
+
envs
|
|
487
|
+
});
|
|
480
488
|
}
|
|
481
489
|
function setupOptions(test) {
|
|
482
490
|
let allOptions$1 = [[]], allRuleIds = [0], optionsId = DEFAULT_OPTIONS_ID, testOptions = test.options;
|