@lincy/eslint-config 5.5.0 → 5.5.1
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 +62 -23
- package/dist/index.d.cts +183 -141
- package/dist/index.d.ts +183 -141
- package/dist/index.js +62 -23
- package/package.json +65 -81
package/dist/index.js
CHANGED
|
@@ -1092,6 +1092,15 @@ async function perfectionist(options = {}) {
|
|
|
1092
1092
|
|
|
1093
1093
|
// src/configs/pnpm.ts
|
|
1094
1094
|
async function pnpm() {
|
|
1095
|
+
const [
|
|
1096
|
+
pluginPnpm,
|
|
1097
|
+
yamlParser,
|
|
1098
|
+
jsoncParser
|
|
1099
|
+
] = await Promise.all([
|
|
1100
|
+
interopDefault(import("eslint-plugin-pnpm")),
|
|
1101
|
+
interopDefault(import("yaml-eslint-parser")),
|
|
1102
|
+
interopDefault(import("jsonc-eslint-parser"))
|
|
1103
|
+
]);
|
|
1095
1104
|
return [
|
|
1096
1105
|
{
|
|
1097
1106
|
files: [
|
|
@@ -1099,16 +1108,30 @@ async function pnpm() {
|
|
|
1099
1108
|
"**/package.json"
|
|
1100
1109
|
],
|
|
1101
1110
|
languageOptions: {
|
|
1102
|
-
parser:
|
|
1111
|
+
parser: jsoncParser
|
|
1112
|
+
},
|
|
1113
|
+
name: "eslint/pnpm/package-json",
|
|
1114
|
+
plugins: {
|
|
1115
|
+
pnpm: pluginPnpm
|
|
1116
|
+
},
|
|
1117
|
+
rules: {
|
|
1118
|
+
"pnpm/json-enforce-catalog": "error",
|
|
1119
|
+
"pnpm/json-prefer-workspace-settings": "error",
|
|
1120
|
+
"pnpm/json-valid-catalog": "error"
|
|
1121
|
+
}
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
files: ["pnpm-workspace.yaml"],
|
|
1125
|
+
languageOptions: {
|
|
1126
|
+
parser: yamlParser
|
|
1103
1127
|
},
|
|
1104
|
-
name: "eslint/pnpm/
|
|
1128
|
+
name: "eslint/pnpm/pnpm-workspace-yaml",
|
|
1105
1129
|
plugins: {
|
|
1106
|
-
pnpm:
|
|
1130
|
+
pnpm: pluginPnpm
|
|
1107
1131
|
},
|
|
1108
1132
|
rules: {
|
|
1109
|
-
"pnpm/
|
|
1110
|
-
"pnpm/
|
|
1111
|
-
"pnpm/valid-catalog": "error"
|
|
1133
|
+
"pnpm/yaml-no-duplicate-catalog-item": "error",
|
|
1134
|
+
"pnpm/yaml-no-unused-catalog-item": "error"
|
|
1112
1135
|
}
|
|
1113
1136
|
}
|
|
1114
1137
|
];
|
|
@@ -1194,22 +1217,29 @@ async function react(options = {}) {
|
|
|
1194
1217
|
},
|
|
1195
1218
|
name: "eslint/react/rules",
|
|
1196
1219
|
rules: {
|
|
1197
|
-
// recommended rules from
|
|
1198
|
-
"react-dom/no-
|
|
1199
|
-
"react-dom/no-dangerously-set-innerhtml": "off",
|
|
1220
|
+
// recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
|
|
1221
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1200
1222
|
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1201
1223
|
"react-dom/no-find-dom-node": "error",
|
|
1224
|
+
"react-dom/no-flush-sync": "error",
|
|
1225
|
+
"react-dom/no-hydrate": "error",
|
|
1202
1226
|
"react-dom/no-missing-button-type": "warn",
|
|
1203
1227
|
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1204
1228
|
"react-dom/no-namespace": "error",
|
|
1229
|
+
"react-dom/no-render": "error",
|
|
1205
1230
|
"react-dom/no-render-return-value": "error",
|
|
1206
1231
|
"react-dom/no-script-url": "warn",
|
|
1207
1232
|
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1208
1233
|
"react-dom/no-unsafe-target-blank": "warn",
|
|
1209
|
-
|
|
1234
|
+
"react-dom/no-use-form-state": "error",
|
|
1235
|
+
"react-dom/no-void-elements-with-children": "error",
|
|
1236
|
+
// recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
|
|
1237
|
+
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1238
|
+
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
|
|
1239
|
+
// recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
|
|
1210
1240
|
"react-hooks/exhaustive-deps": "warn",
|
|
1211
1241
|
"react-hooks/rules-of-hooks": "error",
|
|
1212
|
-
// react refresh
|
|
1242
|
+
// preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
|
|
1213
1243
|
"react-refresh/only-export-components": [
|
|
1214
1244
|
"warn",
|
|
1215
1245
|
{
|
|
@@ -1240,31 +1270,35 @@ async function react(options = {}) {
|
|
|
1240
1270
|
]
|
|
1241
1271
|
}
|
|
1242
1272
|
],
|
|
1243
|
-
// recommended rules from
|
|
1273
|
+
// recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
|
|
1244
1274
|
"react-web-api/no-leaked-event-listener": "warn",
|
|
1245
1275
|
"react-web-api/no-leaked-interval": "warn",
|
|
1246
1276
|
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1247
1277
|
"react-web-api/no-leaked-timeout": "warn",
|
|
1248
|
-
// recommended rules from
|
|
1249
|
-
"react/ensure-forward-ref-using-ref": "warn",
|
|
1278
|
+
// recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
|
|
1250
1279
|
"react/no-access-state-in-setstate": "error",
|
|
1251
1280
|
"react/no-array-index-key": "warn",
|
|
1252
1281
|
"react/no-children-count": "warn",
|
|
1253
1282
|
"react/no-children-for-each": "warn",
|
|
1254
1283
|
"react/no-children-map": "warn",
|
|
1255
1284
|
"react/no-children-only": "warn",
|
|
1256
|
-
"react/no-children-prop": "warn",
|
|
1257
1285
|
"react/no-children-to-array": "warn",
|
|
1258
1286
|
"react/no-clone-element": "warn",
|
|
1259
1287
|
"react/no-comment-textnodes": "warn",
|
|
1260
1288
|
"react/no-component-will-mount": "error",
|
|
1261
1289
|
"react/no-component-will-receive-props": "error",
|
|
1262
1290
|
"react/no-component-will-update": "error",
|
|
1291
|
+
"react/no-context-provider": "warn",
|
|
1263
1292
|
"react/no-create-ref": "error",
|
|
1293
|
+
"react/no-default-props": "error",
|
|
1264
1294
|
"react/no-direct-mutation-state": "error",
|
|
1265
|
-
"react/no-duplicate-
|
|
1295
|
+
"react/no-duplicate-jsx-props": "warn",
|
|
1296
|
+
"react/no-duplicate-key": "warn",
|
|
1297
|
+
"react/no-forward-ref": "warn",
|
|
1298
|
+
"react/no-implicit-key": "warn",
|
|
1266
1299
|
"react/no-missing-key": "error",
|
|
1267
|
-
"react/no-nested-
|
|
1300
|
+
"react/no-nested-component-definitions": "error",
|
|
1301
|
+
"react/no-prop-types": "error",
|
|
1268
1302
|
"react/no-redundant-should-component-update": "error",
|
|
1269
1303
|
"react/no-set-state-in-component-did-mount": "warn",
|
|
1270
1304
|
"react/no-set-state-in-component-did-update": "warn",
|
|
@@ -1273,14 +1307,13 @@ async function react(options = {}) {
|
|
|
1273
1307
|
"react/no-unsafe-component-will-mount": "warn",
|
|
1274
1308
|
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1275
1309
|
"react/no-unsafe-component-will-update": "warn",
|
|
1276
|
-
"react/no-unstable-context-value": "
|
|
1277
|
-
"react/no-unstable-default-props": "
|
|
1310
|
+
"react/no-unstable-context-value": "warn",
|
|
1311
|
+
"react/no-unstable-default-props": "warn",
|
|
1278
1312
|
"react/no-unused-class-component-members": "warn",
|
|
1279
1313
|
"react/no-unused-state": "warn",
|
|
1280
|
-
"react/no-
|
|
1281
|
-
"react/
|
|
1282
|
-
"react/
|
|
1283
|
-
"react/prefer-shorthand-fragment": "warn",
|
|
1314
|
+
"react/no-use-context": "warn",
|
|
1315
|
+
"react/no-useless-forward-ref": "warn",
|
|
1316
|
+
"react/use-jsx-vars": "warn",
|
|
1284
1317
|
// overrides
|
|
1285
1318
|
...overrides
|
|
1286
1319
|
}
|
|
@@ -1466,6 +1499,7 @@ function sortTsconfig() {
|
|
|
1466
1499
|
"useDefineForClassFields",
|
|
1467
1500
|
"emitDecoratorMetadata",
|
|
1468
1501
|
"experimentalDecorators",
|
|
1502
|
+
"libReplacement",
|
|
1469
1503
|
/* Modules */
|
|
1470
1504
|
"baseUrl",
|
|
1471
1505
|
"rootDir",
|
|
@@ -1539,6 +1573,7 @@ function sortTsconfig() {
|
|
|
1539
1573
|
"isolatedModules",
|
|
1540
1574
|
"preserveSymlinks",
|
|
1541
1575
|
"verbatimModuleSyntax",
|
|
1576
|
+
"erasableSyntaxOnly",
|
|
1542
1577
|
/* Completeness */
|
|
1543
1578
|
"skipDefaultLibCheck",
|
|
1544
1579
|
"skipLibCheck"
|
|
@@ -2180,6 +2215,10 @@ async function yaml(options = {}) {
|
|
|
2180
2215
|
"supportedArchitectures"
|
|
2181
2216
|
],
|
|
2182
2217
|
pathPattern: "^$"
|
|
2218
|
+
},
|
|
2219
|
+
{
|
|
2220
|
+
order: { type: "asc" },
|
|
2221
|
+
pathPattern: ".*"
|
|
2183
2222
|
}
|
|
2184
2223
|
]
|
|
2185
2224
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.5.
|
|
5
|
-
"packageManager": "pnpm@10.6.
|
|
4
|
+
"version": "5.5.1",
|
|
5
|
+
"packageManager": "pnpm@10.6.5",
|
|
6
6
|
"description": "LinCenYing's ESLint config",
|
|
7
7
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
8
8
|
"license": "MIT",
|
|
@@ -66,88 +66,72 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@antfu/
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@eslint
|
|
73
|
-
"@eslint
|
|
74
|
-
"@
|
|
75
|
-
"@typescript-eslint/
|
|
76
|
-
"@
|
|
77
|
-
"
|
|
78
|
-
"eslint-config-
|
|
79
|
-
"eslint-
|
|
80
|
-
"eslint-
|
|
81
|
-
"eslint-
|
|
82
|
-
"eslint-plugin-
|
|
83
|
-
"eslint-plugin-
|
|
84
|
-
"eslint-plugin-
|
|
85
|
-
"eslint-plugin-
|
|
86
|
-
"eslint-plugin-
|
|
87
|
-
"eslint-plugin-
|
|
88
|
-
"eslint-plugin-
|
|
89
|
-
"eslint-plugin-
|
|
90
|
-
"eslint-plugin-
|
|
91
|
-
"eslint-plugin-
|
|
92
|
-
"eslint-plugin-
|
|
93
|
-
"eslint-plugin-
|
|
94
|
-
"eslint-plugin-
|
|
95
|
-
"eslint-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"yaml-eslint-parser": "^1.3.0"
|
|
69
|
+
"@antfu/install-pkg": "catalog:prod",
|
|
70
|
+
"@clack/prompts": "catalog:prod",
|
|
71
|
+
"@eslint-community/eslint-plugin-eslint-comments": "catalog:prod",
|
|
72
|
+
"@eslint/markdown": "catalog:prod",
|
|
73
|
+
"@stylistic/eslint-plugin": "catalog:prod",
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "catalog:prod",
|
|
75
|
+
"@typescript-eslint/parser": "catalog:prod",
|
|
76
|
+
"@vitest/eslint-plugin": "catalog:prod",
|
|
77
|
+
"eslint-config-flat-gitignore": "catalog:prod",
|
|
78
|
+
"eslint-flat-config-utils": "catalog:prod",
|
|
79
|
+
"eslint-merge-processors": "catalog:prod",
|
|
80
|
+
"eslint-parser-plain": "catalog:prod",
|
|
81
|
+
"eslint-plugin-antfu": "catalog:prod",
|
|
82
|
+
"eslint-plugin-import-x": "catalog:prod",
|
|
83
|
+
"eslint-plugin-jsdoc": "catalog:prod",
|
|
84
|
+
"eslint-plugin-jsonc": "catalog:prod",
|
|
85
|
+
"eslint-plugin-n": "catalog:prod",
|
|
86
|
+
"eslint-plugin-no-only-tests": "catalog:prod",
|
|
87
|
+
"eslint-plugin-perfectionist": "catalog:prod",
|
|
88
|
+
"eslint-plugin-pnpm": "catalog:prod",
|
|
89
|
+
"eslint-plugin-regexp": "catalog:prod",
|
|
90
|
+
"eslint-plugin-toml": "catalog:prod",
|
|
91
|
+
"eslint-plugin-unicorn": "catalog:prod",
|
|
92
|
+
"eslint-plugin-unused-imports": "catalog:prod",
|
|
93
|
+
"eslint-plugin-vue": "catalog:prod",
|
|
94
|
+
"eslint-plugin-yml": "catalog:prod",
|
|
95
|
+
"eslint-processor-vue-blocks": "catalog:prod",
|
|
96
|
+
"globals": "catalog:prod",
|
|
97
|
+
"jsonc-eslint-parser": "catalog:prod",
|
|
98
|
+
"local-pkg": "catalog:prod",
|
|
99
|
+
"prompts": "catalog:prod",
|
|
100
|
+
"toml-eslint-parser": "catalog:prod",
|
|
101
|
+
"vue-eslint-parser": "catalog:prod",
|
|
102
|
+
"yaml-eslint-parser": "catalog:prod"
|
|
104
103
|
},
|
|
105
104
|
"devDependencies": {
|
|
106
|
-
"@antfu/ni": "
|
|
107
|
-
"@eslint-react/eslint-plugin": "
|
|
108
|
-
"@eslint-types/jsdoc": "
|
|
109
|
-
"@eslint-types/typescript-eslint": "
|
|
110
|
-
"@eslint-types/unicorn": "
|
|
111
|
-
"@eslint/config-inspector": "
|
|
105
|
+
"@antfu/ni": "catalog:dev",
|
|
106
|
+
"@eslint-react/eslint-plugin": "catalog:dev",
|
|
107
|
+
"@eslint-types/jsdoc": "catalog:dev",
|
|
108
|
+
"@eslint-types/typescript-eslint": "catalog:dev",
|
|
109
|
+
"@eslint-types/unicorn": "catalog:dev",
|
|
110
|
+
"@eslint/config-inspector": "catalog:dev",
|
|
112
111
|
"@lincy/eslint-config": "workspace:*",
|
|
113
|
-
"@prettier/plugin-xml": "
|
|
114
|
-
"@stylistic/eslint-plugin-migrate": "
|
|
115
|
-
"@types/node": "
|
|
116
|
-
"@types/react": "
|
|
117
|
-
"@unocss/eslint-plugin": "
|
|
118
|
-
"bumpp": "
|
|
119
|
-
"eslint": "
|
|
120
|
-
"eslint-plugin-format": "
|
|
121
|
-
"eslint-plugin-react-hooks": "
|
|
122
|
-
"eslint-plugin-react-refresh": "
|
|
123
|
-
"eslint-
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"simple-
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"vitest": "^3.0.8",
|
|
137
|
-
"vue": "^3.5.13"
|
|
138
|
-
},
|
|
139
|
-
"pnpm": {
|
|
140
|
-
"peerDependencyRules": {
|
|
141
|
-
"ignoreMissing": [
|
|
142
|
-
"prettier"
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
"resolutions": {
|
|
147
|
-
"@eslint-community/eslint-utils": "^4.4.1",
|
|
148
|
-
"@typescript-eslint/utils": "^8.26.0",
|
|
149
|
-
"eslint": "^9.22.0",
|
|
150
|
-
"tsx": "^4.19.3"
|
|
112
|
+
"@prettier/plugin-xml": "catalog:dev",
|
|
113
|
+
"@stylistic/eslint-plugin-migrate": "catalog:dev",
|
|
114
|
+
"@types/node": "catalog:dev",
|
|
115
|
+
"@types/react": "catalog:dev",
|
|
116
|
+
"@unocss/eslint-plugin": "catalog:dev",
|
|
117
|
+
"bumpp": "catalog:dev",
|
|
118
|
+
"eslint": "catalog:dev",
|
|
119
|
+
"eslint-plugin-format": "catalog:dev",
|
|
120
|
+
"eslint-plugin-react-hooks": "catalog:dev",
|
|
121
|
+
"eslint-plugin-react-refresh": "catalog:dev",
|
|
122
|
+
"eslint-typegen": "catalog:dev",
|
|
123
|
+
"esno": "catalog:dev",
|
|
124
|
+
"lint-staged": "catalog:dev",
|
|
125
|
+
"prettier": "catalog:dev",
|
|
126
|
+
"react": "catalog:dev",
|
|
127
|
+
"simple-git-hooks": "catalog:dev",
|
|
128
|
+
"simple-open-url": "catalog:dev",
|
|
129
|
+
"sucrase": "catalog:dev",
|
|
130
|
+
"tinyglobby": "catalog:dev",
|
|
131
|
+
"tsup": "catalog:dev",
|
|
132
|
+
"typescript": "catalog:dev",
|
|
133
|
+
"vitest": "catalog:test",
|
|
134
|
+
"vue": "catalog:dev"
|
|
151
135
|
},
|
|
152
136
|
"simple-git-hooks": {
|
|
153
137
|
"pre-commit": "npx lint-staged"
|