@coderwyd/eslint-config 2.6.1 → 2.6.3
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/cli.cjs +23 -23
- package/dist/cli.js +23 -23
- package/dist/index.cjs +98 -53
- package/dist/index.d.cts +263 -234
- package/dist/index.d.ts +263 -234
- package/dist/index.js +98 -53
- package/package.json +28 -28
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { default as default6 } from "eslint-plugin-unused-imports";
|
|
|
8
8
|
import { default as default7 } from "eslint-plugin-perfectionist";
|
|
9
9
|
|
|
10
10
|
// src/configs/comments.ts
|
|
11
|
-
|
|
11
|
+
function comments() {
|
|
12
12
|
return [
|
|
13
13
|
{
|
|
14
14
|
name: "coderwyd/eslint-comments/rules",
|
|
@@ -90,7 +90,7 @@ var GLOB_EXCLUDE = [
|
|
|
90
90
|
];
|
|
91
91
|
|
|
92
92
|
// src/configs/ignores.ts
|
|
93
|
-
|
|
93
|
+
function ignores() {
|
|
94
94
|
return [
|
|
95
95
|
{
|
|
96
96
|
ignores: GLOB_EXCLUDE
|
|
@@ -99,7 +99,7 @@ async function ignores() {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
// src/configs/imports.ts
|
|
102
|
-
|
|
102
|
+
function imports(options = {}) {
|
|
103
103
|
const { stylistic: stylistic2 = true } = options;
|
|
104
104
|
return [
|
|
105
105
|
{
|
|
@@ -118,23 +118,6 @@ async function imports(options = {}) {
|
|
|
118
118
|
"import/no-named-default": "error",
|
|
119
119
|
"import/no-self-import": "error",
|
|
120
120
|
"import/no-webpack-loader-syntax": "error",
|
|
121
|
-
"import/order": [
|
|
122
|
-
"error",
|
|
123
|
-
{
|
|
124
|
-
groups: [
|
|
125
|
-
"builtin",
|
|
126
|
-
"external",
|
|
127
|
-
"internal",
|
|
128
|
-
"parent",
|
|
129
|
-
"sibling",
|
|
130
|
-
"index",
|
|
131
|
-
"object",
|
|
132
|
-
"type"
|
|
133
|
-
],
|
|
134
|
-
pathGroups: [{ group: "internal", pattern: "{{@,~}/,#}**" }],
|
|
135
|
-
pathGroupsExcludedImportTypes: ["type"]
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
121
|
...stylistic2 ? {
|
|
139
122
|
"import/newline-after-import": ["error", { count: 1 }]
|
|
140
123
|
} : {}
|
|
@@ -153,7 +136,7 @@ async function imports(options = {}) {
|
|
|
153
136
|
|
|
154
137
|
// src/configs/javascript.ts
|
|
155
138
|
import globals from "globals";
|
|
156
|
-
|
|
139
|
+
function javascript(options = {}) {
|
|
157
140
|
const { isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
158
141
|
return [
|
|
159
142
|
{
|
|
@@ -359,16 +342,8 @@ async function javascript(options = {}) {
|
|
|
359
342
|
"prefer-rest-params": "error",
|
|
360
343
|
"prefer-spread": "error",
|
|
361
344
|
"prefer-template": "error",
|
|
362
|
-
"
|
|
363
|
-
|
|
364
|
-
{
|
|
365
|
-
allowSeparatedGroups: false,
|
|
366
|
-
ignoreCase: false,
|
|
367
|
-
ignoreDeclarationSort: true,
|
|
368
|
-
ignoreMemberSort: false,
|
|
369
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
370
|
-
}
|
|
371
|
-
],
|
|
345
|
+
"require-await": "error",
|
|
346
|
+
"require-yield": "error",
|
|
372
347
|
"symbol-description": "error",
|
|
373
348
|
"unicode-bom": ["error", "never"],
|
|
374
349
|
"unused-imports/no-unused-imports": isInEditor2 ? "off" : "error",
|
|
@@ -623,7 +598,7 @@ async function jsonc(options = {}) {
|
|
|
623
598
|
}
|
|
624
599
|
|
|
625
600
|
// src/configs/node.ts
|
|
626
|
-
|
|
601
|
+
function node() {
|
|
627
602
|
return [
|
|
628
603
|
{
|
|
629
604
|
name: "coderwyd/node/rules",
|
|
@@ -636,6 +611,7 @@ async function node() {
|
|
|
636
611
|
"node/no-exports-assign": "error",
|
|
637
612
|
"node/no-new-require": "error",
|
|
638
613
|
"node/no-path-concat": "error",
|
|
614
|
+
"node/no-unsupported-features/es-builtins": "error",
|
|
639
615
|
"node/prefer-global/buffer": ["error", "never"],
|
|
640
616
|
"node/prefer-global/process": ["error", "never"],
|
|
641
617
|
"node/process-exit-as-throw": "error"
|
|
@@ -645,7 +621,7 @@ async function node() {
|
|
|
645
621
|
}
|
|
646
622
|
|
|
647
623
|
// src/configs/sort.ts
|
|
648
|
-
|
|
624
|
+
function sortPackageJson() {
|
|
649
625
|
return [
|
|
650
626
|
{
|
|
651
627
|
files: ["**/package.json"],
|
|
@@ -1037,7 +1013,8 @@ async function typescript(options = {}) {
|
|
|
1037
1013
|
"ts/no-extraneous-class": "off",
|
|
1038
1014
|
"ts/no-import-type-side-effects": "error",
|
|
1039
1015
|
"ts/no-invalid-void-type": "off",
|
|
1040
|
-
|
|
1016
|
+
// this is deprecated
|
|
1017
|
+
"ts/no-loss-of-precision": "off",
|
|
1041
1018
|
"ts/no-non-null-assertion": "off",
|
|
1042
1019
|
"ts/no-redeclare": "error",
|
|
1043
1020
|
"ts/no-require-imports": "error",
|
|
@@ -1093,7 +1070,7 @@ async function typescript(options = {}) {
|
|
|
1093
1070
|
}
|
|
1094
1071
|
|
|
1095
1072
|
// src/configs/unicorn.ts
|
|
1096
|
-
|
|
1073
|
+
function unicorn() {
|
|
1097
1074
|
return [
|
|
1098
1075
|
{
|
|
1099
1076
|
name: "coderwyd/unicorn/rules",
|
|
@@ -1125,6 +1102,7 @@ async function unicorn() {
|
|
|
1125
1102
|
"unicorn/no-hex-escape": "error",
|
|
1126
1103
|
"unicorn/no-instanceof-array": "error",
|
|
1127
1104
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
1105
|
+
"unicorn/no-length-as-slice-end": "error",
|
|
1128
1106
|
"unicorn/no-lonely-if": "error",
|
|
1129
1107
|
"unicorn/no-new-array": "error",
|
|
1130
1108
|
"unicorn/no-new-buffer": "error",
|
|
@@ -1276,19 +1254,19 @@ async function vue(options = {}) {
|
|
|
1276
1254
|
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
1277
1255
|
"vue/eqeqeq": ["error", "smart"],
|
|
1278
1256
|
"vue/html-indent": ["error", indent],
|
|
1279
|
-
// 'vue/html-self-closing': [
|
|
1280
|
-
// 'error',
|
|
1281
|
-
// {
|
|
1282
|
-
// html: {
|
|
1283
|
-
// component: 'always',
|
|
1284
|
-
// normal: 'always',
|
|
1285
|
-
// void: 'any',
|
|
1286
|
-
// },
|
|
1287
|
-
// math: 'always',
|
|
1288
|
-
// svg: 'always',
|
|
1289
|
-
// },
|
|
1290
1257
|
"vue/html-quotes": ["error", "double"],
|
|
1291
|
-
|
|
1258
|
+
"vue/html-self-closing": [
|
|
1259
|
+
"error",
|
|
1260
|
+
{
|
|
1261
|
+
html: {
|
|
1262
|
+
component: "always",
|
|
1263
|
+
normal: "always",
|
|
1264
|
+
void: "any"
|
|
1265
|
+
},
|
|
1266
|
+
math: "always",
|
|
1267
|
+
svg: "always"
|
|
1268
|
+
}
|
|
1269
|
+
],
|
|
1292
1270
|
"vue/max-attributes-per-line": "off",
|
|
1293
1271
|
"vue/multi-word-component-names": "off",
|
|
1294
1272
|
// 'vue/next-tick-style': ['warn', 'promise'],
|
|
@@ -1341,6 +1319,7 @@ async function vue(options = {}) {
|
|
|
1341
1319
|
}
|
|
1342
1320
|
],
|
|
1343
1321
|
"vue/require-prop-types": "off",
|
|
1322
|
+
// 'vue/singleline-html-element-content-newline': 'off',
|
|
1344
1323
|
"vue/space-infix-ops": "error",
|
|
1345
1324
|
"vue/space-unary-ops": ["error", { nonwords: false, words: true }],
|
|
1346
1325
|
"vue/valid-define-options": "warn",
|
|
@@ -1399,7 +1378,7 @@ var _pluginTest;
|
|
|
1399
1378
|
async function test(options = {}) {
|
|
1400
1379
|
const { files = GLOB_TESTS, isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
1401
1380
|
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
1402
|
-
interopDefault(import("eslint-plugin
|
|
1381
|
+
interopDefault(import("@vitest/eslint-plugin")),
|
|
1403
1382
|
// @ts-expect-error missing types
|
|
1404
1383
|
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
1405
1384
|
]);
|
|
@@ -1440,12 +1419,78 @@ async function test(options = {}) {
|
|
|
1440
1419
|
}
|
|
1441
1420
|
|
|
1442
1421
|
// src/configs/perfectionist.ts
|
|
1443
|
-
|
|
1422
|
+
function perfectionist() {
|
|
1444
1423
|
return [
|
|
1445
1424
|
{
|
|
1446
|
-
name: "coderwyd/perfectionist/
|
|
1425
|
+
name: "coderwyd/perfectionist/rules",
|
|
1447
1426
|
plugins: {
|
|
1448
1427
|
perfectionist: default7
|
|
1428
|
+
},
|
|
1429
|
+
rules: {
|
|
1430
|
+
"perfectionist/sort-imports": [
|
|
1431
|
+
"warn",
|
|
1432
|
+
{
|
|
1433
|
+
groups: [
|
|
1434
|
+
"builtin",
|
|
1435
|
+
"external",
|
|
1436
|
+
"internal",
|
|
1437
|
+
"internal-type",
|
|
1438
|
+
"parent",
|
|
1439
|
+
"parent-type",
|
|
1440
|
+
"sibling",
|
|
1441
|
+
"sibling-type",
|
|
1442
|
+
"index",
|
|
1443
|
+
"index-type",
|
|
1444
|
+
"object",
|
|
1445
|
+
"type",
|
|
1446
|
+
"side-effect",
|
|
1447
|
+
"side-effect-style"
|
|
1448
|
+
],
|
|
1449
|
+
internalPattern: ["~/**", "@/**", "#**"],
|
|
1450
|
+
newlinesBetween: "ignore"
|
|
1451
|
+
}
|
|
1452
|
+
],
|
|
1453
|
+
"perfectionist/sort-named-exports": [
|
|
1454
|
+
"warn",
|
|
1455
|
+
{ groupKind: "values-first" }
|
|
1456
|
+
],
|
|
1457
|
+
"perfectionist/sort-named-imports": [
|
|
1458
|
+
"warn",
|
|
1459
|
+
{ groupKind: "values-first" }
|
|
1460
|
+
],
|
|
1461
|
+
"perfectionist/sort-vue-attributes": [
|
|
1462
|
+
"error",
|
|
1463
|
+
{
|
|
1464
|
+
// Based on: https://vuejs.org/style-guide/rules-recommended.html#element-attribute-order
|
|
1465
|
+
customGroups: {
|
|
1466
|
+
CONDITIONALS: "v-*(else-if|if|else|show|cloak)",
|
|
1467
|
+
CONTENT: "v-*(html|text)",
|
|
1468
|
+
DEFINITION: "*(is|:is|v-is)",
|
|
1469
|
+
// OTHER_DIRECTIVES e.g. 'v-custom-directive'
|
|
1470
|
+
EVENTS: "*(v-on|@*)",
|
|
1471
|
+
GLOBAL: "*(:id|id)",
|
|
1472
|
+
LIST_RENDERING: "v-for",
|
|
1473
|
+
RENDER_MODIFIERS: "v-*(pre|once)",
|
|
1474
|
+
SLOT: "*(v-slot|slot)",
|
|
1475
|
+
TWO_WAY_BINDING: "*(v-model|v-model:*)",
|
|
1476
|
+
UNIQUE: "*(ref|key|:ref|:key)"
|
|
1477
|
+
},
|
|
1478
|
+
groups: [
|
|
1479
|
+
"DEFINITION",
|
|
1480
|
+
"LIST_RENDERING",
|
|
1481
|
+
"CONDITIONALS",
|
|
1482
|
+
"RENDER_MODIFIERS",
|
|
1483
|
+
"GLOBAL",
|
|
1484
|
+
"UNIQUE",
|
|
1485
|
+
"SLOT",
|
|
1486
|
+
"TWO_WAY_BINDING",
|
|
1487
|
+
"unknown",
|
|
1488
|
+
"EVENTS",
|
|
1489
|
+
"CONTENT"
|
|
1490
|
+
],
|
|
1491
|
+
type: "natural"
|
|
1492
|
+
}
|
|
1493
|
+
]
|
|
1449
1494
|
}
|
|
1450
1495
|
}
|
|
1451
1496
|
];
|
|
@@ -1858,7 +1903,7 @@ async function tailwindcss(options = {}) {
|
|
|
1858
1903
|
|
|
1859
1904
|
// src/configs/command.ts
|
|
1860
1905
|
import createCommand from "eslint-plugin-command/config";
|
|
1861
|
-
|
|
1906
|
+
function command() {
|
|
1862
1907
|
return [
|
|
1863
1908
|
{
|
|
1864
1909
|
...createCommand(),
|
|
@@ -1869,7 +1914,7 @@ async function command() {
|
|
|
1869
1914
|
|
|
1870
1915
|
// src/configs/regexp.ts
|
|
1871
1916
|
import { configs } from "eslint-plugin-regexp";
|
|
1872
|
-
|
|
1917
|
+
function regexp(options = {}) {
|
|
1873
1918
|
const config = configs["flat/recommended"];
|
|
1874
1919
|
const rules = {
|
|
1875
1920
|
...config.rules
|
|
@@ -1893,7 +1938,7 @@ async function regexp(options = {}) {
|
|
|
1893
1938
|
}
|
|
1894
1939
|
|
|
1895
1940
|
// src/configs/jsx.ts
|
|
1896
|
-
|
|
1941
|
+
function jsx() {
|
|
1897
1942
|
return [
|
|
1898
1943
|
{
|
|
1899
1944
|
files: [GLOB_JSX, GLOB_TSX],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.6.
|
|
4
|
+
"version": "2.6.3",
|
|
5
5
|
"description": "Donny's ESLint config",
|
|
6
6
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -69,30 +69,30 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@antfu/install-pkg": "^0.3.3",
|
|
72
|
-
"@stylistic/eslint-plugin": "^2.6.
|
|
72
|
+
"@stylistic/eslint-plugin": "^2.6.2",
|
|
73
73
|
"@toml-tools/parser": "^1.0.0",
|
|
74
|
-
"@typescript-eslint/eslint-plugin": "^8.0.
|
|
75
|
-
"@typescript-eslint/parser": "^8.0.
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
75
|
+
"@typescript-eslint/parser": "^8.0.1",
|
|
76
|
+
"@vitest/eslint-plugin": "^1.0.0",
|
|
76
77
|
"eslint-config-flat-gitignore": "^0.1.8",
|
|
77
78
|
"eslint-merge-processors": "^0.1.0",
|
|
78
79
|
"eslint-plugin-antfu": "^2.3.4",
|
|
79
80
|
"eslint-plugin-command": "^0.2.3",
|
|
80
81
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
81
82
|
"eslint-plugin-format": "^0.1.2",
|
|
82
|
-
"eslint-plugin-import-x": "^3.0
|
|
83
|
-
"eslint-plugin-jsdoc": "^
|
|
83
|
+
"eslint-plugin-import-x": "^3.1.0",
|
|
84
|
+
"eslint-plugin-jsdoc": "^50.0.1",
|
|
84
85
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
85
|
-
"eslint-plugin-n": "^17.
|
|
86
|
+
"eslint-plugin-n": "^17.10.2",
|
|
86
87
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
87
|
-
"eslint-plugin-perfectionist": "^3.
|
|
88
|
+
"eslint-plugin-perfectionist": "^3.1.3",
|
|
88
89
|
"eslint-plugin-regexp": "^2.6.0",
|
|
89
|
-
"eslint-plugin-unicorn": "^
|
|
90
|
-
"eslint-plugin-unused-imports": "^4.
|
|
91
|
-
"eslint-plugin-vitest": "^0.5.4",
|
|
90
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
91
|
+
"eslint-plugin-unused-imports": "^4.1.3",
|
|
92
92
|
"eslint-plugin-vue": "^9.27.0",
|
|
93
93
|
"eslint-processor-vue-blocks": "^0.1.2",
|
|
94
|
-
"eslint-typegen": "^0.
|
|
95
|
-
"globals": "^15.
|
|
94
|
+
"eslint-typegen": "^0.3.0",
|
|
95
|
+
"globals": "^15.9.0",
|
|
96
96
|
"jsonc-eslint-parser": "^2.4.0",
|
|
97
97
|
"local-pkg": "^0.5.0",
|
|
98
98
|
"parse-gitignore": "^2.0.0",
|
|
@@ -103,18 +103,18 @@
|
|
|
103
103
|
"yargs": "^17.7.2"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@antfu/ni": "^0.22.
|
|
107
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
106
|
+
"@antfu/ni": "^0.22.1",
|
|
107
|
+
"@eslint-react/eslint-plugin": "^1.9.1",
|
|
108
108
|
"@eslint/config-inspector": "^0.5.2",
|
|
109
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
110
|
-
"@types/eslint": "^
|
|
109
|
+
"@stylistic/eslint-plugin-migrate": "^2.6.2",
|
|
110
|
+
"@types/eslint": "^9.6.0",
|
|
111
111
|
"@types/fs-extra": "^11.0.4",
|
|
112
|
-
"@types/node": "^20.14.
|
|
112
|
+
"@types/node": "^20.14.15",
|
|
113
113
|
"@types/prompts": "^2.4.9",
|
|
114
|
-
"@types/yargs": "^17.0.
|
|
115
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
116
|
-
"bumpp": "^9.4.
|
|
117
|
-
"eslint": "^9.
|
|
114
|
+
"@types/yargs": "^17.0.33",
|
|
115
|
+
"@unocss/eslint-plugin": "^0.61.9",
|
|
116
|
+
"bumpp": "^9.4.2",
|
|
117
|
+
"eslint": "^9.9.0",
|
|
118
118
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
119
119
|
"eslint-plugin-react-refresh": "^0.4.9",
|
|
120
120
|
"eslint-plugin-svelte": "2.43.0",
|
|
@@ -122,13 +122,13 @@
|
|
|
122
122
|
"execa": "^9.3.0",
|
|
123
123
|
"fast-glob": "^3.3.2",
|
|
124
124
|
"fs-extra": "^11.2.0",
|
|
125
|
-
"lint-staged": "^15.2.
|
|
125
|
+
"lint-staged": "^15.2.8",
|
|
126
126
|
"rimraf": "^6.0.1",
|
|
127
127
|
"simple-git-hooks": "^2.11.1",
|
|
128
128
|
"svelte": "^4.2.18",
|
|
129
129
|
"svelte-eslint-parser": "^0.41.0",
|
|
130
|
-
"tsup": "^8.2.
|
|
131
|
-
"tsx": "^4.
|
|
130
|
+
"tsup": "^8.2.4",
|
|
131
|
+
"tsx": "^4.17.0",
|
|
132
132
|
"typescript": "^5.5.4"
|
|
133
133
|
},
|
|
134
134
|
"simple-git-hooks": {
|
|
@@ -138,12 +138,12 @@
|
|
|
138
138
|
"*": "eslint --fix"
|
|
139
139
|
},
|
|
140
140
|
"scripts": {
|
|
141
|
-
"build": "nr typegen && tsup",
|
|
142
|
-
"dev": "
|
|
141
|
+
"build": "nr build:typegen && tsup",
|
|
142
|
+
"dev": "npx @eslint/config-inspector",
|
|
143
143
|
"lint": "eslint .",
|
|
144
144
|
"lint:fix": "eslint . --fix",
|
|
145
145
|
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
|
|
146
|
-
"typegen": "tsx scripts/typegen.ts",
|
|
146
|
+
"build:typegen": "tsx scripts/typegen.ts",
|
|
147
147
|
"release": "bumpp && pnpm publish",
|
|
148
148
|
"typecheck": "tsc --noEmit"
|
|
149
149
|
}
|