@lincy/eslint-config 5.9.0 → 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
@@ -1061,43 +1061,7 @@ async function react(options = {}) {
1061
1061
  "react-dom/no-unsafe-target-blank": "warn",
1062
1062
  "react-dom/no-use-form-state": "error",
1063
1063
  "react-dom/no-void-elements-with-children": "error",
1064
- "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1065
- "react-hooks-extra/no-unnecessary-use-prefix": "warn",
1066
- "react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
1067
- "react-hooks/exhaustive-deps": "warn",
1068
- "react-hooks/rules-of-hooks": "error",
1069
- "react-refresh/only-export-components": ["warn", {
1070
- allowConstantExport: isAllowConstantExport,
1071
- allowExportNames: [...isUsingNext ? [
1072
- "dynamic",
1073
- "dynamicParams",
1074
- "revalidate",
1075
- "fetchCache",
1076
- "runtime",
1077
- "preferredRegion",
1078
- "maxDuration",
1079
- "config",
1080
- "generateStaticParams",
1081
- "metadata",
1082
- "generateMetadata",
1083
- "viewport",
1084
- "generateViewport"
1085
- ] : [], ...isUsingRemix || isUsingReactRouter ? [
1086
- "meta",
1087
- "links",
1088
- "headers",
1089
- "loader",
1090
- "action",
1091
- "clientLoader",
1092
- "clientAction",
1093
- "handle",
1094
- "shouldRevalidate"
1095
- ] : []]
1096
- }],
1097
- "react-web-api/no-leaked-event-listener": "warn",
1098
- "react-web-api/no-leaked-interval": "warn",
1099
- "react-web-api/no-leaked-resize-observer": "warn",
1100
- "react-web-api/no-leaked-timeout": "warn",
1064
+ "react/jsx-no-comment-textnodes": "warn",
1101
1065
  "react/jsx-no-duplicate-props": "warn",
1102
1066
  "react/jsx-uses-vars": "warn",
1103
1067
  "react/no-access-state-in-setstate": "error",
@@ -1108,7 +1072,6 @@ async function react(options = {}) {
1108
1072
  "react/no-children-only": "warn",
1109
1073
  "react/no-children-to-array": "warn",
1110
1074
  "react/no-clone-element": "warn",
1111
- "react/no-comment-textnodes": "warn",
1112
1075
  "react/no-component-will-mount": "error",
1113
1076
  "react/no-component-will-receive-props": "error",
1114
1077
  "react/no-component-will-update": "error",
@@ -1116,7 +1079,6 @@ async function react(options = {}) {
1116
1079
  "react/no-create-ref": "error",
1117
1080
  "react/no-default-props": "error",
1118
1081
  "react/no-direct-mutation-state": "error",
1119
- "react/no-duplicate-jsx-props": "warn",
1120
1082
  "react/no-duplicate-key": "warn",
1121
1083
  "react/no-forward-ref": "warn",
1122
1084
  "react/no-implicit-key": "warn",
@@ -1128,6 +1090,7 @@ async function react(options = {}) {
1128
1090
  "react/no-set-state-in-component-did-update": "warn",
1129
1091
  "react/no-set-state-in-component-will-update": "warn",
1130
1092
  "react/no-string-refs": "error",
1093
+ "react/no-unnecessary-use-prefix": "warn",
1131
1094
  "react/no-unsafe-component-will-mount": "warn",
1132
1095
  "react/no-unsafe-component-will-receive-props": "warn",
1133
1096
  "react/no-unsafe-component-will-update": "warn",
@@ -1137,7 +1100,41 @@ async function react(options = {}) {
1137
1100
  "react/no-unused-state": "warn",
1138
1101
  "react/no-use-context": "warn",
1139
1102
  "react/no-useless-forward-ref": "warn",
1140
- "react/use-jsx-vars": "warn",
1103
+ "react/prefer-use-state-lazy-initialization": "warn",
1104
+ ...pluginReactHooks.configs.recommended.rules,
1105
+ "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1106
+ "react-refresh/only-export-components": ["warn", {
1107
+ allowConstantExport: isAllowConstantExport,
1108
+ allowExportNames: [...isUsingNext ? [
1109
+ "dynamic",
1110
+ "dynamicParams",
1111
+ "revalidate",
1112
+ "fetchCache",
1113
+ "runtime",
1114
+ "preferredRegion",
1115
+ "maxDuration",
1116
+ "config",
1117
+ "generateStaticParams",
1118
+ "metadata",
1119
+ "generateMetadata",
1120
+ "viewport",
1121
+ "generateViewport"
1122
+ ] : [], ...isUsingRemix || isUsingReactRouter ? [
1123
+ "meta",
1124
+ "links",
1125
+ "headers",
1126
+ "loader",
1127
+ "action",
1128
+ "clientLoader",
1129
+ "clientAction",
1130
+ "handle",
1131
+ "shouldRevalidate"
1132
+ ] : []]
1133
+ }],
1134
+ "react-web-api/no-leaked-event-listener": "warn",
1135
+ "react-web-api/no-leaked-interval": "warn",
1136
+ "react-web-api/no-leaked-resize-observer": "warn",
1137
+ "react-web-api/no-leaked-timeout": "warn",
1141
1138
  ...overrides
1142
1139
  }
1143
1140
  },
@@ -1481,7 +1478,7 @@ async function toml(options = {}) {
1481
1478
  //#endregion
1482
1479
  //#region src/configs/typescript.ts
1483
1480
  async function typescript(options = {}) {
1484
- const { componentExts = [], overrides = {}, parserOptions = {}, type = "app" } = options;
1481
+ const { componentExts = [], erasableOnly = false, overrides = {}, parserOptions = {}, type = "app" } = options;
1485
1482
  const files = options.files ?? [GLOB_SRC, ...componentExts.map((ext) => `**/*.${ext}`)];
1486
1483
  const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`];
1487
1484
  const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
@@ -1614,6 +1611,16 @@ async function typescript(options = {}) {
1614
1611
  ...typeAwareRules,
1615
1612
  ...overrides
1616
1613
  }
1614
+ }] : [],
1615
+ ...erasableOnly ? [{
1616
+ name: "eslint/typescript/erasable-syntax-only",
1617
+ plugins: { "erasable-syntax-only": await interopDefault(import("./lib-DMY_mkdT.js")) },
1618
+ rules: {
1619
+ "erasable-syntax-only/enums": "error",
1620
+ "erasable-syntax-only/import-aliases": "error",
1621
+ "erasable-syntax-only/namespaces": "error",
1622
+ "erasable-syntax-only/parameter-properties": "error"
1623
+ }
1617
1624
  }] : []
1618
1625
  ];
1619
1626
  }