@lincy/eslint-config 5.5.0 → 5.5.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/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: await interopDefault(import("jsonc-eslint-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/rules",
1128
+ name: "eslint/pnpm/pnpm-workspace-yaml",
1105
1129
  plugins: {
1106
- pnpm: await interopDefault(import("eslint-plugin-pnpm"))
1130
+ pnpm: pluginPnpm
1107
1131
  },
1108
1132
  rules: {
1109
- "pnpm/enforce-catalog": "error",
1110
- "pnpm/prefer-workspace-settings": "error",
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 @eslint-react/dom
1198
- "react-dom/no-children-in-void-dom-elements": "warn",
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
- // recommended rules react-hooks
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 @eslint-react/web-api
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 @eslint-react
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-key": "error",
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-components": "warn",
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": "error",
1277
- "react/no-unstable-default-props": "error",
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-useless-fragment": "warn",
1281
- "react/prefer-destructuring-assignment": "warn",
1282
- "react/prefer-shorthand-boolean": "warn",
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,7 @@
1
1
  {
2
2
  "name": "@lincy/eslint-config",
3
3
  "type": "module",
4
- "version": "5.5.0",
5
- "packageManager": "pnpm@10.6.1",
4
+ "version": "5.5.2",
6
5
  "description": "LinCenYing's ESLint config",
7
6
  "author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
8
7
  "license": "MIT",
@@ -22,20 +21,6 @@
22
21
  "files": [
23
22
  "dist"
24
23
  ],
25
- "scripts": {
26
- "build": "nr typegen && tsup --format esm,cjs --clean --dts",
27
- "stub": "tsup src/index.ts --format esm",
28
- "watch": "tsup --format esm,cjs --watch",
29
- "postpublish": "simple-open-url https://npmmirror.com/package/@lincy/eslint-config",
30
- "prepublishOnly": "nr build",
31
- "release": "bumpp && npm publish -r --access public",
32
- "test": "vitest",
33
- "typegen": "tsx scripts/typegen.ts",
34
- "lint": "pnpm run stub && eslint .",
35
- "lint:fix": "eslint . --fix",
36
- "lint:ts": "tsc --noEmit",
37
- "prepare": "npx simple-git-hooks"
38
- },
39
24
  "peerDependencies": {
40
25
  "@eslint-react/eslint-plugin": "^1.15.0",
41
26
  "@prettier/plugin-xml": "^3.4.1",
@@ -66,27 +51,26 @@
66
51
  }
67
52
  },
68
53
  "dependencies": {
69
- "@antfu/eslint-define-config": "1.23.0-2",
70
54
  "@antfu/install-pkg": "^1.0.0",
71
55
  "@clack/prompts": "^0.10.0",
72
56
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
73
57
  "@eslint/markdown": "^6.3.0",
74
58
  "@stylistic/eslint-plugin": "4.0.0-beta.1",
75
- "@typescript-eslint/eslint-plugin": "^8.26.0",
76
- "@typescript-eslint/parser": "^8.26.0",
77
- "@vitest/eslint-plugin": "^1.1.36",
59
+ "@typescript-eslint/eslint-plugin": "^8.27.0",
60
+ "@typescript-eslint/parser": "^8.27.0",
61
+ "@vitest/eslint-plugin": "^1.1.38",
78
62
  "eslint-config-flat-gitignore": "^2.1.0",
79
63
  "eslint-flat-config-utils": "^2.0.1",
80
64
  "eslint-merge-processors": "^2.0.0",
81
65
  "eslint-parser-plain": "^0.1.1",
82
66
  "eslint-plugin-antfu": "^3.1.1",
83
- "eslint-plugin-import-x": "^4.6.1",
84
- "eslint-plugin-jsdoc": "^50.6.3",
67
+ "eslint-plugin-import-x": "^4.9.1",
68
+ "eslint-plugin-jsdoc": "^50.6.9",
85
69
  "eslint-plugin-jsonc": "^2.19.1",
86
70
  "eslint-plugin-n": "^17.16.2",
87
71
  "eslint-plugin-no-only-tests": "^3.3.0",
88
72
  "eslint-plugin-perfectionist": "^4.10.1",
89
- "eslint-plugin-pnpm": "^0.1.2",
73
+ "eslint-plugin-pnpm": "^0.3.1",
90
74
  "eslint-plugin-regexp": "^2.7.0",
91
75
  "eslint-plugin-toml": "^0.12.0",
92
76
  "eslint-plugin-unicorn": "56.0.1",
@@ -103,51 +87,36 @@
103
87
  "yaml-eslint-parser": "^1.3.0"
104
88
  },
105
89
  "devDependencies": {
106
- "@antfu/ni": "^23.3.1",
107
- "@eslint-react/eslint-plugin": "^1.31.0",
90
+ "@antfu/ni": "^24.3.0",
91
+ "@eslint-react/eslint-plugin": "^1.37.3",
108
92
  "@eslint-types/jsdoc": "48.2.2",
109
93
  "@eslint-types/typescript-eslint": "^7.5.0",
110
94
  "@eslint-types/unicorn": "^52.0.0",
111
95
  "@eslint/config-inspector": "^1.0.2",
112
- "@lincy/eslint-config": "workspace:*",
113
96
  "@prettier/plugin-xml": "^3.4.1",
114
97
  "@stylistic/eslint-plugin-migrate": "^4.2.0",
115
- "@types/node": "^22.13.10",
116
- "@types/react": "^19.0.10",
117
- "@unocss/eslint-plugin": "^66.1.0-beta.3",
118
- "bumpp": "^10.0.3",
119
- "eslint": "^9.22.0",
98
+ "@types/node": "^22.13.11",
99
+ "@types/react": "^19.0.12",
100
+ "@unocss/eslint-plugin": "^66.1.0-beta.6",
101
+ "bumpp": "^10.1.0",
102
+ "eslint": "^9.23.0",
120
103
  "eslint-plugin-format": "^1.0.1",
121
104
  "eslint-plugin-react-hooks": "^5.2.0",
122
105
  "eslint-plugin-react-refresh": "^0.4.19",
123
- "eslint-ts-patch": "9.8.0-1",
124
- "eslint-typegen": "^2.0.0",
106
+ "eslint-typegen": "^2.1.0",
125
107
  "esno": "^4.8.0",
126
- "lint-staged": "^15.4.3",
108
+ "lint-staged": "^15.5.0",
127
109
  "prettier": "^3.5.3",
128
110
  "react": "^19.0.0",
129
- "simple-git-hooks": "^2.11.1",
111
+ "simple-git-hooks": "^2.12.1",
130
112
  "simple-open-url": "^3.0.1",
131
113
  "sucrase": "^3.35.0",
132
114
  "tinyglobby": "^0.2.12",
133
115
  "tsup": "^8.4.0",
134
116
  "typescript": "^5.8.2",
135
- "unbuild": "^3.5.0",
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"
117
+ "vitest": "^3.0.9",
118
+ "vue": "^3.5.13",
119
+ "@lincy/eslint-config": "5.5.2"
151
120
  },
152
121
  "simple-git-hooks": {
153
122
  "pre-commit": "npx lint-staged"
@@ -157,5 +126,16 @@
157
126
  },
158
127
  "publishConfig": {
159
128
  "registry": "https://registry.npmjs.org/"
129
+ },
130
+ "scripts": {
131
+ "build": "nr typegen && tsup --format esm,cjs --clean --dts",
132
+ "stub": "tsup src/index.ts --format esm",
133
+ "watch": "tsup --format esm,cjs --watch",
134
+ "release": "bumpp && pnpm publish -r --access public",
135
+ "test": "vitest",
136
+ "typegen": "tsx scripts/typegen.ts",
137
+ "lint": "pnpm run stub && eslint .",
138
+ "lint:fix": "eslint . --fix",
139
+ "lint:ts": "tsc --noEmit"
160
140
  }
161
- }
141
+ }