@depup/oxlint 1.76.0-depup.0 → 1.77.0-depup.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/README.md +2 -2
- package/changes.json +1 -1
- package/configuration_schema.json +44 -13
- package/dist/bindings.js +96 -42
- package/dist/index.d.ts +34 -5
- package/dist/lint.js +250 -118
- package/dist/plugins-dev.js +15 -15
- package/dist/plugins.js +1 -1
- package/dist/workspace2.js +2 -1
- package/package.json +22 -22
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/oxlint
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [oxlint](https://www.npmjs.com/package/oxlint) @ 1.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [oxlint](https://www.npmjs.com/package/oxlint) @ 1.77.0 |
|
|
17
|
+
| Processed | 2026-08-03 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
|
@@ -5661,7 +5661,7 @@
|
|
|
5661
5661
|
"$ref": "#/definitions/AllowWarnDeny"
|
|
5662
5662
|
},
|
|
5663
5663
|
{
|
|
5664
|
-
"$ref": "#/definitions/
|
|
5664
|
+
"$ref": "#/definitions/NoWarningCommentsConfig"
|
|
5665
5665
|
}
|
|
5666
5666
|
],
|
|
5667
5667
|
"maxItems": 2,
|
|
@@ -12678,10 +12678,23 @@
|
|
|
12678
12678
|
}
|
|
12679
12679
|
},
|
|
12680
12680
|
"Location": {
|
|
12681
|
-
"
|
|
12682
|
-
|
|
12683
|
-
|
|
12684
|
-
|
|
12681
|
+
"oneOf": [
|
|
12682
|
+
{
|
|
12683
|
+
"description": "Terms must appear at the start of the comment, after any decoration.",
|
|
12684
|
+
"type": "string",
|
|
12685
|
+
"enum": [
|
|
12686
|
+
"start"
|
|
12687
|
+
],
|
|
12688
|
+
"markdownDescription": "Terms must appear at the start of the comment, after any decoration."
|
|
12689
|
+
},
|
|
12690
|
+
{
|
|
12691
|
+
"description": "Terms can appear anywhere in the comment.",
|
|
12692
|
+
"type": "string",
|
|
12693
|
+
"enum": [
|
|
12694
|
+
"anywhere"
|
|
12695
|
+
],
|
|
12696
|
+
"markdownDescription": "Terms can appear anywhere in the comment."
|
|
12697
|
+
}
|
|
12685
12698
|
]
|
|
12686
12699
|
},
|
|
12687
12700
|
"LogicalAssignmentOperators": {
|
|
@@ -15763,20 +15776,20 @@
|
|
|
15763
15776
|
"type": "object",
|
|
15764
15777
|
"properties": {
|
|
15765
15778
|
"allowConstantLoopConditions": {
|
|
15766
|
-
"description": "
|
|
15779
|
+
"description": "Controls which constant conditions are allowed in `while`, `do...while`, and `for` loops.\n\n- `\"never\"` (or `false`) reports all constant loop conditions.\n- `\"always\"` (or `true`) allows conditions whose type is the literal type `true`, such as\n`while (true)` or `while (variable)` when `variable` has type `true`.\n- `\"only-allowed-literals\"` allows only the literal expressions `true`, `false`, `0`, and\n`1`. Variables whose types are those literal types are still reported.",
|
|
15767
15780
|
"default": "never",
|
|
15768
15781
|
"allOf": [
|
|
15769
15782
|
{
|
|
15770
15783
|
"$ref": "#/definitions/AllowConstantLoopConditions"
|
|
15771
15784
|
}
|
|
15772
15785
|
],
|
|
15773
|
-
"markdownDescription": "
|
|
15786
|
+
"markdownDescription": "Controls which constant conditions are allowed in `while`, `do...while`, and `for` loops.\n\n- `\"never\"` (or `false`) reports all constant loop conditions.\n- `\"always\"` (or `true`) allows conditions whose type is the literal type `true`, such as\n`while (true)` or `while (variable)` when `variable` has type `true`.\n- `\"only-allowed-literals\"` allows only the literal expressions `true`, `false`, `0`, and\n`1`. Variables whose types are those literal types are still reported."
|
|
15774
15787
|
},
|
|
15775
15788
|
"checkTypePredicates": {
|
|
15776
|
-
"description": "Whether to check type predicate functions
|
|
15789
|
+
"description": "Whether to check arguments passed to type predicate and assertion functions.\n\nWhen enabled, the rule reports a call if the argument already satisfies the predicate or\nif an assertion function receives an argument that is always truthy or always falsy.\n\nFor example, `narrow(value)` is unnecessary because `value` already has type `true`:\n\n```ts\ndeclare const narrow: (value: unknown) => value is true;\nconst value = true;\nif (narrow(value)) {\n// ...\n}\n```",
|
|
15777
15790
|
"default": false,
|
|
15778
15791
|
"type": "boolean",
|
|
15779
|
-
"markdownDescription": "Whether to check type predicate functions
|
|
15792
|
+
"markdownDescription": "Whether to check arguments passed to type predicate and assertion functions.\n\nWhen enabled, the rule reports a call if the argument already satisfies the predicate or\nif an assertion function receives an argument that is always truthy or always falsy.\n\nFor example, `narrow(value)` is unnecessary because `value` already has type `true`:\n\n```ts\ndeclare const narrow: (value: unknown) => value is true;\nconst value = true;\nif (narrow(value)) {\n// ...\n}\n```"
|
|
15780
15793
|
}
|
|
15781
15794
|
},
|
|
15782
15795
|
"additionalProperties": false
|
|
@@ -16281,23 +16294,41 @@
|
|
|
16281
16294
|
},
|
|
16282
16295
|
"additionalProperties": false
|
|
16283
16296
|
},
|
|
16284
|
-
"
|
|
16297
|
+
"NoWarningCommentsConfig": {
|
|
16285
16298
|
"type": "object",
|
|
16286
16299
|
"properties": {
|
|
16287
16300
|
"decoration": {
|
|
16301
|
+
"description": "An array of characters to ignore at the start of comments when `location` is `\"start\"`.\n\nUseful for ignoring common comment decorations like `*` in JSDoc-style comments.",
|
|
16302
|
+
"default": [],
|
|
16288
16303
|
"type": "array",
|
|
16289
16304
|
"items": {
|
|
16290
16305
|
"type": "string"
|
|
16291
|
-
}
|
|
16306
|
+
},
|
|
16307
|
+
"uniqueItems": true,
|
|
16308
|
+
"markdownDescription": "An array of characters to ignore at the start of comments when `location` is `\"start\"`.\n\nUseful for ignoring common comment decorations like `*` in JSDoc-style comments."
|
|
16292
16309
|
},
|
|
16293
16310
|
"location": {
|
|
16294
|
-
"
|
|
16311
|
+
"description": "Where to check for the terms.",
|
|
16312
|
+
"default": "start",
|
|
16313
|
+
"allOf": [
|
|
16314
|
+
{
|
|
16315
|
+
"$ref": "#/definitions/Location"
|
|
16316
|
+
}
|
|
16317
|
+
],
|
|
16318
|
+
"markdownDescription": "Where to check for the terms."
|
|
16295
16319
|
},
|
|
16296
16320
|
"terms": {
|
|
16321
|
+
"description": "An array of terms to match. The matching is case-insensitive.",
|
|
16322
|
+
"default": [
|
|
16323
|
+
"todo",
|
|
16324
|
+
"fixme",
|
|
16325
|
+
"xxx"
|
|
16326
|
+
],
|
|
16297
16327
|
"type": "array",
|
|
16298
16328
|
"items": {
|
|
16299
16329
|
"type": "string"
|
|
16300
|
-
}
|
|
16330
|
+
},
|
|
16331
|
+
"markdownDescription": "An array of terms to match. The matching is case-insensitive."
|
|
16301
16332
|
}
|
|
16302
16333
|
},
|
|
16303
16334
|
"additionalProperties": false
|
package/dist/bindings.js
CHANGED
|
@@ -37,7 +37,7 @@ function requireNative() {
|
|
|
37
37
|
}
|
|
38
38
|
try {
|
|
39
39
|
let binding = require("@oxlint/binding-android-arm64"), bindingPackageVersion = require("@oxlint/binding-android-arm64/package.json").version;
|
|
40
|
-
if (bindingPackageVersion !== "1.
|
|
40
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
41
41
|
return binding;
|
|
42
42
|
} catch (e) {
|
|
43
43
|
loadErrors.push(e);
|
|
@@ -50,7 +50,7 @@ function requireNative() {
|
|
|
50
50
|
}
|
|
51
51
|
try {
|
|
52
52
|
let binding = require("@oxlint/binding-android-arm-eabi"), bindingPackageVersion = require("@oxlint/binding-android-arm-eabi/package.json").version;
|
|
53
|
-
if (bindingPackageVersion !== "1.
|
|
53
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
54
54
|
return binding;
|
|
55
55
|
} catch (e) {
|
|
56
56
|
loadErrors.push(e);
|
|
@@ -64,7 +64,7 @@ function requireNative() {
|
|
|
64
64
|
}
|
|
65
65
|
try {
|
|
66
66
|
let binding = require("@oxlint/binding-win32-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-win32-x64-gnu/package.json").version;
|
|
67
|
-
if (bindingPackageVersion !== "1.
|
|
67
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
68
68
|
return binding;
|
|
69
69
|
} catch (e) {
|
|
70
70
|
loadErrors.push(e);
|
|
@@ -77,7 +77,7 @@ function requireNative() {
|
|
|
77
77
|
}
|
|
78
78
|
try {
|
|
79
79
|
let binding = require("@oxlint/binding-win32-x64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-x64-msvc/package.json").version;
|
|
80
|
-
if (bindingPackageVersion !== "1.
|
|
80
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
81
81
|
return binding;
|
|
82
82
|
} catch (e) {
|
|
83
83
|
loadErrors.push(e);
|
|
@@ -91,7 +91,7 @@ function requireNative() {
|
|
|
91
91
|
}
|
|
92
92
|
try {
|
|
93
93
|
let binding = require("@oxlint/binding-win32-ia32-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-ia32-msvc/package.json").version;
|
|
94
|
-
if (bindingPackageVersion !== "1.
|
|
94
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
95
95
|
return binding;
|
|
96
96
|
} catch (e) {
|
|
97
97
|
loadErrors.push(e);
|
|
@@ -104,7 +104,7 @@ function requireNative() {
|
|
|
104
104
|
}
|
|
105
105
|
try {
|
|
106
106
|
let binding = require("@oxlint/binding-win32-arm64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-arm64-msvc/package.json").version;
|
|
107
|
-
if (bindingPackageVersion !== "1.
|
|
107
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
108
108
|
return binding;
|
|
109
109
|
} catch (e) {
|
|
110
110
|
loadErrors.push(e);
|
|
@@ -118,7 +118,7 @@ function requireNative() {
|
|
|
118
118
|
}
|
|
119
119
|
try {
|
|
120
120
|
let binding = require("@oxlint/binding-darwin-universal"), bindingPackageVersion = require("@oxlint/binding-darwin-universal/package.json").version;
|
|
121
|
-
if (bindingPackageVersion !== "1.
|
|
121
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
122
122
|
return binding;
|
|
123
123
|
} catch (e) {
|
|
124
124
|
loadErrors.push(e);
|
|
@@ -131,7 +131,7 @@ function requireNative() {
|
|
|
131
131
|
}
|
|
132
132
|
try {
|
|
133
133
|
let binding = require("@oxlint/binding-darwin-x64"), bindingPackageVersion = require("@oxlint/binding-darwin-x64/package.json").version;
|
|
134
|
-
if (bindingPackageVersion !== "1.
|
|
134
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
135
135
|
return binding;
|
|
136
136
|
} catch (e) {
|
|
137
137
|
loadErrors.push(e);
|
|
@@ -144,7 +144,7 @@ function requireNative() {
|
|
|
144
144
|
}
|
|
145
145
|
try {
|
|
146
146
|
let binding = require("@oxlint/binding-darwin-arm64"), bindingPackageVersion = require("@oxlint/binding-darwin-arm64/package.json").version;
|
|
147
|
-
if (bindingPackageVersion !== "1.
|
|
147
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
148
148
|
return binding;
|
|
149
149
|
} catch (e) {
|
|
150
150
|
loadErrors.push(e);
|
|
@@ -158,7 +158,7 @@ function requireNative() {
|
|
|
158
158
|
}
|
|
159
159
|
try {
|
|
160
160
|
let binding = require("@oxlint/binding-freebsd-x64"), bindingPackageVersion = require("@oxlint/binding-freebsd-x64/package.json").version;
|
|
161
|
-
if (bindingPackageVersion !== "1.
|
|
161
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
162
162
|
return binding;
|
|
163
163
|
} catch (e) {
|
|
164
164
|
loadErrors.push(e);
|
|
@@ -171,7 +171,7 @@ function requireNative() {
|
|
|
171
171
|
}
|
|
172
172
|
try {
|
|
173
173
|
let binding = require("@oxlint/binding-freebsd-arm64"), bindingPackageVersion = require("@oxlint/binding-freebsd-arm64/package.json").version;
|
|
174
|
-
if (bindingPackageVersion !== "1.
|
|
174
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
175
175
|
return binding;
|
|
176
176
|
} catch (e) {
|
|
177
177
|
loadErrors.push(e);
|
|
@@ -185,7 +185,7 @@ function requireNative() {
|
|
|
185
185
|
}
|
|
186
186
|
try {
|
|
187
187
|
let binding = require("@oxlint/binding-linux-x64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-x64-musl/package.json").version;
|
|
188
|
-
if (bindingPackageVersion !== "1.
|
|
188
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
189
189
|
return binding;
|
|
190
190
|
} catch (e) {
|
|
191
191
|
loadErrors.push(e);
|
|
@@ -198,7 +198,7 @@ function requireNative() {
|
|
|
198
198
|
}
|
|
199
199
|
try {
|
|
200
200
|
let binding = require("@oxlint/binding-linux-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-x64-gnu/package.json").version;
|
|
201
|
-
if (bindingPackageVersion !== "1.
|
|
201
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
202
202
|
return binding;
|
|
203
203
|
} catch (e) {
|
|
204
204
|
loadErrors.push(e);
|
|
@@ -212,7 +212,7 @@ function requireNative() {
|
|
|
212
212
|
}
|
|
213
213
|
try {
|
|
214
214
|
let binding = require("@oxlint/binding-linux-arm64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-musl/package.json").version;
|
|
215
|
-
if (bindingPackageVersion !== "1.
|
|
215
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
216
216
|
return binding;
|
|
217
217
|
} catch (e) {
|
|
218
218
|
loadErrors.push(e);
|
|
@@ -225,7 +225,7 @@ function requireNative() {
|
|
|
225
225
|
}
|
|
226
226
|
try {
|
|
227
227
|
let binding = require("@oxlint/binding-linux-arm64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-gnu/package.json").version;
|
|
228
|
-
if (bindingPackageVersion !== "1.
|
|
228
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
229
229
|
return binding;
|
|
230
230
|
} catch (e) {
|
|
231
231
|
loadErrors.push(e);
|
|
@@ -239,7 +239,7 @@ function requireNative() {
|
|
|
239
239
|
}
|
|
240
240
|
try {
|
|
241
241
|
let binding = require("@oxlint/binding-linux-arm-musleabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-musleabihf/package.json").version;
|
|
242
|
-
if (bindingPackageVersion !== "1.
|
|
242
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
243
243
|
return binding;
|
|
244
244
|
} catch (e) {
|
|
245
245
|
loadErrors.push(e);
|
|
@@ -252,7 +252,7 @@ function requireNative() {
|
|
|
252
252
|
}
|
|
253
253
|
try {
|
|
254
254
|
let binding = require("@oxlint/binding-linux-arm-gnueabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-gnueabihf/package.json").version;
|
|
255
|
-
if (bindingPackageVersion !== "1.
|
|
255
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
256
256
|
return binding;
|
|
257
257
|
} catch (e) {
|
|
258
258
|
loadErrors.push(e);
|
|
@@ -266,7 +266,7 @@ function requireNative() {
|
|
|
266
266
|
}
|
|
267
267
|
try {
|
|
268
268
|
let binding = require("@oxlint/binding-linux-loong64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-musl/package.json").version;
|
|
269
|
-
if (bindingPackageVersion !== "1.
|
|
269
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
270
270
|
return binding;
|
|
271
271
|
} catch (e) {
|
|
272
272
|
loadErrors.push(e);
|
|
@@ -279,7 +279,7 @@ function requireNative() {
|
|
|
279
279
|
}
|
|
280
280
|
try {
|
|
281
281
|
let binding = require("@oxlint/binding-linux-loong64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-gnu/package.json").version;
|
|
282
|
-
if (bindingPackageVersion !== "1.
|
|
282
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
283
283
|
return binding;
|
|
284
284
|
} catch (e) {
|
|
285
285
|
loadErrors.push(e);
|
|
@@ -293,7 +293,7 @@ function requireNative() {
|
|
|
293
293
|
}
|
|
294
294
|
try {
|
|
295
295
|
let binding = require("@oxlint/binding-linux-riscv64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-musl/package.json").version;
|
|
296
|
-
if (bindingPackageVersion !== "1.
|
|
296
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
297
297
|
return binding;
|
|
298
298
|
} catch (e) {
|
|
299
299
|
loadErrors.push(e);
|
|
@@ -306,7 +306,7 @@ function requireNative() {
|
|
|
306
306
|
}
|
|
307
307
|
try {
|
|
308
308
|
let binding = require("@oxlint/binding-linux-riscv64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-gnu/package.json").version;
|
|
309
|
-
if (bindingPackageVersion !== "1.
|
|
309
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
310
310
|
return binding;
|
|
311
311
|
} catch (e) {
|
|
312
312
|
loadErrors.push(e);
|
|
@@ -320,7 +320,7 @@ function requireNative() {
|
|
|
320
320
|
}
|
|
321
321
|
try {
|
|
322
322
|
let binding = require("@oxlint/binding-linux-ppc64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-ppc64-gnu/package.json").version;
|
|
323
|
-
if (bindingPackageVersion !== "1.
|
|
323
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
324
324
|
return binding;
|
|
325
325
|
} catch (e) {
|
|
326
326
|
loadErrors.push(e);
|
|
@@ -333,7 +333,7 @@ function requireNative() {
|
|
|
333
333
|
}
|
|
334
334
|
try {
|
|
335
335
|
let binding = require("@oxlint/binding-linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-s390x-gnu/package.json").version;
|
|
336
|
-
if (bindingPackageVersion !== "1.
|
|
336
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
337
337
|
return binding;
|
|
338
338
|
} catch (e) {
|
|
339
339
|
loadErrors.push(e);
|
|
@@ -347,7 +347,7 @@ function requireNative() {
|
|
|
347
347
|
}
|
|
348
348
|
try {
|
|
349
349
|
let binding = require("@oxlint/binding-openharmony-arm64"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm64/package.json").version;
|
|
350
|
-
if (bindingPackageVersion !== "1.
|
|
350
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
351
351
|
return binding;
|
|
352
352
|
} catch (e) {
|
|
353
353
|
loadErrors.push(e);
|
|
@@ -360,7 +360,7 @@ function requireNative() {
|
|
|
360
360
|
}
|
|
361
361
|
try {
|
|
362
362
|
let binding = require("@oxlint/binding-openharmony-x64"), bindingPackageVersion = require("@oxlint/binding-openharmony-x64/package.json").version;
|
|
363
|
-
if (bindingPackageVersion !== "1.
|
|
363
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
364
364
|
return binding;
|
|
365
365
|
} catch (e) {
|
|
366
366
|
loadErrors.push(e);
|
|
@@ -373,7 +373,7 @@ function requireNative() {
|
|
|
373
373
|
}
|
|
374
374
|
try {
|
|
375
375
|
let binding = require("@oxlint/binding-openharmony-arm"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm/package.json").version;
|
|
376
|
-
if (bindingPackageVersion !== "1.
|
|
376
|
+
if (bindingPackageVersion !== "1.77.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.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
377
377
|
return binding;
|
|
378
378
|
} catch (e) {
|
|
379
379
|
loadErrors.push(e);
|
|
@@ -381,29 +381,83 @@ function requireNative() {
|
|
|
381
381
|
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
382
382
|
else loadErrors.push(/* @__PURE__ */ Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
383
383
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
384
|
+
function createLoadErrorChain(errors) {
|
|
385
|
+
return errors.reduce((previous, current) => {
|
|
386
|
+
let message;
|
|
387
|
+
try {
|
|
388
|
+
message = current && typeof current.message == "string" ? current.message : String(current);
|
|
389
|
+
} catch {
|
|
390
|
+
message = "Unknown error";
|
|
391
|
+
}
|
|
392
|
+
let error = Error(message);
|
|
393
|
+
return error.cause = previous, error;
|
|
394
|
+
}, null);
|
|
395
|
+
}
|
|
396
|
+
const __napiWasiFlavors = ["wasm32-wasi"], __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR, __napiWasiFlavorRequested = typeof __napiWasiFlavor == "string" && __napiWasiFlavor.length > 0;
|
|
397
|
+
if (__napiWasiFlavorRequested && __napiWasiFlavors.indexOf(__napiWasiFlavor) === -1) throw Error("Unsupported WASI flavor \"" + __napiWasiFlavor + "\". Available flavors: " + __napiWasiFlavors.join(", "));
|
|
398
|
+
const forceWasiError = process.env.NAPI_RS_FORCE_WASI === "error", forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || forceWasiError || __napiWasiFlavorRequested;
|
|
399
|
+
if (forceWasi || (nativeBinding = requireNative()), !nativeBinding || forceWasi) {
|
|
400
|
+
let wasiBinding = null, wasiBindingLoaded = !1, wasiBindingErrors = [], __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
|
|
401
|
+
try {
|
|
402
|
+
require.resolve(specifier);
|
|
403
|
+
} catch (resolveError) {
|
|
404
|
+
if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") throw resolveError;
|
|
405
|
+
if (isPackage) {
|
|
406
|
+
try {
|
|
407
|
+
require.resolve(specifier + "/package.json");
|
|
408
|
+
} catch (packageError) {
|
|
409
|
+
if (packageError && packageError.code === "MODULE_NOT_FOUND") return resolveError;
|
|
410
|
+
throw resolveError;
|
|
411
|
+
}
|
|
412
|
+
throw resolveError;
|
|
413
|
+
}
|
|
414
|
+
return resolveError;
|
|
415
|
+
}
|
|
416
|
+
if (localArtifacts) {
|
|
417
|
+
let artifactError = null;
|
|
418
|
+
for (let i = 0; i < localArtifacts.length; i++) try {
|
|
419
|
+
return require.resolve(localArtifacts[i]), null;
|
|
420
|
+
} catch (resolveError) {
|
|
421
|
+
if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") throw resolveError;
|
|
422
|
+
artifactError = resolveError;
|
|
423
|
+
}
|
|
424
|
+
return artifactError;
|
|
425
|
+
}
|
|
426
|
+
return null;
|
|
427
|
+
};
|
|
428
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
|
|
429
|
+
let candidateError = null, candidateFailed = !1;
|
|
430
|
+
try {
|
|
431
|
+
candidateError = __napiWasiResolveCandidate("./oxlint.wasi.cjs", !1, ["./oxlint.wasm32-wasi.debug.wasm", "./oxlint.wasm32-wasi.wasm"]), candidateFailed = candidateError !== null, candidateFailed || (wasiBinding = require("./oxlint.wasi.cjs"), nativeBinding = wasiBinding, wasiBindingLoaded = !0);
|
|
432
|
+
} catch (err) {
|
|
433
|
+
candidateError = err, candidateFailed = !0;
|
|
434
|
+
}
|
|
435
|
+
candidateFailed && (wasiBindingErrors.push(candidateError), loadErrors.push(candidateError));
|
|
392
436
|
}
|
|
393
|
-
if (!
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
437
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
|
|
438
|
+
let candidateError = null, candidateFailed = !1;
|
|
439
|
+
try {
|
|
440
|
+
if (candidateError = __napiWasiResolveCandidate("@oxlint/binding-wasm32-wasi", !0, void 0), candidateFailed = candidateError !== null, !candidateFailed) {
|
|
441
|
+
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
|
|
442
|
+
let bindingPackageVersion = require("@oxlint/binding-wasm32-wasi/package.json").version;
|
|
443
|
+
if (bindingPackageVersion !== "1.77.0") throw Error(`WASI binding package version mismatch, expected 1.77.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
444
|
+
}
|
|
445
|
+
wasiBinding = require("@oxlint/binding-wasm32-wasi"), nativeBinding = wasiBinding, wasiBindingLoaded = !0;
|
|
446
|
+
}
|
|
447
|
+
} catch (err) {
|
|
448
|
+
candidateError = err, candidateFailed = !0;
|
|
449
|
+
}
|
|
450
|
+
candidateFailed && (wasiBindingErrors.push(candidateError), loadErrors.push(candidateError));
|
|
397
451
|
}
|
|
398
|
-
if (
|
|
399
|
-
let error = /* @__PURE__ */ Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
400
|
-
throw error.cause =
|
|
452
|
+
if (!wasiBindingLoaded && forceWasi && !forceWasiError && !__napiWasiFlavorRequested && (nativeBinding = requireNative()), (forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
|
|
453
|
+
let error = /* @__PURE__ */ Error(__napiWasiFlavorRequested ? "WASI binding for flavor \"" + __napiWasiFlavor + "\" not found" : "WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
454
|
+
throw error.cause = createLoadErrorChain(wasiBindingErrors), error;
|
|
401
455
|
}
|
|
402
456
|
}
|
|
403
457
|
if (!nativeBinding) {
|
|
404
458
|
if (loadErrors.length > 0) {
|
|
405
459
|
let error = /* @__PURE__ */ Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.");
|
|
406
|
-
throw error.cause = loadErrors
|
|
460
|
+
throw error.cause = createLoadErrorChain(loadErrors), error;
|
|
407
461
|
}
|
|
408
462
|
throw Error("Failed to load native binding");
|
|
409
463
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1153,7 +1153,7 @@ interface DummyRuleMap {
|
|
|
1153
1153
|
"no-useless-return"?: RuleNoConfig;
|
|
1154
1154
|
"no-var"?: RuleNoConfig;
|
|
1155
1155
|
"no-void"?: RuleNoConfig | [AllowWarnDeny, NoVoid];
|
|
1156
|
-
"no-warning-comments"?: RuleNoConfig | [AllowWarnDeny,
|
|
1156
|
+
"no-warning-comments"?: RuleNoConfig | [AllowWarnDeny, NoWarningCommentsConfig];
|
|
1157
1157
|
"no-with"?: RuleNoConfig;
|
|
1158
1158
|
"node/callback-return"?: RuleNoConfig | [AllowWarnDeny, CallbackReturn];
|
|
1159
1159
|
"node/exports-style"?: RuleNoConfig | [AllowWarnDeny, ExportsStyleMode] | [AllowWarnDeny, ExportsStyleMode, ExportsStyleOptions];
|
|
@@ -4062,9 +4062,20 @@ interface NoVoid {
|
|
|
4062
4062
|
*/
|
|
4063
4063
|
allowAsStatement?: boolean;
|
|
4064
4064
|
}
|
|
4065
|
-
interface
|
|
4065
|
+
interface NoWarningCommentsConfig {
|
|
4066
|
+
/**
|
|
4067
|
+
* An array of characters to ignore at the start of comments when `location` is `"start"`.
|
|
4068
|
+
*
|
|
4069
|
+
* Useful for ignoring common comment decorations like `*` in JSDoc-style comments.
|
|
4070
|
+
*/
|
|
4066
4071
|
decoration?: string[];
|
|
4072
|
+
/**
|
|
4073
|
+
* Where to check for the terms.
|
|
4074
|
+
*/
|
|
4067
4075
|
location?: Location;
|
|
4076
|
+
/**
|
|
4077
|
+
* An array of terms to match. The matching is case-insensitive.
|
|
4078
|
+
*/
|
|
4068
4079
|
terms?: string[];
|
|
4069
4080
|
}
|
|
4070
4081
|
interface ExportsStyleOptions {
|
|
@@ -5655,12 +5666,30 @@ interface NoUnnecessaryBooleanLiteralCompareConfig {
|
|
|
5655
5666
|
}
|
|
5656
5667
|
interface NoUnnecessaryConditionConfig {
|
|
5657
5668
|
/**
|
|
5658
|
-
*
|
|
5659
|
-
*
|
|
5669
|
+
* Controls which constant conditions are allowed in `while`, `do...while`, and `for` loops.
|
|
5670
|
+
*
|
|
5671
|
+
* - `"never"` (or `false`) reports all constant loop conditions.
|
|
5672
|
+
* - `"always"` (or `true`) allows conditions whose type is the literal type `true`, such as
|
|
5673
|
+
* `while (true)` or `while (variable)` when `variable` has type `true`.
|
|
5674
|
+
* - `"only-allowed-literals"` allows only the literal expressions `true`, `false`, `0`, and
|
|
5675
|
+
* `1`. Variables whose types are those literal types are still reported.
|
|
5660
5676
|
*/
|
|
5661
5677
|
allowConstantLoopConditions?: AllowConstantLoopConditions;
|
|
5662
5678
|
/**
|
|
5663
|
-
* Whether to check type predicate functions.
|
|
5679
|
+
* Whether to check arguments passed to type predicate and assertion functions.
|
|
5680
|
+
*
|
|
5681
|
+
* When enabled, the rule reports a call if the argument already satisfies the predicate or
|
|
5682
|
+
* if an assertion function receives an argument that is always truthy or always falsy.
|
|
5683
|
+
*
|
|
5684
|
+
* For example, `narrow(value)` is unnecessary because `value` already has type `true`:
|
|
5685
|
+
*
|
|
5686
|
+
* ```ts
|
|
5687
|
+
* declare const narrow: (value: unknown) => value is true;
|
|
5688
|
+
* const value = true;
|
|
5689
|
+
* if (narrow(value)) {
|
|
5690
|
+
* // ...
|
|
5691
|
+
* }
|
|
5692
|
+
* ```
|
|
5664
5693
|
*/
|
|
5665
5694
|
checkTypePredicates?: boolean;
|
|
5666
5695
|
}
|