@vinicunca/eslint-config 2.7.0 → 2.7.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 CHANGED
@@ -86,7 +86,6 @@ __export(src_exports, {
86
86
  sortTsconfig: () => sortTsconfig,
87
87
  stylistic: () => stylistic,
88
88
  test: () => test,
89
- toArray: () => toArray,
90
89
  typescript: () => typescript,
91
90
  unicorn: () => unicorn,
92
91
  unocss: () => unocss,
@@ -281,9 +280,6 @@ var parserPlain = {
281
280
  }
282
281
  })
283
282
  };
284
- function toArray(value) {
285
- return Array.isArray(value) ? value : [value];
286
- }
287
283
 
288
284
  // src/configs/stylistic.ts
289
285
  var STR_PARENS_NEW_LINE = "parens-new-line";
@@ -1133,18 +1129,21 @@ async function react(options = {}) {
1133
1129
  } = options;
1134
1130
  const [
1135
1131
  pluginReact,
1136
- pluginReactHooks
1132
+ pluginReactHooks,
1133
+ parserTs
1137
1134
  ] = await Promise.all([
1135
+ interopDefault(import("@eslint-react/eslint-plugin")),
1138
1136
  // @ts-expect-error missing types
1139
- interopDefault(import("eslint-plugin-react")),
1140
- // @ts-expect-error missing types
1141
- interopDefault(import("eslint-plugin-react-hooks"))
1137
+ interopDefault(import("eslint-plugin-react-hooks")),
1138
+ interopDefault(import("@typescript-eslint/parser"))
1142
1139
  ]);
1140
+ const plugins = pluginReact.configs.all.plugins;
1143
1141
  return [
1144
1142
  {
1145
1143
  name: "vinicunca/react/setup",
1146
1144
  plugins: {
1147
- "react": pluginReact,
1145
+ "react": plugins["@eslint-react"],
1146
+ "react-dom": plugins["@eslint-react/dom"],
1148
1147
  "react-hooks": pluginReactHooks
1149
1148
  },
1150
1149
  settings: {
@@ -1156,11 +1155,13 @@ async function react(options = {}) {
1156
1155
  {
1157
1156
  files,
1158
1157
  languageOptions: {
1158
+ parser: parserTs,
1159
1159
  parserOptions: {
1160
1160
  ecmaFeatures: {
1161
1161
  jsx: true
1162
1162
  }
1163
- }
1163
+ },
1164
+ sourceType: "module"
1164
1165
  },
1165
1166
  name: "vinicunca/react/rules",
1166
1167
  rules: {
@@ -1533,7 +1534,7 @@ async function typescript(options = {}) {
1533
1534
  const ignoresTypeAware = options.ignoresTypeAware ?? [
1534
1535
  `${GLOB_MARKDOWN}/**`
1535
1536
  ];
1536
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1537
+ const tsconfigPath = options?.tsconfigPath ? options.tsconfigPath : void 0;
1537
1538
  const isTypeAware = !!tsconfigPath;
1538
1539
  const typeAwareRules = {
1539
1540
  "dot-notation": OFF,
@@ -2216,7 +2217,6 @@ function resolveSubOptions(options, key) {
2216
2217
  sortTsconfig,
2217
2218
  stylistic,
2218
2219
  test,
2219
- toArray,
2220
2220
  typescript,
2221
2221
  unicorn,
2222
2222
  unocss,