@coderwyd/eslint-config 2.6.1 → 2.6.2
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 +16 -16
- package/dist/cli.js +16 -16
- package/dist/index.cjs +49 -40
- package/dist/index.d.cts +194 -188
- package/dist/index.d.ts +194 -188
- package/dist/index.js +49 -40
- package/package.json +11 -11
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",
|
|
@@ -645,7 +620,7 @@ async function node() {
|
|
|
645
620
|
}
|
|
646
621
|
|
|
647
622
|
// src/configs/sort.ts
|
|
648
|
-
|
|
623
|
+
function sortPackageJson() {
|
|
649
624
|
return [
|
|
650
625
|
{
|
|
651
626
|
files: ["**/package.json"],
|
|
@@ -1093,7 +1068,7 @@ async function typescript(options = {}) {
|
|
|
1093
1068
|
}
|
|
1094
1069
|
|
|
1095
1070
|
// src/configs/unicorn.ts
|
|
1096
|
-
|
|
1071
|
+
function unicorn() {
|
|
1097
1072
|
return [
|
|
1098
1073
|
{
|
|
1099
1074
|
name: "coderwyd/unicorn/rules",
|
|
@@ -1125,6 +1100,7 @@ async function unicorn() {
|
|
|
1125
1100
|
"unicorn/no-hex-escape": "error",
|
|
1126
1101
|
"unicorn/no-instanceof-array": "error",
|
|
1127
1102
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
1103
|
+
"unicorn/no-length-as-slice-end": "error",
|
|
1128
1104
|
"unicorn/no-lonely-if": "error",
|
|
1129
1105
|
"unicorn/no-new-array": "error",
|
|
1130
1106
|
"unicorn/no-new-buffer": "error",
|
|
@@ -1289,7 +1265,7 @@ async function vue(options = {}) {
|
|
|
1289
1265
|
// },
|
|
1290
1266
|
"vue/html-quotes": ["error", "double"],
|
|
1291
1267
|
// ],
|
|
1292
|
-
|
|
1268
|
+
// 'vue/max-attributes-per-line': 'off',
|
|
1293
1269
|
"vue/multi-word-component-names": "off",
|
|
1294
1270
|
// 'vue/next-tick-style': ['warn', 'promise'],
|
|
1295
1271
|
"vue/no-constant-condition": "warn",
|
|
@@ -1440,12 +1416,45 @@ async function test(options = {}) {
|
|
|
1440
1416
|
}
|
|
1441
1417
|
|
|
1442
1418
|
// src/configs/perfectionist.ts
|
|
1443
|
-
|
|
1419
|
+
function perfectionist() {
|
|
1444
1420
|
return [
|
|
1445
1421
|
{
|
|
1446
|
-
name: "coderwyd/perfectionist/
|
|
1422
|
+
name: "coderwyd/perfectionist/rules",
|
|
1447
1423
|
plugins: {
|
|
1448
1424
|
perfectionist: default7
|
|
1425
|
+
},
|
|
1426
|
+
rules: {
|
|
1427
|
+
"perfectionist/sort-imports": [
|
|
1428
|
+
"warn",
|
|
1429
|
+
{
|
|
1430
|
+
groups: [
|
|
1431
|
+
"builtin",
|
|
1432
|
+
"external",
|
|
1433
|
+
"internal",
|
|
1434
|
+
"internal-type",
|
|
1435
|
+
"parent",
|
|
1436
|
+
"parent-type",
|
|
1437
|
+
"sibling",
|
|
1438
|
+
"sibling-type",
|
|
1439
|
+
"index",
|
|
1440
|
+
"index-type",
|
|
1441
|
+
"object",
|
|
1442
|
+
"type",
|
|
1443
|
+
"side-effect",
|
|
1444
|
+
"side-effect-style"
|
|
1445
|
+
],
|
|
1446
|
+
internalPattern: ["~/**", "@/**", "#**"],
|
|
1447
|
+
newlinesBetween: "ignore"
|
|
1448
|
+
}
|
|
1449
|
+
],
|
|
1450
|
+
"perfectionist/sort-named-exports": [
|
|
1451
|
+
"warn",
|
|
1452
|
+
{ groupKind: "values-first" }
|
|
1453
|
+
],
|
|
1454
|
+
"perfectionist/sort-named-imports": [
|
|
1455
|
+
"warn",
|
|
1456
|
+
{ groupKind: "values-first" }
|
|
1457
|
+
]
|
|
1449
1458
|
}
|
|
1450
1459
|
}
|
|
1451
1460
|
];
|
|
@@ -1858,7 +1867,7 @@ async function tailwindcss(options = {}) {
|
|
|
1858
1867
|
|
|
1859
1868
|
// src/configs/command.ts
|
|
1860
1869
|
import createCommand from "eslint-plugin-command/config";
|
|
1861
|
-
|
|
1870
|
+
function command() {
|
|
1862
1871
|
return [
|
|
1863
1872
|
{
|
|
1864
1873
|
...createCommand(),
|
|
@@ -1869,7 +1878,7 @@ async function command() {
|
|
|
1869
1878
|
|
|
1870
1879
|
// src/configs/regexp.ts
|
|
1871
1880
|
import { configs } from "eslint-plugin-regexp";
|
|
1872
|
-
|
|
1881
|
+
function regexp(options = {}) {
|
|
1873
1882
|
const config = configs["flat/recommended"];
|
|
1874
1883
|
const rules = {
|
|
1875
1884
|
...config.rules
|
|
@@ -1893,7 +1902,7 @@ async function regexp(options = {}) {
|
|
|
1893
1902
|
}
|
|
1894
1903
|
|
|
1895
1904
|
// src/configs/jsx.ts
|
|
1896
|
-
|
|
1905
|
+
function jsx() {
|
|
1897
1906
|
return [
|
|
1898
1907
|
{
|
|
1899
1908
|
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.2",
|
|
5
5
|
"description": "Donny's ESLint config",
|
|
6
6
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -71,22 +71,22 @@
|
|
|
71
71
|
"@antfu/install-pkg": "^0.3.3",
|
|
72
72
|
"@stylistic/eslint-plugin": "^2.6.0-beta.0",
|
|
73
73
|
"@toml-tools/parser": "^1.0.0",
|
|
74
|
-
"@typescript-eslint/eslint-plugin": "^8.0.0-alpha.
|
|
75
|
-
"@typescript-eslint/parser": "^8.0.0-alpha.
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0-alpha.54",
|
|
75
|
+
"@typescript-eslint/parser": "^8.0.0-alpha.54",
|
|
76
76
|
"eslint-config-flat-gitignore": "^0.1.8",
|
|
77
77
|
"eslint-merge-processors": "^0.1.0",
|
|
78
78
|
"eslint-plugin-antfu": "^2.3.4",
|
|
79
79
|
"eslint-plugin-command": "^0.2.3",
|
|
80
80
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
81
81
|
"eslint-plugin-format": "^0.1.2",
|
|
82
|
-
"eslint-plugin-import-x": "^3.0
|
|
82
|
+
"eslint-plugin-import-x": "^3.1.0",
|
|
83
83
|
"eslint-plugin-jsdoc": "^48.8.3",
|
|
84
84
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
85
|
-
"eslint-plugin-n": "^17.
|
|
85
|
+
"eslint-plugin-n": "^17.10.1",
|
|
86
86
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
87
87
|
"eslint-plugin-perfectionist": "^3.0.0",
|
|
88
88
|
"eslint-plugin-regexp": "^2.6.0",
|
|
89
|
-
"eslint-plugin-unicorn": "^
|
|
89
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
90
90
|
"eslint-plugin-unused-imports": "^4.0.1",
|
|
91
91
|
"eslint-plugin-vitest": "^0.5.4",
|
|
92
92
|
"eslint-plugin-vue": "^9.27.0",
|
|
@@ -107,14 +107,14 @@
|
|
|
107
107
|
"@eslint-react/eslint-plugin": "^1.5.30",
|
|
108
108
|
"@eslint/config-inspector": "^0.5.2",
|
|
109
109
|
"@stylistic/eslint-plugin-migrate": "^2.3.0",
|
|
110
|
-
"@types/eslint": "^
|
|
110
|
+
"@types/eslint": "^9.6.0",
|
|
111
111
|
"@types/fs-extra": "^11.0.4",
|
|
112
|
-
"@types/node": "^20.14.
|
|
112
|
+
"@types/node": "^20.14.12",
|
|
113
113
|
"@types/prompts": "^2.4.9",
|
|
114
114
|
"@types/yargs": "^17.0.32",
|
|
115
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
115
|
+
"@unocss/eslint-plugin": "^0.61.6",
|
|
116
116
|
"bumpp": "^9.4.1",
|
|
117
|
-
"eslint": "^9.
|
|
117
|
+
"eslint": "^9.8.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",
|
|
@@ -127,7 +127,7 @@
|
|
|
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.
|
|
130
|
+
"tsup": "^8.2.3",
|
|
131
131
|
"tsx": "^4.16.2",
|
|
132
132
|
"typescript": "^5.5.4"
|
|
133
133
|
},
|