oxlint 1.61.0 → 1.62.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 +23 -4
- package/dist/bindings.js +26 -26
- package/dist/index.d.ts +90 -2
- package/dist/lint.js +259 -7
- package/dist/plugins-dev.d.ts +19 -20
- package/package.json +20 -20
|
@@ -386,14 +386,28 @@
|
|
|
386
386
|
"version": {
|
|
387
387
|
"description": "Jest version — accepts a number (`29`) or a semver string (`\"29.1.0\"` or `\"v29.1.0\"`),\nstoring only the major version.\n::: warning\nUsing this config will override the `no-deprecated-functions`' config set.",
|
|
388
388
|
"default": null,
|
|
389
|
-
"
|
|
390
|
-
|
|
391
|
-
|
|
389
|
+
"allOf": [
|
|
390
|
+
{
|
|
391
|
+
"$ref": "#/definitions/JestVersionSchema"
|
|
392
|
+
}
|
|
393
|
+
],
|
|
392
394
|
"markdownDescription": "Jest version — accepts a number (`29`) or a semver string (`\"29.1.0\"` or `\"v29.1.0\"`),\nstoring only the major version.\n::: warning\nUsing this config will override the `no-deprecated-functions`' config set."
|
|
393
395
|
}
|
|
394
396
|
},
|
|
395
397
|
"markdownDescription": "Configure Jest plugin rules.\n\nSee [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest)'s\nconfiguration for a full reference."
|
|
396
398
|
},
|
|
399
|
+
"JestVersionSchema": {
|
|
400
|
+
"anyOf": [
|
|
401
|
+
{
|
|
402
|
+
"type": "integer",
|
|
403
|
+
"format": "uint",
|
|
404
|
+
"minimum": 0.0
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"type": "string"
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
},
|
|
397
411
|
"LintPluginOptionsSchema": {
|
|
398
412
|
"type": "string",
|
|
399
413
|
"enum": [
|
|
@@ -530,6 +544,11 @@
|
|
|
530
544
|
],
|
|
531
545
|
"markdownDescription": "Report unused disable directives (e.g. `// oxlint-disable-line` or `// eslint-disable-line`).\n\nEquivalent to passing `--report-unused-disable-directives-severity` on the CLI.\nCLI flags take precedence over this value when both are set.\nOnly supported in the root configuration file."
|
|
532
546
|
},
|
|
547
|
+
"respectEslintDisableDirectives": {
|
|
548
|
+
"description": "Whether oxlint should respect `eslint-disable*` and `eslint-enable*`\ndirectives in addition to its native `oxlint-*` directives.\n\nDefaults to `true`.\nOnly supported in the root configuration file.",
|
|
549
|
+
"type": "boolean",
|
|
550
|
+
"markdownDescription": "Whether oxlint should respect `eslint-disable*` and `eslint-enable*`\ndirectives in addition to its native `oxlint-*` directives.\n\nDefaults to `true`.\nOnly supported in the root configuration file."
|
|
551
|
+
},
|
|
533
552
|
"typeAware": {
|
|
534
553
|
"description": "Enable rules that require type information.\n\nEquivalent to passing `--type-aware` on the CLI.\n\nNote that this requires the `oxlint-tsgolint` package to be installed.",
|
|
535
554
|
"type": "boolean",
|
|
@@ -795,4 +814,4 @@
|
|
|
795
814
|
}
|
|
796
815
|
},
|
|
797
816
|
"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```"
|
|
798
|
-
}
|
|
817
|
+
}
|
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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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.62.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);
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ type LintPluginOptionsSchema = "eslint" | "react" | "unicorn" | "typescript" | "
|
|
|
38
38
|
type LintPlugins = LintPluginOptionsSchema[];
|
|
39
39
|
type DummyRule = AllowWarnDeny | [AllowWarnDeny, ...unknown[]];
|
|
40
40
|
type OxlintOverrides = OxlintOverride[];
|
|
41
|
+
type JestVersionSchema = number | string;
|
|
41
42
|
type TagNamePreference = string | {
|
|
42
43
|
message: string;
|
|
43
44
|
replacement: string;
|
|
@@ -196,6 +197,26 @@ interface Oxlintrc$1 {
|
|
|
196
197
|
* }
|
|
197
198
|
* ```
|
|
198
199
|
*
|
|
200
|
+
* Basic usage with a TypeScript plugin and a local plugin path.
|
|
201
|
+
*
|
|
202
|
+
* TypeScript plugin files are supported in the following environments:
|
|
203
|
+
* - Deno and Bun: TypeScript files are supported natively.
|
|
204
|
+
* - Node.js >=22.18.0 and Node.js ^20.19.0: TypeScript files are supported natively with built-in
|
|
205
|
+
* type-stripping enabled by default.
|
|
206
|
+
*
|
|
207
|
+
* For older Node.js versions, TypeScript plugins are not supported. Please use JavaScript plugins or upgrade your Node version.
|
|
208
|
+
*
|
|
209
|
+
* ```json
|
|
210
|
+
* {
|
|
211
|
+
* "jsPlugins": [
|
|
212
|
+
* "./custom-plugin.ts"
|
|
213
|
+
* ],
|
|
214
|
+
* "rules": {
|
|
215
|
+
* "custom/rule-name": "warn"
|
|
216
|
+
* }
|
|
217
|
+
* }
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
199
220
|
* Using a built-in Rust plugin alongside a JS plugin with the same name
|
|
200
221
|
* by giving the JS plugin an alias.
|
|
201
222
|
*
|
|
@@ -298,8 +319,50 @@ interface RuleCategories {
|
|
|
298
319
|
* Predefine global variables.
|
|
299
320
|
*
|
|
300
321
|
* Environments specify what global variables are predefined.
|
|
301
|
-
*
|
|
302
|
-
*
|
|
322
|
+
* Available environments:
|
|
323
|
+
* - amd - require() and define() globals.
|
|
324
|
+
* - applescript - AppleScript globals.
|
|
325
|
+
* - astro - Astro globals.
|
|
326
|
+
* - atomtest - Atom test globals.
|
|
327
|
+
* - audioworklet - AudioWorklet globals.
|
|
328
|
+
* - browser - browser globals.
|
|
329
|
+
* - builtin - Latest ECMAScript globals, equivalent to es2026.
|
|
330
|
+
* - commonjs - CommonJS globals and scoping.
|
|
331
|
+
* - embertest - Ember test globals.
|
|
332
|
+
* - es2015 - ECMAScript 2015 globals.
|
|
333
|
+
* - es2016 - ECMAScript 2016 globals.
|
|
334
|
+
* - es2017 - ECMAScript 2017 globals.
|
|
335
|
+
* - es2018 - ECMAScript 2018 globals.
|
|
336
|
+
* - es2019 - ECMAScript 2019 globals.
|
|
337
|
+
* - es2020 - ECMAScript 2020 globals.
|
|
338
|
+
* - es2021 - ECMAScript 2021 globals.
|
|
339
|
+
* - es2022 - ECMAScript 2022 globals.
|
|
340
|
+
* - es2023 - ECMAScript 2023 globals.
|
|
341
|
+
* - es2024 - ECMAScript 2024 globals.
|
|
342
|
+
* - es2025 - ECMAScript 2025 globals.
|
|
343
|
+
* - es2026 - ECMAScript 2026 globals.
|
|
344
|
+
* - es6 - ECMAScript 6 globals except modules.
|
|
345
|
+
* - greasemonkey - GreaseMonkey globals.
|
|
346
|
+
* - jasmine - Jasmine globals.
|
|
347
|
+
* - jest - Jest globals.
|
|
348
|
+
* - jquery - jQuery globals.
|
|
349
|
+
* - meteor - Meteor globals.
|
|
350
|
+
* - mocha - Mocha globals.
|
|
351
|
+
* - mongo - MongoDB globals.
|
|
352
|
+
* - nashorn - Java 8 Nashorn globals.
|
|
353
|
+
* - node - Node.js globals and scoping.
|
|
354
|
+
* - phantomjs - PhantomJS globals.
|
|
355
|
+
* - prototypejs - Prototype.js globals.
|
|
356
|
+
* - protractor - Protractor globals.
|
|
357
|
+
* - qunit - QUnit globals.
|
|
358
|
+
* - serviceworker - Service Worker globals.
|
|
359
|
+
* - shared-node-browser - Node.js and Browser common globals.
|
|
360
|
+
* - shelljs - ShellJS globals.
|
|
361
|
+
* - svelte - Svelte globals.
|
|
362
|
+
* - vitest - Vitest globals.
|
|
363
|
+
* - vue - Vue globals.
|
|
364
|
+
* - webextensions - WebExtensions globals.
|
|
365
|
+
* - worker - Web Workers globals.
|
|
303
366
|
*/
|
|
304
367
|
interface OxlintEnv {
|
|
305
368
|
[k: string]: boolean;
|
|
@@ -356,6 +419,14 @@ interface OxlintOptions {
|
|
|
356
419
|
* Only supported in the root configuration file.
|
|
357
420
|
*/
|
|
358
421
|
reportUnusedDisableDirectives?: AllowWarnDeny;
|
|
422
|
+
/**
|
|
423
|
+
* Whether oxlint should respect `eslint-disable*` and `eslint-enable*`
|
|
424
|
+
* directives in addition to its native `oxlint-*` directives.
|
|
425
|
+
*
|
|
426
|
+
* Defaults to `true`.
|
|
427
|
+
* Only supported in the root configuration file.
|
|
428
|
+
*/
|
|
429
|
+
respectEslintDisableDirectives?: boolean;
|
|
359
430
|
/**
|
|
360
431
|
* Enable rules that require type information.
|
|
361
432
|
*
|
|
@@ -441,6 +512,7 @@ interface DummyRuleMap {
|
|
|
441
512
|
* ```
|
|
442
513
|
*/
|
|
443
514
|
interface OxlintPluginSettings {
|
|
515
|
+
jest?: JestPluginSettings;
|
|
444
516
|
jsdoc?: JSDocPluginSettings;
|
|
445
517
|
"jsx-a11y"?: JSXA11YPluginSettings;
|
|
446
518
|
next?: NextPluginSettings;
|
|
@@ -448,6 +520,22 @@ interface OxlintPluginSettings {
|
|
|
448
520
|
vitest?: VitestPluginSettings;
|
|
449
521
|
[k: string]: unknown;
|
|
450
522
|
}
|
|
523
|
+
/**
|
|
524
|
+
* Configure Jest plugin rules.
|
|
525
|
+
*
|
|
526
|
+
* See [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest)'s
|
|
527
|
+
* configuration for a full reference.
|
|
528
|
+
*/
|
|
529
|
+
interface JestPluginSettings {
|
|
530
|
+
/**
|
|
531
|
+
* Jest version — accepts a number (`29`) or a semver string (`"29.1.0"` or `"v29.1.0"`),
|
|
532
|
+
* storing only the major version.
|
|
533
|
+
* ::: warning
|
|
534
|
+
* Using this config will override the `no-deprecated-functions`' config set.
|
|
535
|
+
*/
|
|
536
|
+
version?: JestVersionSchema;
|
|
537
|
+
[k: string]: unknown;
|
|
538
|
+
}
|
|
451
539
|
interface JSDocPluginSettings {
|
|
452
540
|
/**
|
|
453
541
|
* Only for `require-(yields|returns|description|example|param|throws)` rule
|
package/dist/lint.js
CHANGED
|
@@ -1048,7 +1048,7 @@ function deserializeArrayExpressionElement(pos) {
|
|
|
1048
1048
|
case 49: return deserializeBoxStaticMemberExpression(pos + 8);
|
|
1049
1049
|
case 50: return deserializeBoxPrivateFieldExpression(pos + 8);
|
|
1050
1050
|
case 64: return deserializeBoxSpreadElement(pos + 8);
|
|
1051
|
-
case 65: return
|
|
1051
|
+
case 65: return deserializeBoxElision(pos + 8);
|
|
1052
1052
|
default: throw Error(`Unexpected discriminant ${uint8[pos]} for ArrayExpressionElement`);
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
@@ -3101,7 +3101,7 @@ function deserializeJSXExpression(pos) {
|
|
|
3101
3101
|
case 48: return deserializeBoxComputedMemberExpression(pos + 8);
|
|
3102
3102
|
case 49: return deserializeBoxStaticMemberExpression(pos + 8);
|
|
3103
3103
|
case 50: return deserializeBoxPrivateFieldExpression(pos + 8);
|
|
3104
|
-
case 64: return
|
|
3104
|
+
case 64: return deserializeBoxJSXEmptyExpression(pos + 8);
|
|
3105
3105
|
default: throw Error(`Unexpected discriminant ${uint8[pos]} for JSXExpression`);
|
|
3106
3106
|
}
|
|
3107
3107
|
}
|
|
@@ -4003,12 +4003,12 @@ function deserializeTSTypePredicate(pos) {
|
|
|
4003
4003
|
range: [start, end],
|
|
4004
4004
|
parent
|
|
4005
4005
|
};
|
|
4006
|
-
return node.parameterName = deserializeTSTypePredicateName(pos + 16), node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos +
|
|
4006
|
+
return node.parameterName = deserializeTSTypePredicateName(pos + 16), node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 32), parent = previousParent, node;
|
|
4007
4007
|
}
|
|
4008
4008
|
function deserializeTSTypePredicateName(pos) {
|
|
4009
4009
|
switch (uint8[pos]) {
|
|
4010
4010
|
case 0: return deserializeBoxIdentifierName(pos + 8);
|
|
4011
|
-
case 1: return
|
|
4011
|
+
case 1: return deserializeBoxTSThisType(pos + 8);
|
|
4012
4012
|
default: throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypePredicateName`);
|
|
4013
4013
|
}
|
|
4014
4014
|
}
|
|
@@ -4702,13 +4702,16 @@ function deserializeBoxV8IntrinsicExpression(pos) {
|
|
|
4702
4702
|
function deserializeVecArrayExpressionElement(pos) {
|
|
4703
4703
|
let arr = [], pos32 = pos >> 2;
|
|
4704
4704
|
pos = int32[pos32];
|
|
4705
|
-
let endPos = pos + int32[pos32 + 2]
|
|
4706
|
-
for (; pos !== endPos;) arr.push(deserializeArrayExpressionElement(pos)), pos +=
|
|
4705
|
+
let endPos = pos + (int32[pos32 + 2] << 4);
|
|
4706
|
+
for (; pos !== endPos;) arr.push(deserializeArrayExpressionElement(pos)), pos += 16;
|
|
4707
4707
|
return arr;
|
|
4708
4708
|
}
|
|
4709
4709
|
function deserializeBoxSpreadElement(pos) {
|
|
4710
4710
|
return deserializeSpreadElement(int32[pos >> 2]);
|
|
4711
4711
|
}
|
|
4712
|
+
function deserializeBoxElision(pos) {
|
|
4713
|
+
return deserializeElision(int32[pos >> 2]);
|
|
4714
|
+
}
|
|
4712
4715
|
function deserializeVecObjectPropertyKind(pos) {
|
|
4713
4716
|
let arr = [], pos32 = pos >> 2;
|
|
4714
4717
|
pos = int32[pos32];
|
|
@@ -5145,6 +5148,9 @@ function deserializeBoxJSXNamespacedName(pos) {
|
|
|
5145
5148
|
function deserializeBoxJSXMemberExpression(pos) {
|
|
5146
5149
|
return deserializeJSXMemberExpression(int32[pos >> 2]);
|
|
5147
5150
|
}
|
|
5151
|
+
function deserializeBoxJSXEmptyExpression(pos) {
|
|
5152
|
+
return deserializeJSXEmptyExpression(int32[pos >> 2]);
|
|
5153
|
+
}
|
|
5148
5154
|
function deserializeBoxJSXAttribute(pos) {
|
|
5149
5155
|
return deserializeJSXAttribute(int32[pos >> 2]);
|
|
5150
5156
|
}
|
|
@@ -12709,15 +12715,36 @@ function resetScopeManager() {
|
|
|
12709
12715
|
tsScopeManager = null;
|
|
12710
12716
|
}
|
|
12711
12717
|
const SCOPE_MANAGER = ObjectFreeze({
|
|
12718
|
+
/**
|
|
12719
|
+
* All scopes.
|
|
12720
|
+
*/
|
|
12712
12721
|
get scopes() {
|
|
12713
12722
|
return tsScopeManager === null && initTsScopeManager(), tsScopeManager.scopes;
|
|
12714
12723
|
},
|
|
12724
|
+
/**
|
|
12725
|
+
* The root scope.
|
|
12726
|
+
*/
|
|
12715
12727
|
get globalScope() {
|
|
12716
12728
|
return tsScopeManager === null && initTsScopeManager(), tsScopeManager.globalScope;
|
|
12717
12729
|
},
|
|
12730
|
+
/**
|
|
12731
|
+
* Get the variables that a given AST node defines.
|
|
12732
|
+
* The returned variables' `def[].node` / `def[].parent` property is the node.
|
|
12733
|
+
* If the node does not define any variable, this returns an empty array.
|
|
12734
|
+
* @param node AST node to get variables of.
|
|
12735
|
+
*/
|
|
12718
12736
|
getDeclaredVariables(node) {
|
|
12719
12737
|
return tsScopeManager === null && initTsScopeManager(), tsScopeManager.getDeclaredVariables(node);
|
|
12720
12738
|
},
|
|
12739
|
+
/**
|
|
12740
|
+
* Get the scope of a given AST node. The returned scope's `block` property is the node.
|
|
12741
|
+
* This method never returns `function-expression-name` scope.
|
|
12742
|
+
* If the node does not have a scope, returns `null`.
|
|
12743
|
+
*
|
|
12744
|
+
* @param node An AST node to get their scope.
|
|
12745
|
+
* @param inner If the node has multiple scopes, this returns the outermost scope normally.
|
|
12746
|
+
* If `inner` is `true` then this returns the innermost scope.
|
|
12747
|
+
*/
|
|
12721
12748
|
acquire(node, inner) {
|
|
12722
12749
|
return tsScopeManager === null && initTsScopeManager(), tsScopeManager.acquire(node, inner);
|
|
12723
12750
|
}
|
|
@@ -13511,42 +13538,91 @@ function fileIsJsx() {
|
|
|
13511
13538
|
return buffer[2147483613] === 1;
|
|
13512
13539
|
}
|
|
13513
13540
|
const SOURCE_CODE = ObjectFreeze({
|
|
13541
|
+
/**
|
|
13542
|
+
* Source text.
|
|
13543
|
+
*/
|
|
13514
13544
|
get text() {
|
|
13515
13545
|
return sourceText === null && initSourceText(), sourceText;
|
|
13516
13546
|
},
|
|
13547
|
+
/**
|
|
13548
|
+
* `true` if file has Unicode BOM.
|
|
13549
|
+
*/
|
|
13517
13550
|
get hasBOM() {
|
|
13518
13551
|
return hasBOM;
|
|
13519
13552
|
},
|
|
13553
|
+
/**
|
|
13554
|
+
* AST of the file.
|
|
13555
|
+
*/
|
|
13520
13556
|
get ast() {
|
|
13521
13557
|
return ast === null && initAst(), ast;
|
|
13522
13558
|
},
|
|
13559
|
+
/**
|
|
13560
|
+
* `true` if the AST is in ESTree format.
|
|
13561
|
+
*/
|
|
13523
13562
|
isESTree: !0,
|
|
13563
|
+
/**
|
|
13564
|
+
* `ScopeManager` for the file.
|
|
13565
|
+
*/
|
|
13524
13566
|
get scopeManager() {
|
|
13525
13567
|
return SCOPE_MANAGER;
|
|
13526
13568
|
},
|
|
13569
|
+
/**
|
|
13570
|
+
* Visitor keys to traverse this AST.
|
|
13571
|
+
*/
|
|
13527
13572
|
get visitorKeys() {
|
|
13528
13573
|
return keys_default;
|
|
13529
13574
|
},
|
|
13575
|
+
/**
|
|
13576
|
+
* Parser services for the file.
|
|
13577
|
+
*
|
|
13578
|
+
* Oxlint does not offer any parser services.
|
|
13579
|
+
*/
|
|
13530
13580
|
parserServices: ObjectFreeze({}),
|
|
13581
|
+
/**
|
|
13582
|
+
* Source text as array of lines, split according to specification's definition of line breaks.
|
|
13583
|
+
*/
|
|
13531
13584
|
get lines() {
|
|
13532
13585
|
return lines.length === 0 && initLines(), lines;
|
|
13533
13586
|
},
|
|
13587
|
+
/**
|
|
13588
|
+
* Character offset of the first character of each line in source text,
|
|
13589
|
+
* split according to specification's definition of line breaks.
|
|
13590
|
+
*/
|
|
13534
13591
|
get lineStartIndices() {
|
|
13535
13592
|
return lines.length === 0 && initLines(), lineStartIndices;
|
|
13536
13593
|
},
|
|
13594
|
+
/**
|
|
13595
|
+
* Array of all tokens and comments in the file, in source order.
|
|
13596
|
+
*/
|
|
13537
13597
|
get tokensAndComments() {
|
|
13538
13598
|
return getTokensAndComments();
|
|
13539
13599
|
},
|
|
13600
|
+
/**
|
|
13601
|
+
* Get the source code for the given node.
|
|
13602
|
+
* @param node? - The AST node to get the text for.
|
|
13603
|
+
* @param beforeCount? - The number of characters before the node to retrieve.
|
|
13604
|
+
* @param afterCount? - The number of characters after the node to retrieve.
|
|
13605
|
+
* @returns Source text representing the AST node.
|
|
13606
|
+
*/
|
|
13540
13607
|
getText(node, beforeCount, afterCount) {
|
|
13541
13608
|
if (sourceText === null && initSourceText(), !node) return sourceText;
|
|
13542
13609
|
let { range } = node, start = range[0], end = range[1];
|
|
13543
13610
|
return beforeCount && (start = MathMax(start - beforeCount, 0)), afterCount && (end += afterCount), sourceText.slice(start, end);
|
|
13544
13611
|
},
|
|
13612
|
+
/**
|
|
13613
|
+
* Get all the ancestors of a given node.
|
|
13614
|
+
* @param node - AST node
|
|
13615
|
+
* @returns All the ancestor nodes in the AST, not including the provided node,
|
|
13616
|
+
* starting from the root node at index 0 and going inwards to the parent node.
|
|
13617
|
+
*/
|
|
13545
13618
|
getAncestors(node) {
|
|
13546
13619
|
let ancestors = [];
|
|
13547
13620
|
for (; node = node.parent, node !== null;) ancestors.push(node);
|
|
13548
13621
|
return ancestors.reverse();
|
|
13549
13622
|
},
|
|
13623
|
+
/**
|
|
13624
|
+
* Get source text as array of lines, split according to specification's definition of line breaks.
|
|
13625
|
+
*/
|
|
13550
13626
|
getLines() {
|
|
13551
13627
|
return lines.length === 0 && initLines(), lines;
|
|
13552
13628
|
},
|
|
@@ -13990,7 +14066,7 @@ function resetSettings() {
|
|
|
13990
14066
|
}
|
|
13991
14067
|
//#endregion
|
|
13992
14068
|
//#region package.json
|
|
13993
|
-
var version = "1.
|
|
14069
|
+
var version = "1.62.0";
|
|
13994
14070
|
//#endregion
|
|
13995
14071
|
//#region src-js/plugins/context.ts
|
|
13996
14072
|
let filePath = null, cwd = null;
|
|
@@ -14036,12 +14112,30 @@ const SUPPORTED_ECMA_VERSIONS = ObjectFreeze([
|
|
|
14036
14112
|
]);
|
|
14037
14113
|
let Syntax = null;
|
|
14038
14114
|
const PARSER = ObjectFreeze({
|
|
14115
|
+
/**
|
|
14116
|
+
* Parser name.
|
|
14117
|
+
*/
|
|
14039
14118
|
name: "oxlint",
|
|
14119
|
+
/**
|
|
14120
|
+
* Parser version.
|
|
14121
|
+
*/
|
|
14040
14122
|
version,
|
|
14123
|
+
/**
|
|
14124
|
+
* Parse code into an AST.
|
|
14125
|
+
* @param code - Code to parse
|
|
14126
|
+
* @param options? - Parser options
|
|
14127
|
+
* @returns AST
|
|
14128
|
+
*/
|
|
14041
14129
|
parse(code, options) {
|
|
14042
14130
|
throw Error("`context.languageOptions.parser.parse` not implemented yet.");
|
|
14043
14131
|
},
|
|
14132
|
+
/**
|
|
14133
|
+
* Visitor keys for AST nodes.
|
|
14134
|
+
*/
|
|
14044
14135
|
VisitorKeys: keys_default,
|
|
14136
|
+
/**
|
|
14137
|
+
* Ast node types.
|
|
14138
|
+
*/
|
|
14045
14139
|
get Syntax() {
|
|
14046
14140
|
if (Syntax === null) {
|
|
14047
14141
|
Syntax = ObjectCreate(null);
|
|
@@ -14050,86 +14144,178 @@ const PARSER = ObjectFreeze({
|
|
|
14050
14144
|
}
|
|
14051
14145
|
return Syntax;
|
|
14052
14146
|
},
|
|
14147
|
+
/**
|
|
14148
|
+
* Latest ECMAScript version supported by parser.
|
|
14149
|
+
*/
|
|
14053
14150
|
latestEcmaVersion: 17,
|
|
14151
|
+
/**
|
|
14152
|
+
* ECMAScript versions supported by parser.
|
|
14153
|
+
*/
|
|
14054
14154
|
supportedEcmaVersions: SUPPORTED_ECMA_VERSIONS
|
|
14055
14155
|
}), PARSER_OPTIONS = ObjectFreeze({
|
|
14156
|
+
/**
|
|
14157
|
+
* Source type of the file being linted.
|
|
14158
|
+
*/
|
|
14056
14159
|
get sourceType() {
|
|
14057
14160
|
return ast === null && initAst(), ast.sourceType;
|
|
14058
14161
|
},
|
|
14162
|
+
/**
|
|
14163
|
+
* ECMA features.
|
|
14164
|
+
*/
|
|
14059
14165
|
ecmaFeatures: ObjectFreeze({
|
|
14166
|
+
/**
|
|
14167
|
+
* `true` if file was parsed as JSX.
|
|
14168
|
+
*/
|
|
14060
14169
|
get jsx() {
|
|
14061
14170
|
return fileIsJsx();
|
|
14062
14171
|
},
|
|
14172
|
+
/**
|
|
14173
|
+
* `true` if file was parsed with top-level `return` statements allowed.
|
|
14174
|
+
*/
|
|
14063
14175
|
get globalReturn() {
|
|
14064
14176
|
return ast === null && initAst(), ast.sourceType === "commonjs";
|
|
14065
14177
|
},
|
|
14178
|
+
/**
|
|
14179
|
+
* `true` if file was parsed as strict mode code.
|
|
14180
|
+
*/
|
|
14066
14181
|
get impliedStrict() {
|
|
14067
14182
|
return ast === null && initAst(), ast.sourceType === "module";
|
|
14068
14183
|
}
|
|
14069
14184
|
})
|
|
14070
14185
|
}), LANGUAGE_OPTIONS = {
|
|
14186
|
+
/**
|
|
14187
|
+
* Source type of the file being linted.
|
|
14188
|
+
*/
|
|
14071
14189
|
get sourceType() {
|
|
14072
14190
|
return ast === null && initAst(), ast.sourceType;
|
|
14073
14191
|
},
|
|
14192
|
+
/**
|
|
14193
|
+
* ECMAScript version of the file being linted.
|
|
14194
|
+
*/
|
|
14074
14195
|
ecmaVersion: 2026,
|
|
14196
|
+
/**
|
|
14197
|
+
* Parser used to parse the file being linted.
|
|
14198
|
+
*/
|
|
14075
14199
|
parser: PARSER,
|
|
14200
|
+
/**
|
|
14201
|
+
* Parser options used to parse the file being linted.
|
|
14202
|
+
*/
|
|
14076
14203
|
parserOptions: PARSER_OPTIONS,
|
|
14204
|
+
/**
|
|
14205
|
+
* Globals defined for the file being linted.
|
|
14206
|
+
*/
|
|
14077
14207
|
get globals() {
|
|
14078
14208
|
return globals === null && initGlobals(), globals;
|
|
14079
14209
|
},
|
|
14210
|
+
/**
|
|
14211
|
+
* Environments defined for the file being linted.
|
|
14212
|
+
*/
|
|
14080
14213
|
get env() {
|
|
14081
14214
|
return envs === null && initGlobals(), envs;
|
|
14082
14215
|
}
|
|
14083
14216
|
};
|
|
14084
14217
|
ObjectFreeze(LANGUAGE_OPTIONS);
|
|
14085
14218
|
const FILE_CONTEXT = ObjectFreeze({
|
|
14219
|
+
/**
|
|
14220
|
+
* Absolute path of the file being linted.
|
|
14221
|
+
*/
|
|
14086
14222
|
get filename() {
|
|
14087
14223
|
if (filePath === null) throw Error("Cannot access `context.filename` in `createOnce`");
|
|
14088
14224
|
return filePath;
|
|
14089
14225
|
},
|
|
14226
|
+
/**
|
|
14227
|
+
* Get absolute path of the file being linted.
|
|
14228
|
+
* @returns Absolute path of the file being linted.
|
|
14229
|
+
* @deprecated Use `context.filename` property instead.
|
|
14230
|
+
*/
|
|
14090
14231
|
getFilename() {
|
|
14091
14232
|
if (filePath === null) throw Error("Cannot call `context.getFilename` in `createOnce`");
|
|
14092
14233
|
return filePath;
|
|
14093
14234
|
},
|
|
14235
|
+
/**
|
|
14236
|
+
* Physical absolute path of the file being linted.
|
|
14237
|
+
*/
|
|
14094
14238
|
get physicalFilename() {
|
|
14095
14239
|
if (filePath === null) throw Error("Cannot access `context.physicalFilename` in `createOnce`");
|
|
14096
14240
|
return filePath;
|
|
14097
14241
|
},
|
|
14242
|
+
/**
|
|
14243
|
+
* Get physical absolute path of the file being linted.
|
|
14244
|
+
* @returns Physical absolute path of the file being linted.
|
|
14245
|
+
* @deprecated Use `context.physicalFilename` property instead.
|
|
14246
|
+
*/
|
|
14098
14247
|
getPhysicalFilename() {
|
|
14099
14248
|
if (filePath === null) throw Error("Cannot call `context.getPhysicalFilename` in `createOnce`");
|
|
14100
14249
|
return filePath;
|
|
14101
14250
|
},
|
|
14251
|
+
/**
|
|
14252
|
+
* Current working directory.
|
|
14253
|
+
*/
|
|
14102
14254
|
get cwd() {
|
|
14103
14255
|
if (filePath === null) throw Error("Cannot access `context.cwd` in `createOnce`");
|
|
14104
14256
|
return cwd;
|
|
14105
14257
|
},
|
|
14258
|
+
/**
|
|
14259
|
+
* Get current working directory.
|
|
14260
|
+
* @returns The current working directory.
|
|
14261
|
+
* @deprecated Use `context.cwd` property instead.
|
|
14262
|
+
*/
|
|
14106
14263
|
getCwd() {
|
|
14107
14264
|
if (filePath === null) throw Error("Cannot call `context.getCwd` in `createOnce`");
|
|
14108
14265
|
return cwd;
|
|
14109
14266
|
},
|
|
14267
|
+
/**
|
|
14268
|
+
* Source code of the file being linted.
|
|
14269
|
+
*/
|
|
14110
14270
|
get sourceCode() {
|
|
14111
14271
|
if (filePath === null) throw Error("Cannot access `context.sourceCode` in `createOnce`");
|
|
14112
14272
|
return SOURCE_CODE;
|
|
14113
14273
|
},
|
|
14274
|
+
/**
|
|
14275
|
+
* Get source code of the file being linted.
|
|
14276
|
+
* @returns Source code of the file being linted.
|
|
14277
|
+
* @deprecated Use `context.sourceCode` property instead.
|
|
14278
|
+
*/
|
|
14114
14279
|
getSourceCode() {
|
|
14115
14280
|
if (filePath === null) throw Error("Cannot call `context.getSourceCode` in `createOnce`");
|
|
14116
14281
|
return SOURCE_CODE;
|
|
14117
14282
|
},
|
|
14283
|
+
/**
|
|
14284
|
+
* Language options used when parsing this file.
|
|
14285
|
+
*/
|
|
14118
14286
|
get languageOptions() {
|
|
14119
14287
|
if (filePath === null) throw Error("Cannot access `context.languageOptions` in `createOnce`");
|
|
14120
14288
|
return LANGUAGE_OPTIONS;
|
|
14121
14289
|
},
|
|
14290
|
+
/**
|
|
14291
|
+
* Settings for the file being linted.
|
|
14292
|
+
*/
|
|
14122
14293
|
get settings() {
|
|
14123
14294
|
if (filePath === null) throw Error("Cannot access `context.settings` in `createOnce`");
|
|
14124
14295
|
return settings === null && initSettings(), settings;
|
|
14125
14296
|
},
|
|
14297
|
+
/**
|
|
14298
|
+
* Create a new object with the current object as the prototype and
|
|
14299
|
+
* the specified properties as its own properties.
|
|
14300
|
+
* @param extension - The properties to add to the new object.
|
|
14301
|
+
* @returns A new object with the current object as the prototype
|
|
14302
|
+
* and the specified properties as its own properties.
|
|
14303
|
+
*/
|
|
14126
14304
|
extend(extension) {
|
|
14127
14305
|
return ObjectFreeze(ObjectAssign(ObjectCreate(this), extension));
|
|
14128
14306
|
},
|
|
14307
|
+
/**
|
|
14308
|
+
* Parser options used to parse the file being linted.
|
|
14309
|
+
* @deprecated Use `languageOptions.parserOptions` instead.
|
|
14310
|
+
*/
|
|
14129
14311
|
get parserOptions() {
|
|
14130
14312
|
if (filePath === null) throw Error("Cannot access `context.parserOptions` in `createOnce`");
|
|
14131
14313
|
return PARSER_OPTIONS;
|
|
14132
14314
|
},
|
|
14315
|
+
/**
|
|
14316
|
+
* The path to the parser used to parse this file.
|
|
14317
|
+
* @deprecated No longer supported.
|
|
14318
|
+
*/
|
|
14133
14319
|
get parserPath() {
|
|
14134
14320
|
if (filePath === null) throw Error("Cannot access `context.parserPath` in `createOnce`");
|
|
14135
14321
|
}
|
|
@@ -14152,6 +14338,20 @@ function createContext(ruleDetails) {
|
|
|
14152
14338
|
configurable: !0
|
|
14153
14339
|
},
|
|
14154
14340
|
report: {
|
|
14341
|
+
/**
|
|
14342
|
+
* Report error.
|
|
14343
|
+
*
|
|
14344
|
+
* Normally called with a single `Diagnostic` object.
|
|
14345
|
+
*
|
|
14346
|
+
* Can also be called with legacy positional forms:
|
|
14347
|
+
* - `context.report(node, message, data?, fix?)`
|
|
14348
|
+
* - `context.report(node, loc, message, data?, fix?)`
|
|
14349
|
+
* These legacy forms are not included in type def for this method, as they are deprecated,
|
|
14350
|
+
* but some plugins still use them, so we support them.
|
|
14351
|
+
*
|
|
14352
|
+
* @param diagnostic - Diagnostic object
|
|
14353
|
+
* @throws {TypeError} If `diagnostic` is invalid
|
|
14354
|
+
*/
|
|
14155
14355
|
value(diagnostic, ...extraArgs) {
|
|
14156
14356
|
report(diagnostic, extraArgs, ruleDetails);
|
|
14157
14357
|
},
|
|
@@ -14416,7 +14616,19 @@ var require_uri_all = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
14416
14616
|
}
|
|
14417
14617
|
return output.join("");
|
|
14418
14618
|
}, punycode = {
|
|
14619
|
+
/**
|
|
14620
|
+
* A string representing the current Punycode.js version number.
|
|
14621
|
+
* @memberOf punycode
|
|
14622
|
+
* @type String
|
|
14623
|
+
*/
|
|
14419
14624
|
version: "2.1.0",
|
|
14625
|
+
/**
|
|
14626
|
+
* An object of methods to convert from JavaScript's internal character
|
|
14627
|
+
* representation (UCS-2) to Unicode code points, and back.
|
|
14628
|
+
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
14629
|
+
* @memberOf punycode
|
|
14630
|
+
* @type Object
|
|
14631
|
+
*/
|
|
14420
14632
|
ucs2: {
|
|
14421
14633
|
decode: ucs2decode,
|
|
14422
14634
|
encode: ucs2encode
|
|
@@ -18086,8 +18298,24 @@ var require_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
18086
18298
|
}
|
|
18087
18299
|
}
|
|
18088
18300
|
module.exports = {
|
|
18301
|
+
/**
|
|
18302
|
+
* A flag that debug dumping is enabled or not.
|
|
18303
|
+
* @type {boolean}
|
|
18304
|
+
*/
|
|
18089
18305
|
enabled: debug.enabled,
|
|
18306
|
+
/**
|
|
18307
|
+
* Dumps given objects.
|
|
18308
|
+
* @param {...any} args objects to dump.
|
|
18309
|
+
* @returns {void}
|
|
18310
|
+
*/
|
|
18090
18311
|
dump: debug,
|
|
18312
|
+
/**
|
|
18313
|
+
* Dumps the current analyzing state.
|
|
18314
|
+
* @param {ASTNode} node A node to dump.
|
|
18315
|
+
* @param {CodePathState} state A state to dump.
|
|
18316
|
+
* @param {boolean} leaving A flag whether or not it's leaving
|
|
18317
|
+
* @returns {void}
|
|
18318
|
+
*/
|
|
18091
18319
|
dumpState: debug.enabled ? function(node, state, leaving) {
|
|
18092
18320
|
for (let i = 0; i < state.currentSegments.length; ++i) {
|
|
18093
18321
|
let segInternal = state.currentSegments[i].internal;
|
|
@@ -18098,6 +18326,14 @@ var require_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
18098
18326
|
}
|
|
18099
18327
|
debug([`${state.currentSegments.map(getId).join(",")})`, `${node.type}${leaving ? ":exit" : ""}`].join(" "));
|
|
18100
18328
|
} : debug,
|
|
18329
|
+
/**
|
|
18330
|
+
* Dumps a DOT code of a given code path.
|
|
18331
|
+
* The DOT code can be visualized with Graphvis.
|
|
18332
|
+
* @param {CodePath} codePath A code path to dump.
|
|
18333
|
+
* @returns {void}
|
|
18334
|
+
* @see http://www.graphviz.org
|
|
18335
|
+
* @see http://www.webgraphviz.com
|
|
18336
|
+
*/
|
|
18101
18337
|
dumpDot: debug.enabled ? function(codePath) {
|
|
18102
18338
|
let text = "\ndigraph {\nnode[shape=box,style=\"rounded,filled\",fillcolor=white];\ninitial[label=\"\",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n";
|
|
18103
18339
|
codePath.returnedSegments.length > 0 && (text += "final[label=\"\",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"), codePath.thrownSegments.length > 0 && (text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize=true];\n");
|
|
@@ -18108,6 +18344,13 @@ var require_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
18108
18344
|
}
|
|
18109
18345
|
text += `${arrows}\n`, text += "}", debug("DOT", text);
|
|
18110
18346
|
} : debug,
|
|
18347
|
+
/**
|
|
18348
|
+
* Makes a DOT code of a given code path.
|
|
18349
|
+
* The DOT code can be visualized with Graphvis.
|
|
18350
|
+
* @param {CodePath} codePath A code path to make DOT.
|
|
18351
|
+
* @param {Object} traceMap Optional. A map to check whether or not segments had been done.
|
|
18352
|
+
* @returns {string} A DOT code of the code path.
|
|
18353
|
+
*/
|
|
18111
18354
|
makeDotArrows(codePath, traceMap) {
|
|
18112
18355
|
let stack = [[codePath.initialSegment, 0]], done = traceMap || Object.create(null), lastId = codePath.initialSegment.id, text = `initial->${codePath.initialSegment.id}`;
|
|
18113
18356
|
for (; stack.length > 0;) {
|
|
@@ -19471,9 +19714,18 @@ var require_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
19471
19714
|
let resolvedOptions, resolvedCallback;
|
|
19472
19715
|
typeof optionsOrCallback == "function" ? (resolvedCallback = optionsOrCallback, resolvedOptions = {}) : (resolvedOptions = optionsOrCallback || {}, resolvedCallback = callback);
|
|
19473
19716
|
let startSegment = resolvedOptions.first || this.internal.initialSegment, lastSegment = resolvedOptions.last, record, index, end, segment = null, visited = /* @__PURE__ */ new Set(), stack = [[startSegment, 0]], skipped = /* @__PURE__ */ new Set(), broken = !1, controller = {
|
|
19717
|
+
/**
|
|
19718
|
+
* Skip the following segments in this branch.
|
|
19719
|
+
* @returns {void}
|
|
19720
|
+
*/
|
|
19474
19721
|
skip() {
|
|
19475
19722
|
skipped.add(segment);
|
|
19476
19723
|
},
|
|
19724
|
+
/**
|
|
19725
|
+
* Stop traversal completely - do not traverse to any
|
|
19726
|
+
* other segments.
|
|
19727
|
+
* @returns {void}
|
|
19728
|
+
*/
|
|
19477
19729
|
break() {
|
|
19478
19730
|
broken = !0;
|
|
19479
19731
|
}
|
package/dist/plugins-dev.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-any.d.ts
|
|
2
2
|
/**
|
|
3
3
|
Returns a boolean for whether the given type is `any`.
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ const anyA = get(anyObject, 'a');
|
|
|
29
29
|
*/
|
|
30
30
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
31
31
|
//#endregion
|
|
32
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
32
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
33
33
|
/**
|
|
34
34
|
Returns a boolean for whether the given key is an optional key of type.
|
|
35
35
|
|
|
@@ -72,7 +72,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
72
72
|
*/
|
|
73
73
|
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
|
|
74
74
|
//#endregion
|
|
75
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
75
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
76
76
|
/**
|
|
77
77
|
Extract all optional keys from the given type.
|
|
78
78
|
|
|
@@ -110,7 +110,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
110
110
|
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
111
111
|
: never;
|
|
112
112
|
//#endregion
|
|
113
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
113
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
114
114
|
/**
|
|
115
115
|
Extract all required keys from the given type.
|
|
116
116
|
|
|
@@ -144,7 +144,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
144
144
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
145
145
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
146
146
|
//#endregion
|
|
147
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
147
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-never.d.ts
|
|
148
148
|
/**
|
|
149
149
|
Returns a boolean for whether the given type is `never`.
|
|
150
150
|
|
|
@@ -200,7 +200,7 @@ type B = IsTrueFixed<never>;
|
|
|
200
200
|
*/
|
|
201
201
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
202
202
|
//#endregion
|
|
203
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
203
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/if.d.ts
|
|
204
204
|
/**
|
|
205
205
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
206
206
|
|
|
@@ -295,7 +295,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
295
295
|
*/
|
|
296
296
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
297
297
|
//#endregion
|
|
298
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
298
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/type.d.ts
|
|
299
299
|
/**
|
|
300
300
|
An if-else-like type that resolves depending on whether the given type is `any` or `never`.
|
|
301
301
|
|
|
@@ -342,7 +342,7 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
|
|
|
342
342
|
*/
|
|
343
343
|
type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
|
|
344
344
|
//#endregion
|
|
345
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
345
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/simplify.d.ts
|
|
346
346
|
/**
|
|
347
347
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
348
348
|
|
|
@@ -403,7 +403,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
403
403
|
*/
|
|
404
404
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
405
405
|
//#endregion
|
|
406
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
406
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/is-equal.d.ts
|
|
407
407
|
/**
|
|
408
408
|
Returns a boolean for whether the two given types are equal.
|
|
409
409
|
|
|
@@ -434,7 +434,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
434
434
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
435
435
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
436
436
|
//#endregion
|
|
437
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
437
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
438
438
|
/**
|
|
439
439
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
440
440
|
|
|
@@ -528,7 +528,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
528
528
|
*/
|
|
529
529
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
530
530
|
//#endregion
|
|
531
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
531
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
532
532
|
/**
|
|
533
533
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
534
534
|
|
|
@@ -576,7 +576,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
576
576
|
*/
|
|
577
577
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
578
578
|
//#endregion
|
|
579
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
579
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/merge.d.ts
|
|
580
580
|
// Merges two objects without worrying about index signatures.
|
|
581
581
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
582
582
|
/**
|
|
@@ -648,7 +648,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
648
648
|
// Should never happen
|
|
649
649
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
650
650
|
//#endregion
|
|
651
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
651
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/internal/object.d.ts
|
|
652
652
|
/**
|
|
653
653
|
Merges user specified options with default options.
|
|
654
654
|
|
|
@@ -703,7 +703,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
703
703
|
*/
|
|
704
704
|
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
|
|
705
705
|
//#endregion
|
|
706
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
706
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/except.d.ts
|
|
707
707
|
/**
|
|
708
708
|
Filter out keys from an object.
|
|
709
709
|
|
|
@@ -801,9 +801,9 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
801
801
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
802
802
|
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
803
803
|
//#endregion
|
|
804
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
804
|
+
//#region ../../node_modules/.pnpm/type-fest@5.6.0/node_modules/type-fest/source/require-at-least-one.d.ts
|
|
805
805
|
/**
|
|
806
|
-
Create a type that requires at least one of the given keys
|
|
806
|
+
Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
|
|
807
807
|
|
|
808
808
|
@example
|
|
809
809
|
```
|
|
@@ -825,10 +825,9 @@ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
|
|
|
825
825
|
*/
|
|
826
826
|
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
|
|
827
827
|
type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { // For each `Key` in `KeysType` make a mapped type:
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & // 3. Add the remaining keys not in `KeysType`
|
|
831
|
-
Except<ObjectType, KeysType>;
|
|
828
|
+
// 2. Make all other keys in `KeysType` optional
|
|
829
|
+
[Key in KeysType]-?: Required<Pick<ObjectType, Key>> // 1. Make `Key`'s type required
|
|
830
|
+
& Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & Except<ObjectType, KeysType>; // 3. Add the remaining keys not in `KeysType`
|
|
832
831
|
//#endregion
|
|
833
832
|
//#region src-js/plugins/globals.d.ts
|
|
834
833
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.62.0",
|
|
4
4
|
"description": "Linter for the JavaScript Oxidation Compiler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -83,24 +83,24 @@
|
|
|
83
83
|
},
|
|
84
84
|
"preferUnplugged": true,
|
|
85
85
|
"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.
|
|
86
|
+
"@oxlint/binding-darwin-arm64": "1.62.0",
|
|
87
|
+
"@oxlint/binding-android-arm64": "1.62.0",
|
|
88
|
+
"@oxlint/binding-win32-arm64-msvc": "1.62.0",
|
|
89
|
+
"@oxlint/binding-linux-arm64-gnu": "1.62.0",
|
|
90
|
+
"@oxlint/binding-linux-arm64-musl": "1.62.0",
|
|
91
|
+
"@oxlint/binding-openharmony-arm64": "1.62.0",
|
|
92
|
+
"@oxlint/binding-android-arm-eabi": "1.62.0",
|
|
93
|
+
"@oxlint/binding-linux-arm-gnueabihf": "1.62.0",
|
|
94
|
+
"@oxlint/binding-linux-arm-musleabihf": "1.62.0",
|
|
95
|
+
"@oxlint/binding-win32-ia32-msvc": "1.62.0",
|
|
96
|
+
"@oxlint/binding-linux-ppc64-gnu": "1.62.0",
|
|
97
|
+
"@oxlint/binding-linux-riscv64-gnu": "1.62.0",
|
|
98
|
+
"@oxlint/binding-linux-riscv64-musl": "1.62.0",
|
|
99
|
+
"@oxlint/binding-linux-s390x-gnu": "1.62.0",
|
|
100
|
+
"@oxlint/binding-darwin-x64": "1.62.0",
|
|
101
|
+
"@oxlint/binding-win32-x64-msvc": "1.62.0",
|
|
102
|
+
"@oxlint/binding-freebsd-x64": "1.62.0",
|
|
103
|
+
"@oxlint/binding-linux-x64-gnu": "1.62.0",
|
|
104
|
+
"@oxlint/binding-linux-x64-musl": "1.62.0"
|
|
105
105
|
}
|
|
106
106
|
}
|