oxlint 1.76.0 → 1.78.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 +286 -21
- package/dist/bindings.js +391 -326
- package/dist/index.d.ts +105 -9
- package/dist/lint.js +1013 -818
- package/dist/plugins-dev.d.ts +1 -1
- package/dist/plugins-dev.js +15 -15
- package/dist/plugins.js +1 -1
- package/dist/workspace2.js +2 -1
- package/package.json +20 -20
package/dist/bindings.js
CHANGED
|
@@ -29,88 +29,91 @@ function requireNative() {
|
|
|
29
29
|
} catch (err) {
|
|
30
30
|
loadErrors.push(err);
|
|
31
31
|
}
|
|
32
|
-
else if (process.platform === "android")
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
32
|
+
else if (process.platform === "android") {
|
|
33
|
+
if (process.arch === "arm64") {
|
|
34
|
+
try {
|
|
35
|
+
return require("./oxlint.android-arm64.node");
|
|
36
|
+
} catch (e) {
|
|
37
|
+
loadErrors.push(e);
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
let binding = require("@oxlint/binding-android-arm64"), bindingPackageVersion = require("@oxlint/binding-android-arm64/package.json").version;
|
|
41
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
42
|
+
return binding;
|
|
43
|
+
} catch (e) {
|
|
44
|
+
loadErrors.push(e);
|
|
45
|
+
}
|
|
46
|
+
} else if (process.arch === "arm") {
|
|
47
|
+
try {
|
|
48
|
+
return require("./oxlint.android-arm-eabi.node");
|
|
49
|
+
} catch (e) {
|
|
50
|
+
loadErrors.push(e);
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
let binding = require("@oxlint/binding-android-arm-eabi"), bindingPackageVersion = require("@oxlint/binding-android-arm-eabi/package.json").version;
|
|
54
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
55
|
+
return binding;
|
|
56
|
+
} catch (e) {
|
|
57
|
+
loadErrors.push(e);
|
|
58
|
+
}
|
|
59
|
+
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on Android ${process.arch}`));
|
|
60
|
+
} else if (process.platform === "win32") {
|
|
61
|
+
if (process.arch === "x64") {
|
|
62
|
+
if (process.config && process.config.variables && process.config.variables.shlib_suffix === "dll.a" || process.config && process.config.variables && process.config.variables.node_target_type === "shared_library") {
|
|
63
|
+
try {
|
|
64
|
+
return require("./oxlint.win32-x64-gnu.node");
|
|
65
|
+
} catch (e) {
|
|
66
|
+
loadErrors.push(e);
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
let binding = require("@oxlint/binding-win32-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-win32-x64-gnu/package.json").version;
|
|
70
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
71
|
+
return binding;
|
|
72
|
+
} catch (e) {
|
|
73
|
+
loadErrors.push(e);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
try {
|
|
77
|
+
return require("./oxlint.win32-x64-msvc.node");
|
|
78
|
+
} catch (e) {
|
|
79
|
+
loadErrors.push(e);
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
let binding = require("@oxlint/binding-win32-x64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-x64-msvc/package.json").version;
|
|
83
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
84
|
+
return binding;
|
|
85
|
+
} catch (e) {
|
|
86
|
+
loadErrors.push(e);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} else if (process.arch === "ia32") {
|
|
90
|
+
try {
|
|
91
|
+
return require("./oxlint.win32-ia32-msvc.node");
|
|
92
|
+
} catch (e) {
|
|
93
|
+
loadErrors.push(e);
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
let binding = require("@oxlint/binding-win32-ia32-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-ia32-msvc/package.json").version;
|
|
97
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
98
|
+
return binding;
|
|
99
|
+
} catch (e) {
|
|
100
|
+
loadErrors.push(e);
|
|
101
|
+
}
|
|
102
|
+
} else if (process.arch === "arm64") {
|
|
103
|
+
try {
|
|
104
|
+
return require("./oxlint.win32-arm64-msvc.node");
|
|
105
|
+
} catch (e) {
|
|
106
|
+
loadErrors.push(e);
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
let binding = require("@oxlint/binding-win32-arm64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-arm64-msvc/package.json").version;
|
|
110
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
111
|
+
return binding;
|
|
112
|
+
} catch (e) {
|
|
113
|
+
loadErrors.push(e);
|
|
114
|
+
}
|
|
115
|
+
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
116
|
+
} else if (process.platform === "darwin") {
|
|
114
117
|
try {
|
|
115
118
|
return require("./oxlint.darwin-universal.node");
|
|
116
119
|
} catch (e) {
|
|
@@ -118,7 +121,7 @@ function requireNative() {
|
|
|
118
121
|
}
|
|
119
122
|
try {
|
|
120
123
|
let binding = require("@oxlint/binding-darwin-universal"), bindingPackageVersion = require("@oxlint/binding-darwin-universal/package.json").version;
|
|
121
|
-
if (bindingPackageVersion !== "1.
|
|
124
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
122
125
|
return binding;
|
|
123
126
|
} catch (e) {
|
|
124
127
|
loadErrors.push(e);
|
|
@@ -131,7 +134,7 @@ function requireNative() {
|
|
|
131
134
|
}
|
|
132
135
|
try {
|
|
133
136
|
let binding = require("@oxlint/binding-darwin-x64"), bindingPackageVersion = require("@oxlint/binding-darwin-x64/package.json").version;
|
|
134
|
-
if (bindingPackageVersion !== "1.
|
|
137
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
135
138
|
return binding;
|
|
136
139
|
} catch (e) {
|
|
137
140
|
loadErrors.push(e);
|
|
@@ -144,266 +147,328 @@ function requireNative() {
|
|
|
144
147
|
}
|
|
145
148
|
try {
|
|
146
149
|
let binding = require("@oxlint/binding-darwin-arm64"), bindingPackageVersion = require("@oxlint/binding-darwin-arm64/package.json").version;
|
|
147
|
-
if (bindingPackageVersion !== "1.
|
|
150
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
148
151
|
return binding;
|
|
149
152
|
} catch (e) {
|
|
150
153
|
loadErrors.push(e);
|
|
151
154
|
}
|
|
152
155
|
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
153
|
-
} else if (process.platform === "freebsd")
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
156
|
+
} else if (process.platform === "freebsd") {
|
|
157
|
+
if (process.arch === "x64") {
|
|
158
|
+
try {
|
|
159
|
+
return require("./oxlint.freebsd-x64.node");
|
|
160
|
+
} catch (e) {
|
|
161
|
+
loadErrors.push(e);
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
let binding = require("@oxlint/binding-freebsd-x64"), bindingPackageVersion = require("@oxlint/binding-freebsd-x64/package.json").version;
|
|
165
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
166
|
+
return binding;
|
|
167
|
+
} catch (e) {
|
|
168
|
+
loadErrors.push(e);
|
|
169
|
+
}
|
|
170
|
+
} else if (process.arch === "arm64") {
|
|
171
|
+
try {
|
|
172
|
+
return require("./oxlint.freebsd-arm64.node");
|
|
173
|
+
} catch (e) {
|
|
174
|
+
loadErrors.push(e);
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
let binding = require("@oxlint/binding-freebsd-arm64"), bindingPackageVersion = require("@oxlint/binding-freebsd-arm64/package.json").version;
|
|
178
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
179
|
+
return binding;
|
|
180
|
+
} catch (e) {
|
|
181
|
+
loadErrors.push(e);
|
|
182
|
+
}
|
|
183
|
+
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
184
|
+
} else if (process.platform === "linux") {
|
|
185
|
+
if (process.arch === "x64") {
|
|
186
|
+
if (isMusl()) {
|
|
187
|
+
try {
|
|
188
|
+
return require("./oxlint.linux-x64-musl.node");
|
|
189
|
+
} catch (e) {
|
|
190
|
+
loadErrors.push(e);
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
let binding = require("@oxlint/binding-linux-x64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-x64-musl/package.json").version;
|
|
194
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
195
|
+
return binding;
|
|
196
|
+
} catch (e) {
|
|
197
|
+
loadErrors.push(e);
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
try {
|
|
201
|
+
return require("./oxlint.linux-x64-gnu.node");
|
|
202
|
+
} catch (e) {
|
|
203
|
+
loadErrors.push(e);
|
|
204
|
+
}
|
|
205
|
+
try {
|
|
206
|
+
let binding = require("@oxlint/binding-linux-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-x64-gnu/package.json").version;
|
|
207
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
208
|
+
return binding;
|
|
209
|
+
} catch (e) {
|
|
210
|
+
loadErrors.push(e);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
} else if (process.arch === "arm64") {
|
|
214
|
+
if (isMusl()) {
|
|
215
|
+
try {
|
|
216
|
+
return require("./oxlint.linux-arm64-musl.node");
|
|
217
|
+
} catch (e) {
|
|
218
|
+
loadErrors.push(e);
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
let binding = require("@oxlint/binding-linux-arm64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-musl/package.json").version;
|
|
222
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
223
|
+
return binding;
|
|
224
|
+
} catch (e) {
|
|
225
|
+
loadErrors.push(e);
|
|
226
|
+
}
|
|
227
|
+
} else {
|
|
228
|
+
try {
|
|
229
|
+
return require("./oxlint.linux-arm64-gnu.node");
|
|
230
|
+
} catch (e) {
|
|
231
|
+
loadErrors.push(e);
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
let binding = require("@oxlint/binding-linux-arm64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-gnu/package.json").version;
|
|
235
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
236
|
+
return binding;
|
|
237
|
+
} catch (e) {
|
|
238
|
+
loadErrors.push(e);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
} else if (process.arch === "arm") {
|
|
242
|
+
if (isMusl()) {
|
|
243
|
+
try {
|
|
244
|
+
return require("./oxlint.linux-arm-musleabihf.node");
|
|
245
|
+
} catch (e) {
|
|
246
|
+
loadErrors.push(e);
|
|
247
|
+
}
|
|
248
|
+
try {
|
|
249
|
+
let binding = require("@oxlint/binding-linux-arm-musleabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-musleabihf/package.json").version;
|
|
250
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
251
|
+
return binding;
|
|
252
|
+
} catch (e) {
|
|
253
|
+
loadErrors.push(e);
|
|
254
|
+
}
|
|
255
|
+
} else {
|
|
256
|
+
try {
|
|
257
|
+
return require("./oxlint.linux-arm-gnueabihf.node");
|
|
258
|
+
} catch (e) {
|
|
259
|
+
loadErrors.push(e);
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
let binding = require("@oxlint/binding-linux-arm-gnueabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-gnueabihf/package.json").version;
|
|
263
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
264
|
+
return binding;
|
|
265
|
+
} catch (e) {
|
|
266
|
+
loadErrors.push(e);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
} else if (process.arch === "loong64") {
|
|
270
|
+
if (isMusl()) {
|
|
271
|
+
try {
|
|
272
|
+
return require("./oxlint.linux-loong64-musl.node");
|
|
273
|
+
} catch (e) {
|
|
274
|
+
loadErrors.push(e);
|
|
275
|
+
}
|
|
276
|
+
try {
|
|
277
|
+
let binding = require("@oxlint/binding-linux-loong64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-musl/package.json").version;
|
|
278
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
279
|
+
return binding;
|
|
280
|
+
} catch (e) {
|
|
281
|
+
loadErrors.push(e);
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
try {
|
|
285
|
+
return require("./oxlint.linux-loong64-gnu.node");
|
|
286
|
+
} catch (e) {
|
|
287
|
+
loadErrors.push(e);
|
|
288
|
+
}
|
|
289
|
+
try {
|
|
290
|
+
let binding = require("@oxlint/binding-linux-loong64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-gnu/package.json").version;
|
|
291
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
292
|
+
return binding;
|
|
293
|
+
} catch (e) {
|
|
294
|
+
loadErrors.push(e);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
} else if (process.arch === "riscv64") {
|
|
298
|
+
if (isMusl()) {
|
|
299
|
+
try {
|
|
300
|
+
return require("./oxlint.linux-riscv64-musl.node");
|
|
301
|
+
} catch (e) {
|
|
302
|
+
loadErrors.push(e);
|
|
303
|
+
}
|
|
304
|
+
try {
|
|
305
|
+
let binding = require("@oxlint/binding-linux-riscv64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-musl/package.json").version;
|
|
306
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
307
|
+
return binding;
|
|
308
|
+
} catch (e) {
|
|
309
|
+
loadErrors.push(e);
|
|
310
|
+
}
|
|
311
|
+
} else {
|
|
312
|
+
try {
|
|
313
|
+
return require("./oxlint.linux-riscv64-gnu.node");
|
|
314
|
+
} catch (e) {
|
|
315
|
+
loadErrors.push(e);
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
let binding = require("@oxlint/binding-linux-riscv64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-gnu/package.json").version;
|
|
319
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
320
|
+
return binding;
|
|
321
|
+
} catch (e) {
|
|
322
|
+
loadErrors.push(e);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
} else if (process.arch === "ppc64") {
|
|
326
|
+
try {
|
|
327
|
+
return require("./oxlint.linux-ppc64-gnu.node");
|
|
328
|
+
} catch (e) {
|
|
329
|
+
loadErrors.push(e);
|
|
330
|
+
}
|
|
331
|
+
try {
|
|
332
|
+
let binding = require("@oxlint/binding-linux-ppc64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-ppc64-gnu/package.json").version;
|
|
333
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
334
|
+
return binding;
|
|
335
|
+
} catch (e) {
|
|
336
|
+
loadErrors.push(e);
|
|
337
|
+
}
|
|
338
|
+
} else if (process.arch === "s390x") {
|
|
339
|
+
try {
|
|
340
|
+
return require("./oxlint.linux-s390x-gnu.node");
|
|
341
|
+
} catch (e) {
|
|
342
|
+
loadErrors.push(e);
|
|
343
|
+
}
|
|
344
|
+
try {
|
|
345
|
+
let binding = require("@oxlint/binding-linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-s390x-gnu/package.json").version;
|
|
346
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
347
|
+
return binding;
|
|
348
|
+
} catch (e) {
|
|
349
|
+
loadErrors.push(e);
|
|
350
|
+
}
|
|
351
|
+
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
352
|
+
} else if (process.platform === "openharmony") {
|
|
353
|
+
if (process.arch === "arm64") {
|
|
354
|
+
try {
|
|
355
|
+
return require("./oxlint.openharmony-arm64.node");
|
|
356
|
+
} catch (e) {
|
|
357
|
+
loadErrors.push(e);
|
|
358
|
+
}
|
|
359
|
+
try {
|
|
360
|
+
let binding = require("@oxlint/binding-openharmony-arm64"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm64/package.json").version;
|
|
361
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
362
|
+
return binding;
|
|
363
|
+
} catch (e) {
|
|
364
|
+
loadErrors.push(e);
|
|
365
|
+
}
|
|
366
|
+
} else if (process.arch === "x64") {
|
|
367
|
+
try {
|
|
368
|
+
return require("./oxlint.openharmony-x64.node");
|
|
369
|
+
} catch (e) {
|
|
370
|
+
loadErrors.push(e);
|
|
371
|
+
}
|
|
372
|
+
try {
|
|
373
|
+
let binding = require("@oxlint/binding-openharmony-x64"), bindingPackageVersion = require("@oxlint/binding-openharmony-x64/package.json").version;
|
|
374
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
375
|
+
return binding;
|
|
376
|
+
} catch (e) {
|
|
377
|
+
loadErrors.push(e);
|
|
378
|
+
}
|
|
379
|
+
} else if (process.arch === "arm") {
|
|
380
|
+
try {
|
|
381
|
+
return require("./oxlint.openharmony-arm.node");
|
|
382
|
+
} catch (e) {
|
|
383
|
+
loadErrors.push(e);
|
|
384
|
+
}
|
|
385
|
+
try {
|
|
386
|
+
let binding = require("@oxlint/binding-openharmony-arm"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm/package.json").version;
|
|
387
|
+
if (bindingPackageVersion !== "1.78.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.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
388
|
+
return binding;
|
|
389
|
+
} catch (e) {
|
|
390
|
+
loadErrors.push(e);
|
|
391
|
+
}
|
|
392
|
+
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
393
|
+
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
394
|
+
}
|
|
395
|
+
function createLoadErrorChain(errors) {
|
|
396
|
+
return errors.reduce((previous, current) => {
|
|
397
|
+
let message;
|
|
294
398
|
try {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
} catch (e) {
|
|
299
|
-
loadErrors.push(e);
|
|
399
|
+
message = current && typeof current.message == "string" ? current.message : String(current);
|
|
400
|
+
} catch {
|
|
401
|
+
message = "Unknown error";
|
|
300
402
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
403
|
+
let error = Error(message);
|
|
404
|
+
return error.cause = previous, error;
|
|
405
|
+
}, null);
|
|
406
|
+
}
|
|
407
|
+
const __napiWasiFlavors = ["wasm32-wasi"], __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR, __napiWasiFlavorRequested = typeof __napiWasiFlavor == "string" && __napiWasiFlavor.length > 0;
|
|
408
|
+
if (__napiWasiFlavorRequested && __napiWasiFlavors.indexOf(__napiWasiFlavor) === -1) throw Error("Unsupported WASI flavor \"" + __napiWasiFlavor + "\". Available flavors: " + __napiWasiFlavors.join(", "));
|
|
409
|
+
const forceWasiError = process.env.NAPI_RS_FORCE_WASI === "error", forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || forceWasiError || __napiWasiFlavorRequested;
|
|
410
|
+
if (forceWasi || (nativeBinding = requireNative()), !nativeBinding || forceWasi) {
|
|
411
|
+
let wasiBinding = null, wasiBindingLoaded = !1, wasiBindingErrors = [], __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
|
|
412
|
+
try {
|
|
413
|
+
require.resolve(specifier);
|
|
414
|
+
} catch (resolveError) {
|
|
415
|
+
if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") throw resolveError;
|
|
416
|
+
if (isPackage) {
|
|
417
|
+
try {
|
|
418
|
+
require.resolve(specifier + "/package.json");
|
|
419
|
+
} catch (packageError) {
|
|
420
|
+
if (packageError && packageError.code === "MODULE_NOT_FOUND") return resolveError;
|
|
421
|
+
throw resolveError;
|
|
422
|
+
}
|
|
423
|
+
throw resolveError;
|
|
424
|
+
}
|
|
425
|
+
return resolveError;
|
|
426
|
+
}
|
|
427
|
+
if (localArtifacts) {
|
|
428
|
+
let artifactError = null;
|
|
429
|
+
for (let i = 0; i < localArtifacts.length; i++) try {
|
|
430
|
+
return require.resolve(localArtifacts[i]), null;
|
|
431
|
+
} catch (resolveError) {
|
|
432
|
+
if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") throw resolveError;
|
|
433
|
+
artifactError = resolveError;
|
|
434
|
+
}
|
|
435
|
+
return artifactError;
|
|
306
436
|
}
|
|
437
|
+
return null;
|
|
438
|
+
};
|
|
439
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
|
|
440
|
+
let candidateError = null, candidateFailed = !1;
|
|
307
441
|
try {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
} catch (e) {
|
|
312
|
-
loadErrors.push(e);
|
|
442
|
+
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);
|
|
443
|
+
} catch (err) {
|
|
444
|
+
candidateError = err, candidateFailed = !0;
|
|
313
445
|
}
|
|
446
|
+
candidateFailed && (wasiBindingErrors.push(candidateError), loadErrors.push(candidateError));
|
|
314
447
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
} catch (
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
} else if (process.arch === "s390x") {
|
|
329
|
-
try {
|
|
330
|
-
return require("./oxlint.linux-s390x-gnu.node");
|
|
331
|
-
} catch (e) {
|
|
332
|
-
loadErrors.push(e);
|
|
333
|
-
}
|
|
334
|
-
try {
|
|
335
|
-
let binding = require("@oxlint/binding-linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-s390x-gnu/package.json").version;
|
|
336
|
-
if (bindingPackageVersion !== "1.76.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.76.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
337
|
-
return binding;
|
|
338
|
-
} catch (e) {
|
|
339
|
-
loadErrors.push(e);
|
|
340
|
-
}
|
|
341
|
-
} else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
342
|
-
else if (process.platform === "openharmony") if (process.arch === "arm64") {
|
|
343
|
-
try {
|
|
344
|
-
return require("./oxlint.openharmony-arm64.node");
|
|
345
|
-
} catch (e) {
|
|
346
|
-
loadErrors.push(e);
|
|
347
|
-
}
|
|
348
|
-
try {
|
|
349
|
-
let binding = require("@oxlint/binding-openharmony-arm64"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm64/package.json").version;
|
|
350
|
-
if (bindingPackageVersion !== "1.76.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.76.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
351
|
-
return binding;
|
|
352
|
-
} catch (e) {
|
|
353
|
-
loadErrors.push(e);
|
|
354
|
-
}
|
|
355
|
-
} else if (process.arch === "x64") {
|
|
356
|
-
try {
|
|
357
|
-
return require("./oxlint.openharmony-x64.node");
|
|
358
|
-
} catch (e) {
|
|
359
|
-
loadErrors.push(e);
|
|
360
|
-
}
|
|
361
|
-
try {
|
|
362
|
-
let binding = require("@oxlint/binding-openharmony-x64"), bindingPackageVersion = require("@oxlint/binding-openharmony-x64/package.json").version;
|
|
363
|
-
if (bindingPackageVersion !== "1.76.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.76.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
364
|
-
return binding;
|
|
365
|
-
} catch (e) {
|
|
366
|
-
loadErrors.push(e);
|
|
367
|
-
}
|
|
368
|
-
} else if (process.arch === "arm") {
|
|
369
|
-
try {
|
|
370
|
-
return require("./oxlint.openharmony-arm.node");
|
|
371
|
-
} catch (e) {
|
|
372
|
-
loadErrors.push(e);
|
|
373
|
-
}
|
|
374
|
-
try {
|
|
375
|
-
let binding = require("@oxlint/binding-openharmony-arm"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm/package.json").version;
|
|
376
|
-
if (bindingPackageVersion !== "1.76.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.76.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
377
|
-
return binding;
|
|
378
|
-
} catch (e) {
|
|
379
|
-
loadErrors.push(e);
|
|
448
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
|
|
449
|
+
let candidateError = null, candidateFailed = !1;
|
|
450
|
+
try {
|
|
451
|
+
if (candidateError = __napiWasiResolveCandidate("@oxlint/binding-wasm32-wasi", !0, void 0), candidateFailed = candidateError !== null, !candidateFailed) {
|
|
452
|
+
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
|
|
453
|
+
let bindingPackageVersion = require("@oxlint/binding-wasm32-wasi/package.json").version;
|
|
454
|
+
if (bindingPackageVersion !== "1.78.0") throw Error(`WASI binding package version mismatch, expected 1.78.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
455
|
+
}
|
|
456
|
+
wasiBinding = require("@oxlint/binding-wasm32-wasi"), nativeBinding = wasiBinding, wasiBindingLoaded = !0;
|
|
457
|
+
}
|
|
458
|
+
} catch (err) {
|
|
459
|
+
candidateError = err, candidateFailed = !0;
|
|
380
460
|
}
|
|
381
|
-
|
|
382
|
-
else loadErrors.push(/* @__PURE__ */ Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
383
|
-
}
|
|
384
|
-
nativeBinding = requireNative();
|
|
385
|
-
const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || process.env.NAPI_RS_FORCE_WASI === "error";
|
|
386
|
-
if (!nativeBinding || forceWasi) {
|
|
387
|
-
let wasiBinding = null, wasiBindingError = null;
|
|
388
|
-
try {
|
|
389
|
-
wasiBinding = require("./oxlint.wasi.cjs"), nativeBinding = wasiBinding;
|
|
390
|
-
} catch (err) {
|
|
391
|
-
forceWasi && (wasiBindingError = err);
|
|
392
|
-
}
|
|
393
|
-
if (!nativeBinding || forceWasi) try {
|
|
394
|
-
wasiBinding = require("@oxlint/binding-wasm32-wasi"), nativeBinding = wasiBinding;
|
|
395
|
-
} catch (err) {
|
|
396
|
-
forceWasi && (wasiBindingError ? wasiBindingError.cause = err : wasiBindingError = err, loadErrors.push(err));
|
|
461
|
+
candidateFailed && (wasiBindingErrors.push(candidateError), loadErrors.push(candidateError));
|
|
397
462
|
}
|
|
398
|
-
if (
|
|
399
|
-
let error = /* @__PURE__ */ Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
400
|
-
throw error.cause =
|
|
463
|
+
if (!wasiBindingLoaded && forceWasi && !forceWasiError && !__napiWasiFlavorRequested && (nativeBinding = requireNative()), (forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
|
|
464
|
+
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");
|
|
465
|
+
throw error.cause = createLoadErrorChain(wasiBindingErrors), error;
|
|
401
466
|
}
|
|
402
467
|
}
|
|
403
468
|
if (!nativeBinding) {
|
|
404
469
|
if (loadErrors.length > 0) {
|
|
405
470
|
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
|
|
471
|
+
throw error.cause = createLoadErrorChain(loadErrors), error;
|
|
407
472
|
}
|
|
408
473
|
throw Error("Failed to load native binding");
|
|
409
474
|
}
|