oxlint 1.42.0 → 1.45.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 +9 -7
- package/dist/bindings.js +55 -55
- package/dist/cli.js +16 -7
- package/dist/config.js +8 -0
- package/dist/index.d.ts +504 -4062
- package/dist/index.js +2 -553
- package/dist/js_config.js +55 -0
- package/dist/lint.js +624 -576
- package/dist/plugins-dev.d.ts +4185 -0
- package/dist/plugins-dev.js +513 -0
- package/dist/plugins.js +2 -1
- package/dist/typescript.cjs +3 -3
- package/dist/utils.js +13 -0
- package/dist/workspace.js +2 -0
- package/dist/workspace2.js +14 -0
- package/package.json +59 -13
- package/dist/chunk.js +0 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "Oxlintrc",
|
|
4
|
-
"description": "Oxlint Configuration File\n\nThis configuration is aligned with ESLint v8's configuration schema (`eslintrc.json`).\n\nUsage: `oxlint -c oxlintrc.json --import-plugin`\n\n::: danger NOTE\n\nOnly the `.json` format is supported. You can use comments in configuration files.\n\n:::\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},\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```",
|
|
4
|
+
"description": "Oxlint Configuration File\n\nThis configuration is aligned with ESLint v8's configuration schema (`eslintrc.json`).\n\nUsage: `oxlint -c oxlintrc.json --import-plugin`\n\n::: danger NOTE\n\nOnly the `.json` format is supported. You can use comments in configuration files.\n\n:::\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```",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"$schema": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"markdownDescription": "Globs to ignore during linting. These are resolved from the configuration file path."
|
|
61
61
|
},
|
|
62
62
|
"jsPlugins": {
|
|
63
|
-
"description": "JS plugins, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\
|
|
63
|
+
"description": "JS plugins, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\n\nExamples:\n\nBasic usage with a local plugin path.\n\n```json\n{\n\"jsPlugins\": [\"./custom-plugin.js\"],\n\"rules\": {\n\"custom/rule-name\": \"warn\"\n}\n}\n```\n\nUsing a built-in Rust plugin alongside a JS plugin with the same name\nby giving the JS plugin an alias.\n\n```json\n{\n\"plugins\": [\"import\"],\n\"jsPlugins\": [\n{ \"name\": \"import-js\", \"specifier\": \"eslint-plugin-import\" }\n],\n\"rules\": {\n\"import/no-cycle\": \"error\",\n\"import-js/no-unresolved\": \"warn\"\n}\n}\n```",
|
|
64
64
|
"anyOf": [
|
|
65
65
|
{
|
|
66
66
|
"type": "null"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"uniqueItems": true
|
|
74
74
|
}
|
|
75
75
|
],
|
|
76
|
-
"markdownDescription": "JS plugins, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\
|
|
76
|
+
"markdownDescription": "JS plugins, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.\n\nExamples:\n\nBasic usage with a local plugin path.\n\n```json\n{\n\"jsPlugins\": [\"./custom-plugin.js\"],\n\"rules\": {\n\"custom/rule-name\": \"warn\"\n}\n}\n```\n\nUsing a built-in Rust plugin alongside a JS plugin with the same name\nby giving the JS plugin an alias.\n\n```json\n{\n\"plugins\": [\"import\"],\n\"jsPlugins\": [\n{ \"name\": \"import-js\", \"specifier\": \"eslint-plugin-import\" }\n],\n\"rules\": {\n\"import/no-cycle\": \"error\",\n\"import-js/no-unresolved\": \"warn\"\n}\n}\n```"
|
|
77
77
|
},
|
|
78
78
|
"overrides": {
|
|
79
79
|
"description": "Add, remove, or otherwise reconfigure rules for specific files or groups of files.",
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
"markdownDescription": "Example\n\n`.oxlintrc.json`\n\n```json\n{\n\"$schema\": \"./node_modules/oxlint/configuration_schema.json\",\n\"rules\": {\n\"eqeqeq\": \"warn\",\n\"import/no-cycle\": \"error\",\n\"prefer-const\": [\"error\", { \"ignoreReadBeforeAssign\": true }]\n}\n}\n```\n\nSee [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html) for the list of\nrules."
|
|
109
109
|
},
|
|
110
110
|
"settings": {
|
|
111
|
+
"description": "Plugin-specific configuration for both built-in and custom plugins.\nThis includes settings for built-in plugins such as `react` and `jsdoc`\nas well as configuring settings for JS custom plugins loaded via `jsPlugins`.",
|
|
111
112
|
"default": {
|
|
112
113
|
"jsx-a11y": {
|
|
113
114
|
"polymorphicPropName": null,
|
|
@@ -141,7 +142,8 @@
|
|
|
141
142
|
{
|
|
142
143
|
"$ref": "#/definitions/OxlintSettings"
|
|
143
144
|
}
|
|
144
|
-
]
|
|
145
|
+
],
|
|
146
|
+
"markdownDescription": "Plugin-specific configuration for both built-in and custom plugins.\nThis includes settings for built-in plugins such as `react` and `jsdoc`\nas well as configuring settings for JS custom plugins loaded via `jsPlugins`."
|
|
145
147
|
}
|
|
146
148
|
},
|
|
147
149
|
"additionalProperties": false,
|
|
@@ -519,7 +521,7 @@
|
|
|
519
521
|
"markdownDescription": "Enabled or disabled specific global variables."
|
|
520
522
|
},
|
|
521
523
|
"jsPlugins": {
|
|
522
|
-
"description": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver
|
|
524
|
+
"description": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver.",
|
|
523
525
|
"anyOf": [
|
|
524
526
|
{
|
|
525
527
|
"type": "null"
|
|
@@ -532,7 +534,7 @@
|
|
|
532
534
|
"uniqueItems": true
|
|
533
535
|
}
|
|
534
536
|
],
|
|
535
|
-
"markdownDescription": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver
|
|
537
|
+
"markdownDescription": "JS plugins for this override, allows usage of ESLint plugins with Oxlint.\n\nRead more about JS plugins in\n[the docs](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).\n\nNote: JS plugins are experimental and not subject to semver."
|
|
536
538
|
},
|
|
537
539
|
"plugins": {
|
|
538
540
|
"description": "Optionally change what plugins are enabled for this override. When\nomitted, the base config's plugins are used.",
|
|
@@ -731,5 +733,5 @@
|
|
|
731
733
|
"markdownDescription": "Configure Vitest plugin rules.\n\nSee [eslint-plugin-vitest](https://github.com/vitest-dev/eslint-plugin-vitest)'s\nconfiguration for a full reference."
|
|
732
734
|
}
|
|
733
735
|
},
|
|
734
|
-
"markdownDescription": "Oxlint Configuration File\n\nThis configuration is aligned with ESLint v8's configuration schema (`eslintrc.json`).\n\nUsage: `oxlint -c oxlintrc.json --import-plugin`\n\n::: danger NOTE\n\nOnly the `.json` format is supported. You can use comments in configuration files.\n\n:::\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},\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```"
|
|
736
|
+
"markdownDescription": "Oxlint Configuration File\n\nThis configuration is aligned with ESLint v8's configuration schema (`eslintrc.json`).\n\nUsage: `oxlint -c oxlintrc.json --import-plugin`\n\n::: danger NOTE\n\nOnly the `.json` format is supported. You can use comments in configuration files.\n\n:::\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```"
|
|
735
737
|
}
|
package/dist/bindings.js
CHANGED
|
@@ -35,8 +35,8 @@ function requireNative() {
|
|
|
35
35
|
loadErrors.push(e);
|
|
36
36
|
}
|
|
37
37
|
try {
|
|
38
|
-
let binding = require("@oxlint/android-arm64"), bindingPackageVersion = require("@oxlint/android-arm64/package.json").version;
|
|
39
|
-
if (bindingPackageVersion !== "1.
|
|
38
|
+
let binding = require("@oxlint/binding-android-arm64"), bindingPackageVersion = require("@oxlint/binding-android-arm64/package.json").version;
|
|
39
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
40
40
|
return binding;
|
|
41
41
|
} catch (e) {
|
|
42
42
|
loadErrors.push(e);
|
|
@@ -48,8 +48,8 @@ function requireNative() {
|
|
|
48
48
|
loadErrors.push(e);
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
|
-
let binding = require("@oxlint/android-arm-eabi"), bindingPackageVersion = require("@oxlint/android-arm-eabi/package.json").version;
|
|
52
|
-
if (bindingPackageVersion !== "1.
|
|
51
|
+
let binding = require("@oxlint/binding-android-arm-eabi"), bindingPackageVersion = require("@oxlint/binding-android-arm-eabi/package.json").version;
|
|
52
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
53
53
|
return binding;
|
|
54
54
|
} catch (e) {
|
|
55
55
|
loadErrors.push(e);
|
|
@@ -62,8 +62,8 @@ function requireNative() {
|
|
|
62
62
|
loadErrors.push(e);
|
|
63
63
|
}
|
|
64
64
|
try {
|
|
65
|
-
let binding = require("@oxlint/win32-x64-gnu"), bindingPackageVersion = require("@oxlint/win32-x64-gnu/package.json").version;
|
|
66
|
-
if (bindingPackageVersion !== "1.
|
|
65
|
+
let binding = require("@oxlint/binding-win32-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-win32-x64-gnu/package.json").version;
|
|
66
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
67
67
|
return binding;
|
|
68
68
|
} catch (e) {
|
|
69
69
|
loadErrors.push(e);
|
|
@@ -75,8 +75,8 @@ function requireNative() {
|
|
|
75
75
|
loadErrors.push(e);
|
|
76
76
|
}
|
|
77
77
|
try {
|
|
78
|
-
let binding = require("@oxlint/win32-x64"), bindingPackageVersion = require("@oxlint/win32-x64/package.json").version;
|
|
79
|
-
if (bindingPackageVersion !== "1.
|
|
78
|
+
let binding = require("@oxlint/binding-win32-x64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-x64-msvc/package.json").version;
|
|
79
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
80
80
|
return binding;
|
|
81
81
|
} catch (e) {
|
|
82
82
|
loadErrors.push(e);
|
|
@@ -89,8 +89,8 @@ function requireNative() {
|
|
|
89
89
|
loadErrors.push(e);
|
|
90
90
|
}
|
|
91
91
|
try {
|
|
92
|
-
let binding = require("@oxlint/win32-ia32"), bindingPackageVersion = require("@oxlint/win32-ia32/package.json").version;
|
|
93
|
-
if (bindingPackageVersion !== "1.
|
|
92
|
+
let binding = require("@oxlint/binding-win32-ia32-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-ia32-msvc/package.json").version;
|
|
93
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
94
94
|
return binding;
|
|
95
95
|
} catch (e) {
|
|
96
96
|
loadErrors.push(e);
|
|
@@ -102,8 +102,8 @@ function requireNative() {
|
|
|
102
102
|
loadErrors.push(e);
|
|
103
103
|
}
|
|
104
104
|
try {
|
|
105
|
-
let binding = require("@oxlint/win32-arm64"), bindingPackageVersion = require("@oxlint/win32-arm64/package.json").version;
|
|
106
|
-
if (bindingPackageVersion !== "1.
|
|
105
|
+
let binding = require("@oxlint/binding-win32-arm64-msvc"), bindingPackageVersion = require("@oxlint/binding-win32-arm64-msvc/package.json").version;
|
|
106
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
107
107
|
return binding;
|
|
108
108
|
} catch (e) {
|
|
109
109
|
loadErrors.push(e);
|
|
@@ -116,8 +116,8 @@ function requireNative() {
|
|
|
116
116
|
loadErrors.push(e);
|
|
117
117
|
}
|
|
118
118
|
try {
|
|
119
|
-
let binding = require("@oxlint/darwin-universal"), bindingPackageVersion = require("@oxlint/darwin-universal/package.json").version;
|
|
120
|
-
if (bindingPackageVersion !== "1.
|
|
119
|
+
let binding = require("@oxlint/binding-darwin-universal"), bindingPackageVersion = require("@oxlint/binding-darwin-universal/package.json").version;
|
|
120
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
121
121
|
return binding;
|
|
122
122
|
} catch (e) {
|
|
123
123
|
loadErrors.push(e);
|
|
@@ -129,8 +129,8 @@ function requireNative() {
|
|
|
129
129
|
loadErrors.push(e);
|
|
130
130
|
}
|
|
131
131
|
try {
|
|
132
|
-
let binding = require("@oxlint/darwin-x64"), bindingPackageVersion = require("@oxlint/darwin-x64/package.json").version;
|
|
133
|
-
if (bindingPackageVersion !== "1.
|
|
132
|
+
let binding = require("@oxlint/binding-darwin-x64"), bindingPackageVersion = require("@oxlint/binding-darwin-x64/package.json").version;
|
|
133
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
134
134
|
return binding;
|
|
135
135
|
} catch (e) {
|
|
136
136
|
loadErrors.push(e);
|
|
@@ -142,8 +142,8 @@ function requireNative() {
|
|
|
142
142
|
loadErrors.push(e);
|
|
143
143
|
}
|
|
144
144
|
try {
|
|
145
|
-
let binding = require("@oxlint/darwin-arm64"), bindingPackageVersion = require("@oxlint/darwin-arm64/package.json").version;
|
|
146
|
-
if (bindingPackageVersion !== "1.
|
|
145
|
+
let binding = require("@oxlint/binding-darwin-arm64"), bindingPackageVersion = require("@oxlint/binding-darwin-arm64/package.json").version;
|
|
146
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
147
147
|
return binding;
|
|
148
148
|
} catch (e) {
|
|
149
149
|
loadErrors.push(e);
|
|
@@ -156,8 +156,8 @@ function requireNative() {
|
|
|
156
156
|
loadErrors.push(e);
|
|
157
157
|
}
|
|
158
158
|
try {
|
|
159
|
-
let binding = require("@oxlint/freebsd-x64"), bindingPackageVersion = require("@oxlint/freebsd-x64/package.json").version;
|
|
160
|
-
if (bindingPackageVersion !== "1.
|
|
159
|
+
let binding = require("@oxlint/binding-freebsd-x64"), bindingPackageVersion = require("@oxlint/binding-freebsd-x64/package.json").version;
|
|
160
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
161
161
|
return binding;
|
|
162
162
|
} catch (e) {
|
|
163
163
|
loadErrors.push(e);
|
|
@@ -169,8 +169,8 @@ function requireNative() {
|
|
|
169
169
|
loadErrors.push(e);
|
|
170
170
|
}
|
|
171
171
|
try {
|
|
172
|
-
let binding = require("@oxlint/freebsd-arm64"), bindingPackageVersion = require("@oxlint/freebsd-arm64/package.json").version;
|
|
173
|
-
if (bindingPackageVersion !== "1.
|
|
172
|
+
let binding = require("@oxlint/binding-freebsd-arm64"), bindingPackageVersion = require("@oxlint/binding-freebsd-arm64/package.json").version;
|
|
173
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
174
174
|
return binding;
|
|
175
175
|
} catch (e) {
|
|
176
176
|
loadErrors.push(e);
|
|
@@ -183,8 +183,8 @@ function requireNative() {
|
|
|
183
183
|
loadErrors.push(e);
|
|
184
184
|
}
|
|
185
185
|
try {
|
|
186
|
-
let binding = require("@oxlint/linux-x64-musl"), bindingPackageVersion = require("@oxlint/linux-x64-musl/package.json").version;
|
|
187
|
-
if (bindingPackageVersion !== "1.
|
|
186
|
+
let binding = require("@oxlint/binding-linux-x64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-x64-musl/package.json").version;
|
|
187
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
188
188
|
return binding;
|
|
189
189
|
} catch (e) {
|
|
190
190
|
loadErrors.push(e);
|
|
@@ -196,8 +196,8 @@ function requireNative() {
|
|
|
196
196
|
loadErrors.push(e);
|
|
197
197
|
}
|
|
198
198
|
try {
|
|
199
|
-
let binding = require("@oxlint/linux-x64-gnu"), bindingPackageVersion = require("@oxlint/linux-x64-gnu/package.json").version;
|
|
200
|
-
if (bindingPackageVersion !== "1.
|
|
199
|
+
let binding = require("@oxlint/binding-linux-x64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-x64-gnu/package.json").version;
|
|
200
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
201
201
|
return binding;
|
|
202
202
|
} catch (e) {
|
|
203
203
|
loadErrors.push(e);
|
|
@@ -210,8 +210,8 @@ function requireNative() {
|
|
|
210
210
|
loadErrors.push(e);
|
|
211
211
|
}
|
|
212
212
|
try {
|
|
213
|
-
let binding = require("@oxlint/linux-arm64-musl"), bindingPackageVersion = require("@oxlint/linux-arm64-musl/package.json").version;
|
|
214
|
-
if (bindingPackageVersion !== "1.
|
|
213
|
+
let binding = require("@oxlint/binding-linux-arm64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-musl/package.json").version;
|
|
214
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
215
215
|
return binding;
|
|
216
216
|
} catch (e) {
|
|
217
217
|
loadErrors.push(e);
|
|
@@ -223,8 +223,8 @@ function requireNative() {
|
|
|
223
223
|
loadErrors.push(e);
|
|
224
224
|
}
|
|
225
225
|
try {
|
|
226
|
-
let binding = require("@oxlint/linux-arm64-gnu"), bindingPackageVersion = require("@oxlint/linux-arm64-gnu/package.json").version;
|
|
227
|
-
if (bindingPackageVersion !== "1.
|
|
226
|
+
let binding = require("@oxlint/binding-linux-arm64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-arm64-gnu/package.json").version;
|
|
227
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
228
228
|
return binding;
|
|
229
229
|
} catch (e) {
|
|
230
230
|
loadErrors.push(e);
|
|
@@ -237,8 +237,8 @@ function requireNative() {
|
|
|
237
237
|
loadErrors.push(e);
|
|
238
238
|
}
|
|
239
239
|
try {
|
|
240
|
-
let binding = require("@oxlint/linux-arm-musleabihf"), bindingPackageVersion = require("@oxlint/linux-arm-musleabihf/package.json").version;
|
|
241
|
-
if (bindingPackageVersion !== "1.
|
|
240
|
+
let binding = require("@oxlint/binding-linux-arm-musleabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-musleabihf/package.json").version;
|
|
241
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
242
242
|
return binding;
|
|
243
243
|
} catch (e) {
|
|
244
244
|
loadErrors.push(e);
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
loadErrors.push(e);
|
|
251
251
|
}
|
|
252
252
|
try {
|
|
253
|
-
let binding = require("@oxlint/linux-arm-gnueabihf"), bindingPackageVersion = require("@oxlint/linux-arm-gnueabihf/package.json").version;
|
|
254
|
-
if (bindingPackageVersion !== "1.
|
|
253
|
+
let binding = require("@oxlint/binding-linux-arm-gnueabihf"), bindingPackageVersion = require("@oxlint/binding-linux-arm-gnueabihf/package.json").version;
|
|
254
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
255
255
|
return binding;
|
|
256
256
|
} catch (e) {
|
|
257
257
|
loadErrors.push(e);
|
|
@@ -264,8 +264,8 @@ function requireNative() {
|
|
|
264
264
|
loadErrors.push(e);
|
|
265
265
|
}
|
|
266
266
|
try {
|
|
267
|
-
let binding = require("@oxlint/linux-loong64-musl"), bindingPackageVersion = require("@oxlint/linux-loong64-musl/package.json").version;
|
|
268
|
-
if (bindingPackageVersion !== "1.
|
|
267
|
+
let binding = require("@oxlint/binding-linux-loong64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-musl/package.json").version;
|
|
268
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
269
269
|
return binding;
|
|
270
270
|
} catch (e) {
|
|
271
271
|
loadErrors.push(e);
|
|
@@ -277,8 +277,8 @@ function requireNative() {
|
|
|
277
277
|
loadErrors.push(e);
|
|
278
278
|
}
|
|
279
279
|
try {
|
|
280
|
-
let binding = require("@oxlint/linux-loong64-gnu"), bindingPackageVersion = require("@oxlint/linux-loong64-gnu/package.json").version;
|
|
281
|
-
if (bindingPackageVersion !== "1.
|
|
280
|
+
let binding = require("@oxlint/binding-linux-loong64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-loong64-gnu/package.json").version;
|
|
281
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
282
282
|
return binding;
|
|
283
283
|
} catch (e) {
|
|
284
284
|
loadErrors.push(e);
|
|
@@ -291,8 +291,8 @@ function requireNative() {
|
|
|
291
291
|
loadErrors.push(e);
|
|
292
292
|
}
|
|
293
293
|
try {
|
|
294
|
-
let binding = require("@oxlint/linux-riscv64-musl"), bindingPackageVersion = require("@oxlint/linux-riscv64-musl/package.json").version;
|
|
295
|
-
if (bindingPackageVersion !== "1.
|
|
294
|
+
let binding = require("@oxlint/binding-linux-riscv64-musl"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-musl/package.json").version;
|
|
295
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
296
296
|
return binding;
|
|
297
297
|
} catch (e) {
|
|
298
298
|
loadErrors.push(e);
|
|
@@ -304,8 +304,8 @@ function requireNative() {
|
|
|
304
304
|
loadErrors.push(e);
|
|
305
305
|
}
|
|
306
306
|
try {
|
|
307
|
-
let binding = require("@oxlint/linux-riscv64-gnu"), bindingPackageVersion = require("@oxlint/linux-riscv64-gnu/package.json").version;
|
|
308
|
-
if (bindingPackageVersion !== "1.
|
|
307
|
+
let binding = require("@oxlint/binding-linux-riscv64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-riscv64-gnu/package.json").version;
|
|
308
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
309
309
|
return binding;
|
|
310
310
|
} catch (e) {
|
|
311
311
|
loadErrors.push(e);
|
|
@@ -318,8 +318,8 @@ function requireNative() {
|
|
|
318
318
|
loadErrors.push(e);
|
|
319
319
|
}
|
|
320
320
|
try {
|
|
321
|
-
let binding = require("@oxlint/linux-ppc64-gnu"), bindingPackageVersion = require("@oxlint/linux-ppc64-gnu/package.json").version;
|
|
322
|
-
if (bindingPackageVersion !== "1.
|
|
321
|
+
let binding = require("@oxlint/binding-linux-ppc64-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-ppc64-gnu/package.json").version;
|
|
322
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
323
323
|
return binding;
|
|
324
324
|
} catch (e) {
|
|
325
325
|
loadErrors.push(e);
|
|
@@ -331,8 +331,8 @@ function requireNative() {
|
|
|
331
331
|
loadErrors.push(e);
|
|
332
332
|
}
|
|
333
333
|
try {
|
|
334
|
-
let binding = require("@oxlint/linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/linux-s390x-gnu/package.json").version;
|
|
335
|
-
if (bindingPackageVersion !== "1.
|
|
334
|
+
let binding = require("@oxlint/binding-linux-s390x-gnu"), bindingPackageVersion = require("@oxlint/binding-linux-s390x-gnu/package.json").version;
|
|
335
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
336
336
|
return binding;
|
|
337
337
|
} catch (e) {
|
|
338
338
|
loadErrors.push(e);
|
|
@@ -345,8 +345,8 @@ function requireNative() {
|
|
|
345
345
|
loadErrors.push(e);
|
|
346
346
|
}
|
|
347
347
|
try {
|
|
348
|
-
let binding = require("@oxlint/openharmony-arm64"), bindingPackageVersion = require("@oxlint/openharmony-arm64/package.json").version;
|
|
349
|
-
if (bindingPackageVersion !== "1.
|
|
348
|
+
let binding = require("@oxlint/binding-openharmony-arm64"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm64/package.json").version;
|
|
349
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
350
350
|
return binding;
|
|
351
351
|
} catch (e) {
|
|
352
352
|
loadErrors.push(e);
|
|
@@ -358,8 +358,8 @@ function requireNative() {
|
|
|
358
358
|
loadErrors.push(e);
|
|
359
359
|
}
|
|
360
360
|
try {
|
|
361
|
-
let binding = require("@oxlint/openharmony-x64"), bindingPackageVersion = require("@oxlint/openharmony-x64/package.json").version;
|
|
362
|
-
if (bindingPackageVersion !== "1.
|
|
361
|
+
let binding = require("@oxlint/binding-openharmony-x64"), bindingPackageVersion = require("@oxlint/binding-openharmony-x64/package.json").version;
|
|
362
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
363
363
|
return binding;
|
|
364
364
|
} catch (e) {
|
|
365
365
|
loadErrors.push(e);
|
|
@@ -371,8 +371,8 @@ function requireNative() {
|
|
|
371
371
|
loadErrors.push(e);
|
|
372
372
|
}
|
|
373
373
|
try {
|
|
374
|
-
let binding = require("@oxlint/openharmony-arm"), bindingPackageVersion = require("@oxlint/openharmony-arm/package.json").version;
|
|
375
|
-
if (bindingPackageVersion !== "1.
|
|
374
|
+
let binding = require("@oxlint/binding-openharmony-arm"), bindingPackageVersion = require("@oxlint/binding-openharmony-arm/package.json").version;
|
|
375
|
+
if (bindingPackageVersion !== "1.44.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.44.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
376
376
|
return binding;
|
|
377
377
|
} catch (e) {
|
|
378
378
|
loadErrors.push(e);
|
|
@@ -388,7 +388,7 @@ if (nativeBinding = requireNative(), !nativeBinding || process.env.NAPI_RS_FORCE
|
|
|
388
388
|
process.env.NAPI_RS_FORCE_WASI && (wasiBindingError = err);
|
|
389
389
|
}
|
|
390
390
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) try {
|
|
391
|
-
wasiBinding = require("@oxlint/wasm32-wasi"), nativeBinding = wasiBinding;
|
|
391
|
+
wasiBinding = require("@oxlint/binding-wasm32-wasi"), nativeBinding = wasiBinding;
|
|
392
392
|
} catch (err) {
|
|
393
393
|
process.env.NAPI_RS_FORCE_WASI && (wasiBindingError ? wasiBindingError.cause = err : wasiBindingError = err, loadErrors.push(err));
|
|
394
394
|
}
|
|
@@ -398,5 +398,5 @@ if (nativeBinding = requireNative(), !nativeBinding || process.env.NAPI_RS_FORCE
|
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
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");
|
|
401
|
-
const { Severity, getBufferOffset, lint, parseRawSync, rawTransferSupported } = nativeBinding;
|
|
402
|
-
export { rawTransferSupported as i,
|
|
401
|
+
const { Severity, applyFixes, getBufferOffset, lint, parseRawSync, rawTransferSupported } = nativeBinding;
|
|
402
|
+
export { rawTransferSupported as a, parseRawSync as i, getBufferOffset as n, lint as r, applyFixes as t };
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
let loadPlugin = null, setupRuleConfigs = null, lintFile = null;
|
|
3
|
-
function loadPluginWrapper(path, pluginName, pluginNameIsAlias) {
|
|
4
|
-
return loadPlugin === null ? import("./plugins.js").then((mod) => ({loadPlugin, lintFile, setupRuleConfigs} = mod, loadPlugin(path, pluginName, pluginNameIsAlias))) : loadPlugin(path, pluginName, pluginNameIsAlias);
|
|
1
|
+
import { r as lint } from "./bindings.js";
|
|
2
|
+
let loadPlugin = null, setupRuleConfigs = null, lintFile = null, createWorkspace = null, destroyWorkspace = null, loadJsConfigs = null;
|
|
3
|
+
function loadPluginWrapper(path, pluginName, pluginNameIsAlias, workspaceUri) {
|
|
4
|
+
return loadPlugin === null ? import("./plugins.js").then((mod) => ({loadPlugin, lintFile, setupRuleConfigs} = mod, loadPlugin(path, pluginName, pluginNameIsAlias, workspaceUri))) : loadPlugin(path, pluginName, pluginNameIsAlias, workspaceUri);
|
|
5
5
|
}
|
|
6
6
|
function setupRuleConfigsWrapper(optionsJSON) {
|
|
7
7
|
return setupRuleConfigs(optionsJSON);
|
|
8
8
|
}
|
|
9
|
-
function lintFileWrapper(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJSON, globalsJSON) {
|
|
10
|
-
return lintFile(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJSON, globalsJSON);
|
|
9
|
+
function lintFileWrapper(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJSON, globalsJSON, workspaceUri) {
|
|
10
|
+
return lintFile(filePath, bufferId, buffer, ruleIds, optionsIds, settingsJSON, globalsJSON, workspaceUri);
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
function createWorkspaceWrapper(workspace) {
|
|
13
|
+
return createWorkspace === null ? import("./workspace.js").then((mod) => ({createWorkspace, destroyWorkspace} = mod, createWorkspace(workspace))) : Promise.resolve(createWorkspace(workspace));
|
|
14
|
+
}
|
|
15
|
+
function destroyWorkspaceWrapper(workspace) {
|
|
16
|
+
destroyWorkspace(workspace);
|
|
17
|
+
}
|
|
18
|
+
function loadJsConfigsWrapper(paths) {
|
|
19
|
+
return loadJsConfigs === null ? import("./js_config.js").then((mod) => (loadJsConfigs = mod.loadJsConfigs, loadJsConfigs(paths))) : loadJsConfigs(paths);
|
|
20
|
+
}
|
|
21
|
+
await lint(process.argv.slice(2), loadPluginWrapper, setupRuleConfigsWrapper, lintFileWrapper, createWorkspaceWrapper, destroyWorkspaceWrapper, loadJsConfigsWrapper) || (process.exitCode = 1);
|
|
13
22
|
export {};
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const DEFINE_CONFIG_REGISTRY = /* @__PURE__ */ new WeakSet();
|
|
2
|
+
function defineConfig(config) {
|
|
3
|
+
return DEFINE_CONFIG_REGISTRY.add(config), config;
|
|
4
|
+
}
|
|
5
|
+
function isDefineConfig(config) {
|
|
6
|
+
return typeof config == "object" && !!config && DEFINE_CONFIG_REGISTRY.has(config);
|
|
7
|
+
}
|
|
8
|
+
export { isDefineConfig as n, defineConfig as t };
|