oxlint 1.61.0 → 1.61.1

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.
@@ -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
- "type": "integer",
390
- "format": "uint",
391
- "minimum": 0.0,
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint",
3
- "version": "1.61.0",
3
+ "version": "1.61.1",
4
4
  "description": "Linter for the JavaScript Oxidation Compiler",
5
5
  "keywords": [
6
6
  "eslint",
@@ -81,26 +81,5 @@
81
81
  "engines": {
82
82
  "node": "^20.19.0 || >=22.12.0"
83
83
  },
84
- "preferUnplugged": true,
85
- "optionalDependencies": {
86
- "@oxlint/binding-darwin-arm64": "1.61.0",
87
- "@oxlint/binding-android-arm64": "1.61.0",
88
- "@oxlint/binding-win32-arm64-msvc": "1.61.0",
89
- "@oxlint/binding-linux-arm64-gnu": "1.61.0",
90
- "@oxlint/binding-linux-arm64-musl": "1.61.0",
91
- "@oxlint/binding-openharmony-arm64": "1.61.0",
92
- "@oxlint/binding-android-arm-eabi": "1.61.0",
93
- "@oxlint/binding-linux-arm-gnueabihf": "1.61.0",
94
- "@oxlint/binding-linux-arm-musleabihf": "1.61.0",
95
- "@oxlint/binding-win32-ia32-msvc": "1.61.0",
96
- "@oxlint/binding-linux-ppc64-gnu": "1.61.0",
97
- "@oxlint/binding-linux-riscv64-gnu": "1.61.0",
98
- "@oxlint/binding-linux-riscv64-musl": "1.61.0",
99
- "@oxlint/binding-linux-s390x-gnu": "1.61.0",
100
- "@oxlint/binding-darwin-x64": "1.61.0",
101
- "@oxlint/binding-win32-x64-msvc": "1.61.0",
102
- "@oxlint/binding-freebsd-x64": "1.61.0",
103
- "@oxlint/binding-linux-x64-gnu": "1.61.0",
104
- "@oxlint/binding-linux-x64-musl": "1.61.0"
105
- }
106
- }
84
+ "preferUnplugged": true
85
+ }
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024-present VoidZero Inc. & Contributors
4
- Copyright (c) 2023 Boshen
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.
package/dist/bindings.js DELETED
@@ -1,405 +0,0 @@
1
- import { n as ArrayIsArray } from "./globals.js";
2
- import { createRequire } from "node:module";
3
- //#region src-js/bindings.js
4
- const require = createRequire(import.meta.url);
5
- new URL(".", import.meta.url).pathname;
6
- const { readFileSync } = require("node:fs");
7
- let nativeBinding = null;
8
- const loadErrors = [], isMusl = () => {
9
- let musl = !1;
10
- return process.platform === "linux" && (musl = isMuslFromFilesystem(), musl === null && (musl = isMuslFromReport()), musl === null && (musl = isMuslFromChildProcess())), musl;
11
- }, isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-"), isMuslFromFilesystem = () => {
12
- try {
13
- return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
14
- } catch {
15
- return null;
16
- }
17
- }, isMuslFromReport = () => {
18
- let report = null;
19
- return typeof process.report?.getReport == "function" && (process.report.excludeNetwork = !0, report = process.report.getReport()), report ? report.header && report.header.glibcVersionRuntime ? !1 : !!(ArrayIsArray(report.sharedObjects) && report.sharedObjects.some(isFileMusl)) : null;
20
- }, isMuslFromChildProcess = () => {
21
- try {
22
- return require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
23
- } catch {
24
- return !1;
25
- }
26
- };
27
- function requireNative() {
28
- if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
29
- return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
30
- } catch (err) {
31
- loadErrors.push(err);
32
- }
33
- else if (process.platform === "android") 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.61.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.61.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.61.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.61.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") if (process.arch === "x64") if (process.config?.variables?.shlib_suffix === "dll.a" || process.config?.variables?.node_target_type === "shared_library") {
61
- try {
62
- return require("./oxlint.win32-x64-gnu.node");
63
- } catch (e) {
64
- loadErrors.push(e);
65
- }
66
- try {
67
- let binding = require("@oxlint/binding-win32-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-win32-x64-gnu/package.json").version;
68
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
69
- return binding;
70
- } catch (e) {
71
- loadErrors.push(e);
72
- }
73
- } else {
74
- try {
75
- return require("./oxlint.win32-x64-msvc.node");
76
- } catch (e) {
77
- loadErrors.push(e);
78
- }
79
- try {
80
- let binding = require("@oxlint/binding-win32-x64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-x64-msvc/package.json").version;
81
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
82
- return binding;
83
- } catch (e) {
84
- loadErrors.push(e);
85
- }
86
- }
87
- else if (process.arch === "ia32") {
88
- try {
89
- return require("./oxlint.win32-ia32-msvc.node");
90
- } catch (e) {
91
- loadErrors.push(e);
92
- }
93
- try {
94
- let binding = require("@oxlint/binding-win32-ia32-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-ia32-msvc/package.json").version;
95
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
96
- return binding;
97
- } catch (e) {
98
- loadErrors.push(e);
99
- }
100
- } else if (process.arch === "arm64") {
101
- try {
102
- return require("./oxlint.win32-arm64-msvc.node");
103
- } catch (e) {
104
- loadErrors.push(e);
105
- }
106
- try {
107
- let binding = require("@oxlint/binding-win32-arm64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-arm64-msvc/package.json").version;
108
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
109
- return binding;
110
- } catch (e) {
111
- loadErrors.push(e);
112
- }
113
- } else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on Windows: ${process.arch}`));
114
- else if (process.platform === "darwin") {
115
- try {
116
- return require("./oxlint.darwin-universal.node");
117
- } catch (e) {
118
- loadErrors.push(e);
119
- }
120
- try {
121
- let binding = require("@oxlint/binding-darwin-universal"), bindingPackageVersion = require("@oxlint/binding-darwin-universal/package.json").version;
122
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
123
- return binding;
124
- } catch (e) {
125
- loadErrors.push(e);
126
- }
127
- if (process.arch === "x64") {
128
- try {
129
- return require("./oxlint.darwin-x64.node");
130
- } catch (e) {
131
- loadErrors.push(e);
132
- }
133
- try {
134
- let binding = require("@oxlint/binding-darwin-x64"), bindingPackageVersion = require("@oxlint/binding-darwin-x64/package.json").version;
135
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
136
- return binding;
137
- } catch (e) {
138
- loadErrors.push(e);
139
- }
140
- } else if (process.arch === "arm64") {
141
- try {
142
- return require("./oxlint.darwin-arm64.node");
143
- } catch (e) {
144
- loadErrors.push(e);
145
- }
146
- try {
147
- let binding = require("@oxlint/binding-darwin-arm64"), bindingPackageVersion = require("@oxlint/binding-darwin-arm64/package.json").version;
148
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
149
- return binding;
150
- } catch (e) {
151
- loadErrors.push(e);
152
- }
153
- } else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on macOS: ${process.arch}`));
154
- } else if (process.platform === "freebsd") if (process.arch === "x64") {
155
- try {
156
- return require("./oxlint.freebsd-x64.node");
157
- } catch (e) {
158
- loadErrors.push(e);
159
- }
160
- try {
161
- let binding = require("@oxlint/binding-freebsd-x64"), bindingPackageVersion = require("@oxlint/binding-freebsd-x64/package.json").version;
162
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
163
- return binding;
164
- } catch (e) {
165
- loadErrors.push(e);
166
- }
167
- } else if (process.arch === "arm64") {
168
- try {
169
- return require("./oxlint.freebsd-arm64.node");
170
- } catch (e) {
171
- loadErrors.push(e);
172
- }
173
- try {
174
- let binding = require("@oxlint/binding-freebsd-arm64"), bindingPackageVersion = require("@oxlint/binding-freebsd-arm64/package.json").version;
175
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
176
- return binding;
177
- } catch (e) {
178
- loadErrors.push(e);
179
- }
180
- } else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
181
- else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
182
- try {
183
- return require("./oxlint.linux-x64-musl.node");
184
- } catch (e) {
185
- loadErrors.push(e);
186
- }
187
- try {
188
- let binding = require("@oxlint/binding-linux-x64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-x64-musl/package.json").version;
189
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
190
- return binding;
191
- } catch (e) {
192
- loadErrors.push(e);
193
- }
194
- } else {
195
- try {
196
- return require("./oxlint.linux-x64-gnu.node");
197
- } catch (e) {
198
- loadErrors.push(e);
199
- }
200
- try {
201
- let binding = require("@oxlint/binding-linux-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-x64-gnu/package.json").version;
202
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
203
- return binding;
204
- } catch (e) {
205
- loadErrors.push(e);
206
- }
207
- }
208
- else if (process.arch === "arm64") if (isMusl()) {
209
- try {
210
- return require("./oxlint.linux-arm64-musl.node");
211
- } catch (e) {
212
- loadErrors.push(e);
213
- }
214
- try {
215
- let binding = require("@oxlint/binding-linux-arm64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-musl/package.json").version;
216
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
217
- return binding;
218
- } catch (e) {
219
- loadErrors.push(e);
220
- }
221
- } else {
222
- try {
223
- return require("./oxlint.linux-arm64-gnu.node");
224
- } catch (e) {
225
- loadErrors.push(e);
226
- }
227
- try {
228
- let binding = require("@oxlint/binding-linux-arm64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-gnu/package.json").version;
229
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
230
- return binding;
231
- } catch (e) {
232
- loadErrors.push(e);
233
- }
234
- }
235
- else if (process.arch === "arm") if (isMusl()) {
236
- try {
237
- return require("./oxlint.linux-arm-musleabihf.node");
238
- } catch (e) {
239
- loadErrors.push(e);
240
- }
241
- try {
242
- let binding = require("@oxlint/binding-linux-arm-musleabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-musleabihf/package.json").version;
243
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
244
- return binding;
245
- } catch (e) {
246
- loadErrors.push(e);
247
- }
248
- } else {
249
- try {
250
- return require("./oxlint.linux-arm-gnueabihf.node");
251
- } catch (e) {
252
- loadErrors.push(e);
253
- }
254
- try {
255
- let binding = require("@oxlint/binding-linux-arm-gnueabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-gnueabihf/package.json").version;
256
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
257
- return binding;
258
- } catch (e) {
259
- loadErrors.push(e);
260
- }
261
- }
262
- else if (process.arch === "loong64") if (isMusl()) {
263
- try {
264
- return require("./oxlint.linux-loong64-musl.node");
265
- } catch (e) {
266
- loadErrors.push(e);
267
- }
268
- try {
269
- let binding = require("@oxlint/binding-linux-loong64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-musl/package.json").version;
270
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
271
- return binding;
272
- } catch (e) {
273
- loadErrors.push(e);
274
- }
275
- } else {
276
- try {
277
- return require("./oxlint.linux-loong64-gnu.node");
278
- } catch (e) {
279
- loadErrors.push(e);
280
- }
281
- try {
282
- let binding = require("@oxlint/binding-linux-loong64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-gnu/package.json").version;
283
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
284
- return binding;
285
- } catch (e) {
286
- loadErrors.push(e);
287
- }
288
- }
289
- else if (process.arch === "riscv64") if (isMusl()) {
290
- try {
291
- return require("./oxlint.linux-riscv64-musl.node");
292
- } catch (e) {
293
- loadErrors.push(e);
294
- }
295
- try {
296
- let binding = require("@oxlint/binding-linux-riscv64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-musl/package.json").version;
297
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
298
- return binding;
299
- } catch (e) {
300
- loadErrors.push(e);
301
- }
302
- } else {
303
- try {
304
- return require("./oxlint.linux-riscv64-gnu.node");
305
- } catch (e) {
306
- loadErrors.push(e);
307
- }
308
- try {
309
- let binding = require("@oxlint/binding-linux-riscv64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-gnu/package.json").version;
310
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
311
- return binding;
312
- } catch (e) {
313
- loadErrors.push(e);
314
- }
315
- }
316
- else if (process.arch === "ppc64") {
317
- try {
318
- return require("./oxlint.linux-ppc64-gnu.node");
319
- } catch (e) {
320
- loadErrors.push(e);
321
- }
322
- try {
323
- let binding = require("@oxlint/binding-linux-ppc64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-ppc64-gnu/package.json").version;
324
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
325
- return binding;
326
- } catch (e) {
327
- loadErrors.push(e);
328
- }
329
- } else if (process.arch === "s390x") {
330
- try {
331
- return require("./oxlint.linux-s390x-gnu.node");
332
- } catch (e) {
333
- loadErrors.push(e);
334
- }
335
- try {
336
- let binding = require("@oxlint/binding-linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-s390x-gnu/package.json").version;
337
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
338
- return binding;
339
- } catch (e) {
340
- loadErrors.push(e);
341
- }
342
- } else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on Linux: ${process.arch}`));
343
- else if (process.platform === "openharmony") if (process.arch === "arm64") {
344
- try {
345
- return require("./oxlint.openharmony-arm64.node");
346
- } catch (e) {
347
- loadErrors.push(e);
348
- }
349
- try {
350
- let binding = require("@oxlint/binding-openharmony-arm64"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm64/package.json").version;
351
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
352
- return binding;
353
- } catch (e) {
354
- loadErrors.push(e);
355
- }
356
- } else if (process.arch === "x64") {
357
- try {
358
- return require("./oxlint.openharmony-x64.node");
359
- } catch (e) {
360
- loadErrors.push(e);
361
- }
362
- try {
363
- let binding = require("@oxlint/binding-openharmony-x64"), bindingPackageVersion = require("@oxlint/binding-openharmony-x64/package.json").version;
364
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
365
- return binding;
366
- } catch (e) {
367
- loadErrors.push(e);
368
- }
369
- } else if (process.arch === "arm") {
370
- try {
371
- return require("./oxlint.openharmony-arm.node");
372
- } catch (e) {
373
- loadErrors.push(e);
374
- }
375
- try {
376
- let binding = require("@oxlint/binding-openharmony-arm"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm/package.json").version;
377
- if (bindingPackageVersion !== "1.61.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.61.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
378
- return binding;
379
- } catch (e) {
380
- loadErrors.push(e);
381
- }
382
- } else loadErrors.push(/* @__PURE__ */ Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
383
- else loadErrors.push(/* @__PURE__ */ Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
384
- }
385
- if (nativeBinding = requireNative(), !nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
386
- let wasiBinding = null, wasiBindingError = null;
387
- try {
388
- wasiBinding = require("./oxlint.wasi.cjs"), nativeBinding = wasiBinding;
389
- } catch (err) {
390
- process.env.NAPI_RS_FORCE_WASI && (wasiBindingError = err);
391
- }
392
- if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) try {
393
- wasiBinding = require("@oxlint/binding-wasm32-wasi"), nativeBinding = wasiBinding;
394
- } catch (err) {
395
- process.env.NAPI_RS_FORCE_WASI && (wasiBindingError ? wasiBindingError.cause = err : wasiBindingError = err, loadErrors.push(err));
396
- }
397
- if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
398
- let error = /* @__PURE__ */ Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
399
- throw error.cause = wasiBindingError, error;
400
- }
401
- }
402
- if (!nativeBinding) throw loadErrors.length > 0 ? 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.", { cause: loadErrors.reduce((err, cur) => (cur.cause = err, cur)) }) : Error("Failed to load native binding");
403
- const { Severity, applyFixes, getBufferOffset, lint, parseRawSync, rawTransferSupported } = nativeBinding;
404
- //#endregion
405
- export { rawTransferSupported as a, parseRawSync as i, getBufferOffset as n, lint as r, applyFixes as t };
package/dist/cli.js DELETED
@@ -1,84 +0,0 @@
1
- import { r as lint } from "./bindings.js";
2
- //#region src-js/cli.ts
3
- let loadPlugin = null, setupRuleConfigs = null, lintFile = null, createWorkspace = null, destroyWorkspace = null, resolvedConfigLoader = null;
4
- /**
5
- * Load a plugin.
6
- *
7
- * Lazy-loads plugins code on first call, so that overhead is skipped if user doesn't use JS plugins.
8
- *
9
- * @param path - Absolute path of plugin file
10
- * @param pluginName - Plugin name (either alias or package name)
11
- * @param pluginNameIsAlias - `true` if plugin name is an alias (takes priority over name that plugin defines itself)
12
- * @param workspaceUri - Workspace URI (`null` in CLI mode, `string` in LSP mode)
13
- * @returns Plugin details or error serialized to JSON string
14
- */
15
- function loadPluginWrapper(path, pluginName, pluginNameIsAlias, workspaceUri) {
16
- return loadPlugin === null ? import("./plugins.js").then((mod) => ({loadPlugin, lintFile, setupRuleConfigs} = mod, loadPlugin(path, pluginName, pluginNameIsAlias, workspaceUri))) : loadPlugin(path, pluginName, pluginNameIsAlias, workspaceUri);
17
- }
18
- /**
19
- * Bootstrap configuration options.
20
- *
21
- * Delegates to `setupRuleConfigs`, which was lazy-loaded by `loadPluginWrapper`.
22
- *
23
- * @param optionsJSON - Array of all rule options across all configurations, serialized as JSON
24
- * @returns `null` if success, or error message string
25
- */
26
- function setupRuleConfigsWrapper(optionsJSON) {
27
- return setupRuleConfigs(optionsJSON);
28
- }
29
- /**
30
- * Lint a file.
31
- *
32
- * Delegates to `lintFile`, which was lazy-loaded by `loadPluginWrapper`.
33
- *
34
- * @param filePath - Absolute path of file being linted
35
- * @param bufferId - ID of buffer containing file data
36
- * @param buffer - Buffer containing file data, or `null` if buffer with this ID was previously sent to JS
37
- * @param ruleIds - IDs of rules to run on this file
38
- * @param optionsIds - IDs of options to use for rules on this file, in same order as `ruleIds`
39
- * @param settingsJSON - Settings for file, as JSON
40
- * @param globalsJSON - Globals for file, as JSON
41
- * @param workspaceUri - Workspace URI (`null` in CLI mode, `string` in LSP mode)
42
- * @returns Diagnostics or error serialized to JSON string
43
- */
44
- function lintFileWrapper(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJSON, globalsJSON, workspaceUri) {
45
- return lintFile(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJSON, globalsJSON, workspaceUri);
46
- }
47
- /**
48
- * Create a new workspace.
49
- *
50
- * Lazy-loads workspace code on first call, so that overhead is skipped if user doesn't use JS plugins.
51
- *
52
- * @param workspace - Workspace URI
53
- * @returns Promise which resolves when workspace is created
54
- */
55
- function createWorkspaceWrapper(workspace) {
56
- return createWorkspace === null ? import("./workspace.js").then((mod) => ({createWorkspace, destroyWorkspace} = mod, createWorkspace(workspace))) : Promise.resolve(createWorkspace(workspace));
57
- }
58
- /**
59
- * Destroy a workspace.
60
- *
61
- * Delegates to `destroyWorkspace`, which was lazy-loaded by `createWorkspaceWrapper`.
62
- *
63
- * @param workspace - Workspace URI
64
- * @returns `undefined`
65
- */
66
- function destroyWorkspaceWrapper(workspace) {
67
- destroyWorkspace(workspace);
68
- }
69
- /**
70
- * Load JavaScript/TypeScript config files (experimental).
71
- *
72
- * Lazy-loads the js_config module on first call.
73
- * Uses native Node.js TypeScript support to import config files.
74
- *
75
- * @param paths - Array of absolute paths to JavaScript/TypeScript config files
76
- * @returns JSON-stringified result with all configs or error
77
- */
78
- function loadJsConfigsWrapper(paths) {
79
- return resolvedConfigLoader === null ? import("./js_config.js").then(({ loadJsConfigs, loadVitePlusConfigs }) => (resolvedConfigLoader = process.env.VP_VERSION ? loadVitePlusConfigs : loadJsConfigs, resolvedConfigLoader(paths))) : resolvedConfigLoader(paths);
80
- }
81
- const args = process.argv.slice(2);
82
- process.stdout.isTTY || (process.stdin._handle?.setBlocking?.(!0), process.stdout._handle?.setBlocking?.(!0)), args.includes("--lsp") && (process.stdout.write = process.stderr.write.bind(process.stderr)), await lint(args, loadPluginWrapper, setupRuleConfigsWrapper, lintFileWrapper, createWorkspaceWrapper, destroyWorkspaceWrapper, loadJsConfigsWrapper) || (process.exitCode = 1);
83
- //#endregion
84
- export {};
package/dist/globals.js DELETED
@@ -1,13 +0,0 @@
1
- //#region src-js/utils/globals.ts
2
- /**
3
- * Properties of global objects exported as variables.
4
- *
5
- * TSDown will replace e.g. `Object.keys` with import of `ObjectKeys` from this file.
6
- *
7
- * If you use any globals in code in `src-js` directory, you should add them to this file.
8
- *
9
- * See TSDown config file for more details.
10
- */
11
- const { prototype: ObjectPrototype, hasOwn: ObjectHasOwn, keys: ObjectKeys, values: ObjectValues, freeze: ObjectFreeze, preventExtensions: ObjectPreventExtensions, defineProperty: ObjectDefineProperty, defineProperties: ObjectDefineProperties, create: ObjectCreate, assign: ObjectAssign, getPrototypeOf: ObjectGetPrototypeOf, setPrototypeOf: ObjectSetPrototypeOf, entries: ObjectEntries } = Object, { prototype: ArrayPrototype, isArray: ArrayIsArray, from: ArrayFrom } = Array, { min: MathMin, max: MathMax, floor: MathFloor } = Math, { parse: JSONParse, stringify: JSONStringify } = JSON, { ownKeys: ReflectOwnKeys } = Reflect, { iterator: SymbolIterator } = Symbol, { fromCodePoint: StringFromCodePoint } = String, { now: DateNow } = Date;
12
- //#endregion
13
- export { ObjectValues as _, JSONStringify as a, ObjectAssign as c, ObjectEntries as d, ObjectFreeze as f, ObjectPrototype as g, ObjectPreventExtensions as h, JSONParse as i, ObjectCreate as l, ObjectKeys as m, ArrayIsArray as n, MathMax as o, ObjectHasOwn as p, DateNow as r, MathMin as s, ArrayFrom as t, ObjectDefineProperty as u, StringFromCodePoint as v, SymbolIterator as y };