@vinicunca/eslint-config 2.7.0-beta.1 → 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,
@@ -96,14 +95,14 @@ __export(src_exports, {
96
95
  });
97
96
  module.exports = __toCommonJS(src_exports);
98
97
 
99
- // ../node_modules/.pnpm/@vinicunca+perkakas@1.0.2/node_modules/@vinicunca/perkakas/dist/chunk-HLL46USD.js
98
+ // ../node_modules/.pnpm/@vinicunca+perkakas@1.0.3/node_modules/@vinicunca/perkakas/dist/chunk-HLL46USD.js
100
99
  function r(e2) {
101
100
  if (typeof e2 != "object" || e2 === null) return false;
102
101
  let o = Object.getPrototypeOf(e2);
103
102
  return o === null || o === Object.prototype;
104
103
  }
105
104
 
106
- // ../node_modules/.pnpm/@vinicunca+perkakas@1.0.2/node_modules/@vinicunca/perkakas/dist/chunk-AZUJCNUP.js
105
+ // ../node_modules/.pnpm/@vinicunca+perkakas@1.0.3/node_modules/@vinicunca/perkakas/dist/chunk-AZUJCNUP.js
107
106
  function e(o) {
108
107
  return typeof o == "boolean";
109
108
  }
@@ -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,
@@ -1624,7 +1625,7 @@ async function typescript(options = {}) {
1624
1625
  "no-use-before-define": OFF,
1625
1626
  "no-useless-constructor": OFF,
1626
1627
  "ts/array-type": [ERROR, { default: "generic" }],
1627
- "ts/ban-ts-comment": [ERROR, { "ts-ignore": "allow-with-description" }],
1628
+ "ts/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
1628
1629
  "ts/consistent-type-definitions": [ERROR, "interface"],
1629
1630
  "ts/consistent-type-imports": [ERROR, { disallowTypeAnnotations: false, prefer: "type-imports" }],
1630
1631
  "ts/explicit-function-return-type": OFF,
@@ -1636,6 +1637,7 @@ async function typescript(options = {}) {
1636
1637
  "ts/no-dupe-class-members": ERROR,
1637
1638
  "ts/no-empty-function": OFF,
1638
1639
  "ts/no-empty-interface": OFF,
1640
+ "ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
1639
1641
  "ts/no-explicit-any": OFF,
1640
1642
  "ts/no-import-type-side-effects": ERROR,
1641
1643
  "ts/no-invalid-this": ERROR,
@@ -2215,7 +2217,6 @@ function resolveSubOptions(options, key) {
2215
2217
  sortTsconfig,
2216
2218
  stylistic,
2217
2219
  test,
2218
- toArray,
2219
2220
  typescript,
2220
2221
  unicorn,
2221
2222
  unocss,