@luxass/eslint-config 4.17.1 → 4.18.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.js CHANGED
@@ -1169,6 +1169,53 @@ async function perfectionist() {
1169
1169
  ];
1170
1170
  }
1171
1171
 
1172
+ // src/configs/pnpm.ts
1173
+ async function pnpm() {
1174
+ const [
1175
+ pluginPnpm,
1176
+ yamlParser,
1177
+ jsoncParser
1178
+ ] = await Promise.all([
1179
+ interop(import("eslint-plugin-pnpm")),
1180
+ interop(import("yaml-eslint-parser")),
1181
+ interop(import("jsonc-eslint-parser"))
1182
+ ]);
1183
+ return [
1184
+ {
1185
+ files: [
1186
+ "package.json",
1187
+ "**/package.json"
1188
+ ],
1189
+ languageOptions: {
1190
+ parser: jsoncParser
1191
+ },
1192
+ name: "luxass/pnpm/package-json",
1193
+ plugins: {
1194
+ pnpm: pluginPnpm
1195
+ },
1196
+ rules: {
1197
+ "pnpm/json-enforce-catalog": "error",
1198
+ "pnpm/json-prefer-workspace-settings": "error",
1199
+ "pnpm/json-valid-catalog": "error"
1200
+ }
1201
+ },
1202
+ {
1203
+ files: ["pnpm-workspace.yaml"],
1204
+ languageOptions: {
1205
+ parser: yamlParser
1206
+ },
1207
+ name: "luxass/pnpm/pnpm-workspace-yaml",
1208
+ plugins: {
1209
+ pnpm: pluginPnpm
1210
+ },
1211
+ rules: {
1212
+ "pnpm/yaml-no-duplicate-catalog-item": "error",
1213
+ "pnpm/yaml-no-unused-catalog-item": "error"
1214
+ }
1215
+ }
1216
+ ];
1217
+ }
1218
+
1172
1219
  // src/configs/react.ts
1173
1220
  import { isPackageExists as isPackageExists2 } from "local-pkg";
