@luxass/eslint-config 5.3.2 → 6.0.0

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
@@ -627,7 +627,7 @@ async function javascript(options = {}) {
627
627
  return [
628
628
  {
629
629
  languageOptions: {
630
- ecmaVersion: 2022,
630
+ ecmaVersion: "latest",
631
631
  globals: {
632
632
  ...globals.browser,
633
633
  ...globals.es2021,
@@ -638,7 +638,7 @@ async function javascript(options = {}) {
638
638
  },
639
639
  parserOptions: {
640
640
  ecmaFeatures: { jsx: true },
641
- ecmaVersion: 2022,
641
+ ecmaVersion: "latest",
642
642
  sourceType: "module"
643
643
  },
644
644
  sourceType: "module"
@@ -1206,10 +1206,7 @@ async function react(options = {}) {
1206
1206
  "react-dom/no-use-form-state": "error",
1207
1207
  "react-dom/no-void-elements-with-children": "error",
1208
1208
  "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1209
- "react-hooks-extra/no-unnecessary-use-prefix": "warn",
1210
- "react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
1211
- "react-hooks/exhaustive-deps": "warn",
1212
- "react-hooks/rules-of-hooks": "error",
1209
+ ...pluginReactHooks.configs.recommended.rules,
1213
1210
  "react-refresh/only-export-components": ["warn", {
1214
1211
  allowConstantExport: isAllowConstantExport,
1215
1212
  allowExportNames: [...isUsingNext ? [
@@ -1231,13 +1228,18 @@ async function react(options = {}) {
1231
1228
  "links",
1232
1229
  "headers",
1233
1230
  "loader",
1234
- "action"
1231
+ "action",
1232
+ "clientLoader",
1233
+ "clientAction",
1234
+ "handle",
1235
+ "shouldRevalidate"
1235
1236
  ] : []]
1236
1237
  }],
1237
1238
  "react-web-api/no-leaked-event-listener": "warn",
1238
1239
  "react-web-api/no-leaked-interval": "warn",
1239
1240
  "react-web-api/no-leaked-resize-observer": "warn",
1240
1241
  "react-web-api/no-leaked-timeout": "warn",
1242
+ "react/jsx-no-comment-textnodes": "warn",
1241
1243
  "react/jsx-no-duplicate-props": "warn",
1242
1244
  "react/jsx-uses-vars": "warn",
1243
1245
  "react/no-access-state-in-setstate": "error",
@@ -1248,7 +1250,6 @@ async function react(options = {}) {
1248
1250
  "react/no-children-only": "warn",
1249
1251
  "react/no-children-to-array": "warn",
1250
1252
  "react/no-clone-element": "warn",
1251
- "react/no-comment-textnodes": "warn",
1252
1253
  "react/no-component-will-mount": "error",
1253
1254
  "react/no-component-will-receive-props": "error",
1254
1255
  "react/no-component-will-update": "error",
@@ -1267,6 +1268,7 @@ async function react(options = {}) {
1267
1268
  "react/no-set-state-in-component-did-update": "warn",
1268
1269
  "react/no-set-state-in-component-will-update": "warn",
1269
1270
  "react/no-string-refs": "error",
1271
+ "react/no-unnecessary-use-prefix": "warn",
1270
1272
  "react/no-unsafe-component-will-mount": "warn",
1271
1273
  "react/no-unsafe-component-will-receive-props": "warn",
1272
1274
  "react/no-unsafe-component-will-update": "warn",
@@ -1276,6 +1278,7 @@ async function react(options = {}) {
1276
1278
  "react/no-unused-state": "warn",
1277
1279
  "react/no-use-context": "warn",
1278
1280
  "react/no-useless-forward-ref": "warn",
1281
+ "react/prefer-use-state-lazy-initialization": "warn",
1279
1282
  ...overrides
1280
1283
  }
1281
1284
  },
@@ -1384,7 +1387,15 @@ function sortPackageJson() {
1384
1387
  },
1385
1388
  {
1386
1389
  order: { type: "asc" },
1387
- pathPattern: "^pnpm.overrides$"
1390
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
1391
+ },
1392
+ {
1393
+ order: { type: "asc" },
1394
+ pathPattern: "^workspaces\\.catalog$"
1395
+ },
1396
+ {
1397
+ order: { type: "asc" },
1398
+ pathPattern: "^workspaces\\.catalogs\\.[^.]+$"
1388
1399
  },
1389
1400
  {
1390
1401
  order: [
@@ -1636,7 +1647,7 @@ async function toml(options = {}) {
1636
1647
  //#endregion
1637
1648
  //#region src/configs/typescript.ts
1638
1649
  async function typescript(options = {}) {
1639
- const { exts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, type = "app" } = options ?? {};
1650
+ const { erasableOnly = false, exts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, type = "app" } = options ?? {};
1640
1651
  const files = options.files ?? [
1641
1652
  GLOB_TS,
1642
1653
  GLOB_TSX,
@@ -1769,6 +1780,16 @@ async function typescript(options = {}) {
1769
1780
  ...typeAwareRules,
1770
1781
  ...overridesTypeAware
1771
1782
  }
1783
+ }] : [],
1784
+ ...erasableOnly ? [{
1785
+ name: "luxas/typescript/erasable-syntax-only",
1786
+ plugins: { "erasable-syntax-only": await interop(import("./lib-CANFQzGY.js")) },
1787
+ rules: {
1788
+ "erasable-syntax-only/enums": "error",
1789
+ "erasable-syntax-only/import-aliases": "error",
1790
+ "erasable-syntax-only/namespaces": "error",
1791
+ "erasable-syntax-only/parameter-properties": "error"
1792
+ }
1772
1793
  }] : []
1773
1794
  ];
1774
1795
  }