@vinicunca/eslint-config 2.13.2 → 2.15.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.cjs +33 -22
- package/dist/index.d.cts +1687 -257
- package/dist/index.d.ts +1687 -257
- package/dist/index.js +32 -21
- package/package.json +16 -10
package/dist/index.js
CHANGED
|
@@ -1231,10 +1231,10 @@ async function perfectionist() {
|
|
|
1231
1231
|
{
|
|
1232
1232
|
groups: [
|
|
1233
1233
|
"type",
|
|
1234
|
-
["parent-type", "sibling-type", "index-type"],
|
|
1234
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
1235
1235
|
"builtin",
|
|
1236
1236
|
"external",
|
|
1237
|
-
|
|
1237
|
+
"internal",
|
|
1238
1238
|
["parent", "sibling", "index"],
|
|
1239
1239
|
"side-effect",
|
|
1240
1240
|
"object",
|
|
@@ -1276,20 +1276,26 @@ var NextJsPackages = [
|
|
|
1276
1276
|
async function react(options = {}) {
|
|
1277
1277
|
const {
|
|
1278
1278
|
files = [GLOB_SRC],
|
|
1279
|
-
|
|
1279
|
+
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
1280
|
+
ignoresTypeAware = [
|
|
1281
|
+
`${GLOB_MARKDOWN}/**`,
|
|
1282
|
+
GLOB_ASTRO_TS
|
|
1283
|
+
],
|
|
1284
|
+
overrides = {},
|
|
1285
|
+
tsconfigPath
|
|
1280
1286
|
} = options;
|
|
1281
|
-
const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
|
|
1282
1287
|
const isTypeAware = !!tsconfigPath;
|
|
1288
|
+
const typeAwareRules = {
|
|
1289
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
1290
|
+
};
|
|
1283
1291
|
const [
|
|
1284
1292
|
pluginReact,
|
|
1285
1293
|
pluginReactHooks,
|
|
1286
|
-
pluginReactRefresh
|
|
1287
|
-
parserTs
|
|
1294
|
+
pluginReactRefresh
|
|
1288
1295
|
] = await Promise.all([
|
|
1289
1296
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1290
1297
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1291
|
-
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1292
|
-
interopDefault(import("@typescript-eslint/parser"))
|
|
1298
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1293
1299
|
]);
|
|
1294
1300
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists3(i));
|
|
1295
1301
|
const isUsingRemix = RemixPackages.some((i) => isPackageExists3(i));
|
|
@@ -1310,12 +1316,10 @@ async function react(options = {}) {
|
|
|
1310
1316
|
{
|
|
1311
1317
|
files,
|
|
1312
1318
|
languageOptions: {
|
|
1313
|
-
parser: parserTs,
|
|
1314
1319
|
parserOptions: {
|
|
1315
1320
|
ecmaFeatures: {
|
|
1316
1321
|
jsx: true
|
|
1317
|
-
}
|
|
1318
|
-
...isTypeAware ? { project: tsconfigPath } : {}
|
|
1322
|
+
}
|
|
1319
1323
|
},
|
|
1320
1324
|
sourceType: "module"
|
|
1321
1325
|
},
|
|
@@ -1397,13 +1401,18 @@ async function react(options = {}) {
|
|
|
1397
1401
|
"react/prefer-destructuring-assignment": WARN,
|
|
1398
1402
|
"react/prefer-shorthand-boolean": WARN,
|
|
1399
1403
|
"react/prefer-shorthand-fragment": WARN,
|
|
1400
|
-
...isTypeAware ? {
|
|
1401
|
-
"react/no-leaked-conditional-rendering": WARN
|
|
1402
|
-
} : {},
|
|
1403
1404
|
// overrides
|
|
1404
1405
|
...overrides
|
|
1405
1406
|
}
|
|
1406
|
-
}
|
|
1407
|
+
},
|
|
1408
|
+
...isTypeAware ? [{
|
|
1409
|
+
files: filesTypeAware,
|
|
1410
|
+
ignores: ignoresTypeAware,
|
|
1411
|
+
name: "antfu/react/type-aware-rules",
|
|
1412
|
+
rules: {
|
|
1413
|
+
...typeAwareRules
|
|
1414
|
+
}
|
|
1415
|
+
}] : []
|
|
1407
1416
|
];
|
|
1408
1417
|
}
|
|
1409
1418
|
|
|
@@ -1515,7 +1524,9 @@ async function sonar() {
|
|
|
1515
1524
|
sonar: default6
|
|
1516
1525
|
},
|
|
1517
1526
|
rules: {
|
|
1518
|
-
...default6.configs.recommended.rules
|
|
1527
|
+
...default6.configs.recommended.rules,
|
|
1528
|
+
"sonar/todo-tag": OFF,
|
|
1529
|
+
"sonar/pseudo-random": OFF
|
|
1519
1530
|
}
|
|
1520
1531
|
}
|
|
1521
1532
|
];
|
|
@@ -2425,8 +2436,7 @@ async function yaml(options = {}) {
|
|
|
2425
2436
|
"yaml/indent": [ERROR, indent === "tab" ? 2 : indent],
|
|
2426
2437
|
"yaml/key-spacing": ERROR,
|
|
2427
2438
|
"yaml/no-tab-indent": ERROR,
|
|
2428
|
-
|
|
2429
|
-
"yaml/quotes": [ERROR, { avoidEscape: false, prefer: quotes }],
|
|
2439
|
+
"yaml/quotes": [ERROR, { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
|
|
2430
2440
|
"yaml/spaced-comment": ERROR
|
|
2431
2441
|
} : {},
|
|
2432
2442
|
...overrides
|
|
@@ -2576,6 +2586,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2576
2586
|
}
|
|
2577
2587
|
if (enableReact) {
|
|
2578
2588
|
configs2.push(react({
|
|
2589
|
+
...typescriptOptions,
|
|
2579
2590
|
overrides: getOverrides(options, "react"),
|
|
2580
2591
|
tsconfigPath
|
|
2581
2592
|
}));
|
|
@@ -2668,15 +2679,15 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2668
2679
|
}
|
|
2669
2680
|
return composer;
|
|
2670
2681
|
}
|
|
2671
|
-
function resolveSubOptions(options, key) {
|
|
2672
|
-
return e(options[key]) ? {} : options[key] || {};
|
|
2673
|
-
}
|
|
2674
2682
|
function getOverrides(options, key) {
|
|
2675
2683
|
const sub = resolveSubOptions(options, key);
|
|
2676
2684
|
return {
|
|
2677
2685
|
..."overrides" in sub ? sub.overrides : {}
|
|
2678
2686
|
};
|
|
2679
2687
|
}
|
|
2688
|
+
function resolveSubOptions(options, key) {
|
|
2689
|
+
return e(options[key]) ? {} : options[key] || {};
|
|
2690
|
+
}
|
|
2680
2691
|
export {
|
|
2681
2692
|
GLOB_ALL_SRC,
|
|
2682
2693
|
GLOB_ASTRO,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vinicunca/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.15.0",
|
|
5
5
|
"description": "Vinicunca ESLint config",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "praburangki",
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
"node": ">=20.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@eslint-react/eslint-plugin": "^1.17.
|
|
58
|
+
"@eslint-react/eslint-plugin": "^1.17.3",
|
|
59
59
|
"@prettier/plugin-xml": "^3.4.1",
|
|
60
60
|
"astro-eslint-parser": "^1.1.0",
|
|
61
|
-
"eslint": "^9.
|
|
61
|
+
"eslint": "^9.16.0",
|
|
62
62
|
"eslint-plugin-astro": "^1.3.1",
|
|
63
63
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
64
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
64
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
65
65
|
"eslint-plugin-solid": "^0.14.4",
|
|
66
|
-
"eslint-plugin-svelte": ">=2.46.
|
|
66
|
+
"eslint-plugin-svelte": ">=2.46.1",
|
|
67
67
|
"prettier-plugin-astro": "^0.14.1",
|
|
68
68
|
"prettier-plugin-slidev": "^1.0.5",
|
|
69
69
|
"svelte-eslint-parser": ">=0.43.0"
|
|
@@ -75,12 +75,18 @@
|
|
|
75
75
|
"@prettier/plugin-xml": {
|
|
76
76
|
"optional": true
|
|
77
77
|
},
|
|
78
|
+
"@unocss/eslint-plugin": {
|
|
79
|
+
"optional": true
|
|
80
|
+
},
|
|
78
81
|
"astro-eslint-parser": {
|
|
79
82
|
"optional": true
|
|
80
83
|
},
|
|
81
84
|
"eslint-plugin-astro": {
|
|
82
85
|
"optional": true
|
|
83
86
|
},
|
|
87
|
+
"eslint-plugin-format": {
|
|
88
|
+
"optional": true
|
|
89
|
+
},
|
|
84
90
|
"eslint-plugin-react-hooks": {
|
|
85
91
|
"optional": true
|
|
86
92
|
},
|
|
@@ -109,10 +115,10 @@
|
|
|
109
115
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
110
116
|
"@eslint/markdown": "^6.2.1",
|
|
111
117
|
"@stylistic/eslint-plugin": "^2.11.0",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
113
|
-
"@typescript-eslint/parser": "^8.
|
|
114
|
-
"@unocss/eslint-plugin": "^0.
|
|
115
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
118
|
+
"@typescript-eslint/eslint-plugin": "^8.17.0",
|
|
119
|
+
"@typescript-eslint/parser": "^8.17.0",
|
|
120
|
+
"@unocss/eslint-plugin": "^0.65.0",
|
|
121
|
+
"@vitest/eslint-plugin": "^1.1.14",
|
|
116
122
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
117
123
|
"eslint-flat-config-utils": "^0.4.0",
|
|
118
124
|
"eslint-merge-processors": "^0.1.0",
|
|
@@ -126,7 +132,7 @@
|
|
|
126
132
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
127
133
|
"eslint-plugin-perfectionist": "^4.1.2",
|
|
128
134
|
"eslint-plugin-regexp": "^2.7.0",
|
|
129
|
-
"eslint-plugin-sonarjs": "^
|
|
135
|
+
"eslint-plugin-sonarjs": "^3.0.0",
|
|
130
136
|
"eslint-plugin-toml": "^0.12.0",
|
|
131
137
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
132
138
|
"eslint-plugin-unused-imports": "^4.1.4",
|