1174
1221
  var ReactRefreshAllowConstantExportPackages = [
@@ -1248,22 +1295,30 @@ async function react(options = {}) {
1248
1295
  },
1249
1296
  name: "luxass/react/rules",
1250
1297
  rules: {
1251
- // recommended rules from @eslint-react/dom
1252
- "react-dom/no-children-in-void-dom-elements": "warn",
1298
+ // recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
1253
1299
  "react-dom/no-dangerously-set-innerhtml": "warn",
1254
1300
  "react-dom/no-dangerously-set-innerhtml-with-children": "error",
1255
1301
  "react-dom/no-find-dom-node": "error",
1302
+ "react-dom/no-flush-sync": "error",
1303
+ "react-dom/no-hydrate": "error",
1256
1304
  "react-dom/no-missing-button-type": "warn",
1257
1305
  "react-dom/no-missing-iframe-sandbox": "warn",
1258
1306
  "react-dom/no-namespace": "error",
1307
+ "react-dom/no-render": "error",
1259
1308
  "react-dom/no-render-return-value": "error",
1260
1309
  "react-dom/no-script-url": "warn",
1261
1310
  "react-dom/no-unsafe-iframe-sandbox": "warn",
1262
1311
  "react-dom/no-unsafe-target-blank": "warn",
1263
- // recommended rules react-hooks
1312
+ "react-dom/no-use-form-state": "error",
1313
+ "react-dom/no-void-elements-with-children": "error",
1314
+ // recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
1315
+ "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1316
+ "react-hooks-extra/no-unnecessary-use-prefix": "warn",
1317
+ "react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
1318
+ // recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
1264
1319
  "react-hooks/exhaustive-deps": "warn",
1265
1320
  "react-hooks/rules-of-hooks": "error",
1266
- // react refresh
1321
+ // preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
1267
1322
  "react-refresh/only-export-components": [
1268
1323
  "warn",
1269
1324
  {
@@ -1278,7 +1333,6 @@ async function react(options = {}) {
1278
1333
  "preferredRegion",
1279
1334
  "maxDuration",
1280
1335
  "config",
1281
- "runtime",
1282
1336
  "generateStaticParams",
1283
1337
  "metadata",
1284
1338
  "generateMetadata",
@@ -1295,13 +1349,12 @@ async function react(options = {}) {
1295
1349
  ]
1296
1350
  }
1297
1351
  ],
1298
- // recommended rules from @eslint-react/web-api
1352
+ // recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
1299
1353
  "react-web-api/no-leaked-event-listener": "warn",
1300
1354
  "react-web-api/no-leaked-interval": "warn",
1301
1355
  "react-web-api/no-leaked-resize-observer": "warn",
1302
1356
  "react-web-api/no-leaked-timeout": "warn",
1303
- // recommended rules from @eslint-react
1304
- "react/ensure-forward-ref-using-ref": "warn",
1357
+ // recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
1305
1358
  "react/jsx-no-duplicate-props": "warn",
1306
1359
  "react/jsx-uses-vars": "warn",
1307
1360
  "react/no-access-state-in-setstate": "error",
@@ -1320,11 +1373,11 @@ async function react(options = {}) {
1320
1373
  "react/no-create-ref": "error",
1321
1374
  "react/no-default-props": "error",
1322
1375
  "react/no-direct-mutation-state": "error",
1323
- "react/no-duplicate-key": "error",
1376
+ "react/no-duplicate-key": "warn",
1324
1377
  "react/no-forward-ref": "warn",
1325
1378
  "react/no-implicit-key": "warn",
1326
1379
  "react/no-missing-key": "error",
1327
- "react/no-nested-components": "error",
1380
+ "react/no-nested-component-definitions": "error",
1328
1381
  "react/no-prop-types": "error",
1329
1382
  "react/no-redundant-should-component-update": "error",
1330
1383
  "react/no-set-state-in-component-did-mount": "warn",
@@ -1338,9 +1391,8 @@ async function react(options = {}) {
1338
1391
  "react/no-unstable-default-props": "warn",
1339
1392
  "react/no-unused-class-component-members": "warn",
1340
1393
  "react/no-unused-state": "warn",
1341
- "react/prefer-destructuring-assignment": "warn",
1342
- "react/prefer-shorthand-boolean": "warn",
1343
- "react/prefer-shorthand-fragment": "warn",
1394
+ "react/no-use-context": "warn",
1395
+ "react/no-useless-forward-ref": "warn",
1344
1396
  // overrides
1345
1397
  ...overrides
1346
1398
  }
@@ -1348,7 +1400,7 @@ async function react(options = {}) {
1348
1400
  ...isTypeAware ? [{
1349
1401
  files: filesTypeAware,
1350
1402
  ignores: ignoresTypeAware,
1351
- name: "antfu/react/type-aware-rules",
1403
+ name: "luxass/react/type-aware-rules",
1352
1404
  rules: {
1353
1405
  ...typeAwareRules
1354
1406
  }
@@ -1525,6 +1577,7 @@ function sortTsconfig() {
1525
1577
  "useDefineForClassFields",
1526
1578
  "emitDecoratorMetadata",
1527
1579
  "experimentalDecorators",
1580
+ "libReplacement",
1528
1581
  /* Modules */
1529
1582
  "baseUrl",
1530
1583
  "rootDir",
@@ -1599,6 +1652,7 @@ function sortTsconfig() {
1599
1652
  "isolatedModules",
1600
1653
  "preserveSymlinks",
1601
1654
  "verbatimModuleSyntax",
1655
+ "erasableSyntaxOnly",
1602
1656
  /* Completeness */
1603
1657
  "skipDefaultLibCheck",
1604
1658
  "skipLibCheck"
@@ -2365,6 +2419,7 @@ function luxass(options = {}, ...userConfigs) {
2365
2419
  exts = [],
2366
2420
  gitignore: enableGitignore = true,
2367
2421
  jsx: enableJsx = true,
2422
+ pnpm: enableCatalogs = false,
2368
2423
  react: enableReact = false,
2369
2424
  regexp: enableRegexp = true,
2370
2425
  tailwindcss: enableTailwindCSS = false,
@@ -2499,6 +2554,11 @@ function luxass(options = {}, ...userConfigs) {
2499
2554
  sortTsconfig()
2500
2555
  );
2501
2556
  }
2557
+ if (enableCatalogs) {
2558
+ configs2.push(
2559
+ pnpm()
2560
+ );
2561
+ }
2502
2562
  if (options.yaml ?? true) {
2503
2563
  configs2.push(yaml({
2504
2564
  overrides: getOverrides(options, "yaml"),
@@ -2606,6 +2666,7 @@ export {
2606
2666
  node,
2607
2667
  parserPlain,
2608
2668
  perfectionist,
2669
+ pnpm,
2609
2670
  react,
2610
2671
  regexp,
2611
2672
  renamePluginInConfigs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "4.17.1",
3
+ "version": "4.18.1",
4
4
  "description": "ESLint config for @luxass",
5
5
  "type": "module",
6
6
  "author": {
@@ -85,21 +85,22 @@
85
85
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
86
86
  "@eslint/markdown": "^6.3.0",
87
87
  "@stylistic/eslint-plugin": "^4.2.0",
88
- "@typescript-eslint/eslint-plugin": "^8.26.1",
89
- "@typescript-eslint/parser": "^8.26.1",
90
- "@vitest/eslint-plugin": "^1.1.37",
88
+ "@typescript-eslint/eslint-plugin": "^8.28.0",
89
+ "@typescript-eslint/parser": "^8.28.0",
90
+ "@vitest/eslint-plugin": "^1.1.38",
91
91
  "eslint-config-flat-gitignore": "^2.1.0",
92
92
  "eslint-flat-config-utils": "^2.0.1",
93
93
  "eslint-merge-processors": "^2.0.0",
94
94
  "eslint-plugin-antfu": "^3.1.1",
95
- "eslint-plugin-import-x": "^4.6.1",
96
- "eslint-plugin-jsdoc": "^50.6.6",
97
- "eslint-plugin-jsonc": "^2.19.1",
98
- "eslint-plugin-n": "^17.16.2",
95
+ "eslint-plugin-import-x": "^4.9.4",
96
+ "eslint-plugin-jsdoc": "^50.6.9",
97
+ "eslint-plugin-jsonc": "^2.20.0",
98
+ "eslint-plugin-n": "^17.17.0",
99
99
  "eslint-plugin-perfectionist": "^4.10.1",
100
+ "eslint-plugin-pnpm": "^0.3.1",
100
101
  "eslint-plugin-regexp": "^2.7.0",
101
102
  "eslint-plugin-toml": "^0.12.0",
102
- "eslint-plugin-unicorn": "^57.0.0",
103
+ "eslint-plugin-unicorn": "^58.0.0",
103
104
  "eslint-plugin-unused-imports": "^4.1.4",
104
105
  "eslint-plugin-vue": "^10.0.0",
105
106
  "eslint-plugin-yml": "^1.17.0",
@@ -113,20 +114,20 @@
113
114
  "yaml-eslint-parser": "^1.3.0"
114
115
  },
115
116
  "devDependencies": {
116
- "@eslint-react/eslint-plugin": "^1.32.0",
117
+ "@eslint-react/eslint-plugin": "^1.38.4",
117
118
  "@eslint/config-inspector": "^1.0.2",
118
119
  "@stylistic/eslint-plugin-migrate": "^4.2.0",
119
120
  "@types/node": "^22.13.10",
120
- "@typescript-eslint/rule-tester": "^8.26.1",
121
- "@unocss/eslint-plugin": "^66.1.0-beta.3",
122
- "astro-eslint-parser": "^1.2.1",
123
- "eslint": "^9.22.0",
121
+ "@typescript-eslint/rule-tester": "^8.28.0",
122
+ "@unocss/eslint-plugin": "^66.1.0-beta.7",
123
+ "astro-eslint-parser": "^1.2.2",
124
+ "eslint": "^9.23.0",
124
125
  "eslint-plugin-astro": "^1.3.1",
125
126
  "eslint-plugin-format": "^1.0.1",
126
127
  "eslint-plugin-react-hooks": "^5.2.0",
127
128
  "eslint-plugin-react-refresh": "^0.4.19",
128
129
  "eslint-plugin-tailwindcss": "^3.18.0",
129
- "eslint-typegen": "^2.0.0",
130
+ "eslint-typegen": "^2.1.0",
130
131
  "jiti": "^2.4.2",
131
132
  "prettier-plugin-astro": "^0.14.1",
132
133
  "tailwindcss": "3.4.17",
@@ -134,7 +135,7 @@
134
135
  "tsx": "^4.19.3",
135
136
  "typescript": "^5.8.2",
136
137
  "unocss": "^66.0.0",
137
- "vitest": "^3.0.8",
138
+ "vitest": "^3.0.9",
138
139
  "vue": "^3.5.13"
139
140
  },
140
141
  "scripts": {