@zhangyu1818/oxlint-config 1.0.0 → 2.0.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/dist/index.js +23 -20
- package/package.json +13 -12
package/dist/index.js
CHANGED
|
@@ -236,6 +236,25 @@ var nodeRules = {
|
|
|
236
236
|
"node/no-path-concat": "error"
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
+
// src/oxlint/presets/react-agent-rules.ts
|
|
240
|
+
import { existsSync } from "fs";
|
|
241
|
+
import { fileURLToPath } from "url";
|
|
242
|
+
function resolveReactAgentRulesPluginPath() {
|
|
243
|
+
const sourcePluginPath = fileURLToPath(
|
|
244
|
+
new URL("../../react-agent-rules.ts", import.meta.url)
|
|
245
|
+
);
|
|
246
|
+
if (existsSync(sourcePluginPath)) {
|
|
247
|
+
return sourcePluginPath;
|
|
248
|
+
}
|
|
249
|
+
return fileURLToPath(new URL("./react-agent-rules.js", import.meta.url));
|
|
250
|
+
}
|
|
251
|
+
var reactAgentRulesPlugin = resolveReactAgentRulesPluginPath();
|
|
252
|
+
var reactAgentRules = {
|
|
253
|
+
"react-agent-rules/effect-empty-deps-only": "error",
|
|
254
|
+
"react-agent-rules/no-forward-ref": "error",
|
|
255
|
+
"react-agent-rules/no-manual-memoization": "error"
|
|
256
|
+
};
|
|
257
|
+
|
|
239
258
|
// src/oxlint/presets/react.ts
|
|
240
259
|
import { isPackageExists } from "local-pkg";
|
|
241
260
|
var jsxA11yRules = {
|
|
@@ -356,25 +375,6 @@ function createReactRules(options, nextEnabled) {
|
|
|
356
375
|
};
|
|
357
376
|
}
|
|
358
377
|
|
|
359
|
-
// src/oxlint/presets/react-agent-rules.ts
|
|
360
|
-
import { existsSync } from "fs";
|
|
361
|
-
import { fileURLToPath } from "url";
|
|
362
|
-
function resolveReactAgentRulesPluginPath() {
|
|
363
|
-
const sourcePluginPath = fileURLToPath(
|
|
364
|
-
new URL("../../react-agent-rules.ts", import.meta.url)
|
|
365
|
-
);
|
|
366
|
-
if (existsSync(sourcePluginPath)) {
|
|
367
|
-
return sourcePluginPath;
|
|
368
|
-
}
|
|
369
|
-
return fileURLToPath(new URL("./react-agent-rules.js", import.meta.url));
|
|
370
|
-
}
|
|
371
|
-
var reactAgentRulesPlugin = resolveReactAgentRulesPluginPath();
|
|
372
|
-
var reactAgentRules = {
|
|
373
|
-
"react-agent-rules/effect-empty-deps-only": "error",
|
|
374
|
-
"react-agent-rules/no-forward-ref": "error",
|
|
375
|
-
"react-agent-rules/no-manual-memoization": "error"
|
|
376
|
-
};
|
|
377
|
-
|
|
378
378
|
// src/oxlint/presets/test.ts
|
|
379
379
|
var vitestRules = {
|
|
380
380
|
"no-unused-expressions": "off",
|
|
@@ -689,7 +689,10 @@ function defineOxlintConfig(options = {}) {
|
|
|
689
689
|
presets.react,
|
|
690
690
|
defaultOxlintPresets.react
|
|
691
691
|
);
|
|
692
|
-
const reactAgentRulesPreset = resolveRulePreset(
|
|
692
|
+
const reactAgentRulesPreset = resolveRulePreset(
|
|
693
|
+
presets.reactAgentRules,
|
|
694
|
+
false
|
|
695
|
+
);
|
|
693
696
|
const testPreset = resolveRulePreset(presets.test, defaultOxlintPresets.test);
|
|
694
697
|
const typeScriptPreset = resolveRulePreset(
|
|
695
698
|
presets.typescript,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhangyu1818/oxlint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Native Oxlint and Oxfmt config preset package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oxc",
|
|
@@ -32,28 +32,29 @@
|
|
|
32
32
|
"lint": "oxlint",
|
|
33
33
|
"lint:fix": "oxlint --fix",
|
|
34
34
|
"test": "vitest --run",
|
|
35
|
+
"test:smoke": "node tests/package-smoke.mjs",
|
|
35
36
|
"test:watch": "vitest",
|
|
36
37
|
"tsc:check": "tsc"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"local-pkg": "^1.1
|
|
40
|
+
"local-pkg": "^1.2.1"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^25.
|
|
43
|
-
"oxfmt": "^0.
|
|
44
|
-
"oxlint": "^1.
|
|
45
|
-
"oxlint-tsgolint": "^0.
|
|
43
|
+
"@types/node": "^25.9.1",
|
|
44
|
+
"oxfmt": "^0.51.0",
|
|
45
|
+
"oxlint": "^1.66.0",
|
|
46
|
+
"oxlint-tsgolint": "^0.23.0",
|
|
46
47
|
"tsup": "^8.5.1",
|
|
47
|
-
"typescript": "^
|
|
48
|
-
"vitest": "^4.1.
|
|
48
|
+
"typescript": "^6.0.3",
|
|
49
|
+
"vitest": "^4.1.7"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"oxfmt": "^0.
|
|
52
|
-
"oxlint": "^1.
|
|
53
|
-
"oxlint-tsgolint": "^0.
|
|
52
|
+
"oxfmt": "^0.51.0",
|
|
53
|
+
"oxlint": "^1.66.0",
|
|
54
|
+
"oxlint-tsgolint": "^0.23.0"
|
|
54
55
|
},
|
|
55
56
|
"engines": {
|
|
56
57
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
|
57
58
|
},
|
|
58
|
-
"packageManager": "pnpm@
|
|
59
|
+
"packageManager": "pnpm@11.2.2"
|
|
59
60
|
}
|