@vinicunca/eslint-config 2.13.0 → 2.14.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.cjs CHANGED
@@ -112,7 +112,7 @@ __export(src_exports, {
112
112
  });
113
113
  module.exports = __toCommonJS(src_exports);
114
114
 
115
- // ../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.0_postcss@8.4.49_tsx@4.19.0_typescript@5.6.3_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
115
+ // ../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.1_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
116
116
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
117
117
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
118
118
 
@@ -1349,10 +1349,10 @@ async function perfectionist() {
1349
1349
  {
1350
1350
  groups: [
1351
1351
  "type",
1352
- ["parent-type", "sibling-type", "index-type"],
1352
+ ["parent-type", "sibling-type", "index-type", "internal-type"],
1353
1353
  "builtin",
1354
1354
  "external",
1355
- ["internal", "internal-type"],
1355
+ "internal",
1356
1356
  ["parent", "sibling", "index"],
1357
1357
  "side-effect",
1358
1358
  "object",
@@ -1394,20 +1394,26 @@ var NextJsPackages = [
1394
1394
  async function react(options = {}) {
1395
1395
  const {
1396
1396
  files = [GLOB_SRC],
1397
- overrides = {}
1397
+ filesTypeAware = [GLOB_TS, GLOB_TSX],
1398
+ ignoresTypeAware = [
1399
+ `${GLOB_MARKDOWN}/**`,
1400
+ GLOB_ASTRO_TS
1401
+ ],
1402
+ overrides = {},
1403
+ tsconfigPath
1398
1404
  } = options;
1399
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1400
1405
  const isTypeAware = !!tsconfigPath;
1406
+ const typeAwareRules = {
1407
+ "react/no-leaked-conditional-rendering": "warn"
1408
+ };
1401
1409
  const [
1402
1410
  pluginReact,
1403
1411
  pluginReactHooks,
1404
- pluginReactRefresh,
1405
- parserTs
1412
+ pluginReactRefresh
1406
1413
  ] = await Promise.all([
1407
1414
  interopDefault(import("@eslint-react/eslint-plugin")),
1408
1415
  interopDefault(import("eslint-plugin-react-hooks")),
1409
- interopDefault(import("eslint-plugin-react-refresh")),
1410
- interopDefault(import("@typescript-eslint/parser"))
1416
+ interopDefault(import("eslint-plugin-react-refresh"))
1411
1417
  ]);
1412
1418
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => (0, import_local_pkg3.isPackageExists)(i));
1413
1419
  const isUsingRemix = RemixPackages.some((i) => (0, import_local_pkg3.isPackageExists)(i));
@@ -1428,12 +1434,10 @@ async function react(options = {}) {
1428
1434
  {
1429
1435
  files,
1430
1436
  languageOptions: {
1431
- parser: parserTs,
1432
1437
  parserOptions: {
1433
1438
  ecmaFeatures: {
1434
1439
  jsx: true
1435
- },
1436
- ...isTypeAware ? { project: tsconfigPath } : {}
1440
+ }
1437
1441
  },
1438
1442
  sourceType: "module"
1439
1443
  },
@@ -1515,13 +1519,18 @@ async function react(options = {}) {
1515
1519
  "react/prefer-destructuring-assignment": WARN,
1516
1520
  "react/prefer-shorthand-boolean": WARN,
1517
1521
  "react/prefer-shorthand-fragment": WARN,
1518
- ...isTypeAware ? {
1519
- "react/no-leaked-conditional-rendering": WARN
1520
- } : {},
1521
1522
  // overrides
1522
1523
  ...overrides
1523
1524
  }
1524
- }
1525
+ },
1526
+ ...isTypeAware ? [{
1527
+ files: filesTypeAware,
1528
+ ignores: ignoresTypeAware,
1529
+ name: "antfu/react/type-aware-rules",
1530
+ rules: {
1531
+ ...typeAwareRules
1532
+ }
1533
+ }] : []
1525
1534
  ];
1526
1535
  }
1527
1536
 
@@ -2543,8 +2552,7 @@ async function yaml(options = {}) {
2543
2552
  "yaml/indent": [ERROR, indent === "tab" ? 2 : indent],
2544
2553
  "yaml/key-spacing": ERROR,
2545
2554
  "yaml/no-tab-indent": ERROR,
2546
- // quotes only supports single and double quotes but in options we have backtick as well
2547
- "yaml/quotes": [ERROR, { avoidEscape: false, prefer: quotes }],
2555
+ "yaml/quotes": [ERROR, { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
2548
2556
  "yaml/spaced-comment": ERROR
2549
2557
  } : {},
2550
2558
  ...overrides
@@ -2694,6 +2702,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2694
2702
  }
2695
2703
  if (enableReact) {
2696
2704
  configs2.push(react({
2705
+ ...typescriptOptions,
2697
2706
  overrides: getOverrides(options, "react"),
2698
2707
  tsconfigPath
2699
2708
  }));
@@ -2786,15 +2795,15 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2786
2795
  }
2787
2796
  return composer;
2788
2797
  }
2789
- function resolveSubOptions(options, key) {
2790
- return e(options[key]) ? {} : options[key] || {};
2791
- }
2792
2798
  function getOverrides(options, key) {
2793
2799
  const sub = resolveSubOptions(options, key);
2794
2800
  return {
2795
2801
  ..."overrides" in sub ? sub.overrides : {}
2796
2802
  };
2797
2803
  }
2804
+ function resolveSubOptions(options, key) {
2805
+ return e(options[key]) ? {} : options[key] || {};
2806
+ }
2798
2807
  // Annotate the CommonJS export names for ESM import in node:
2799
2808
  0 && (module.exports = {
2800
2809
  GLOB_ALL_SRC,
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Linter } from 'eslint';
2
- import { FlatConfigComposer } from 'eslint-flat-config-utils';
3
2
  import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
4
3
  import { ParserOptions } from '@typescript-eslint/parser';
5
4
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
6
5
  import { Options } from 'eslint-processor-vue-blocks';
6
+ import { FlatConfigComposer } from 'eslint-flat-config-utils';
7
7
  export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
8
8
  export { default as pluginAntfu } from 'eslint-plugin-antfu';
9
9
  import * as eslintPluginImportX from 'eslint-plugin-import-x';
@@ -1634,7 +1634,7 @@ interface RuleOptions {
1634
1634
  */
1635
1635
  'no-class-assign'?: Linter.RuleEntry<[]>
1636
1636
  /**
1637
- * Disallow comparing against -0
1637
+ * Disallow comparing against `-0`
1638
1638
  * @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
1639
1639
  */
1640
1640
  'no-compare-neg-zero'?: Linter.RuleEntry<[]>
@@ -7090,7 +7090,7 @@ interface RuleOptions {
7090
7090
  * enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"`
7091
7091
  * @see https://eslint.vuejs.org/rules/no-duplicate-attr-inheritance.html
7092
7092
  */
7093
- 'vue/no-duplicate-attr-inheritance'?: Linter.RuleEntry<[]>
7093
+ 'vue/no-duplicate-attr-inheritance'?: Linter.RuleEntry<VueNoDuplicateAttrInheritance>
7094
7094
  /**
7095
7095
  * disallow duplication of attributes
7096
7096
  * @see https://eslint.vuejs.org/rules/no-duplicate-attributes.html
@@ -7535,7 +7535,7 @@ interface RuleOptions {
7535
7535
  */
7536
7536
  'vue/prefer-true-attribute-shorthand'?: Linter.RuleEntry<VuePreferTrueAttributeShorthand>
7537
7537
  /**
7538
- * require using `useTemplateRef` instead of `ref` for template refs
7538
+ * require using `useTemplateRef` instead of `ref`/`shallowRef` for template refs
7539
7539
  * @see https://eslint.vuejs.org/rules/prefer-use-template-ref.html
7540
7540
  */
7541
7541
  'vue/prefer-use-template-ref'?: Linter.RuleEntry<[]>
@@ -7649,6 +7649,11 @@ interface RuleOptions {
7649
7649
  * @see https://eslint.vuejs.org/rules/require-valid-default-prop.html
7650
7650
  */
7651
7651
  'vue/require-valid-default-prop'?: Linter.RuleEntry<[]>
7652
+ /**
7653
+ * enforce using only specific component names
7654
+ * @see https://eslint.vuejs.org/rules/restricted-component-names.html
7655
+ */
7656
+ 'vue/restricted-component-names'?: Linter.RuleEntry<VueRestrictedComponentNames>
7652
7657
  /**
7653
7658
  * enforce that a return statement is present in computed property
7654
7659
  * @see https://eslint.vuejs.org/rules/return-in-computed-property.html
@@ -7675,6 +7680,11 @@ interface RuleOptions {
7675
7680
  * @see https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html
7676
7681
  */
7677
7682
  'vue/singleline-html-element-content-newline'?: Linter.RuleEntry<VueSinglelineHtmlElementContentNewline>
7683
+ /**
7684
+ * enforce specific casing for slot names
7685
+ * @see https://eslint.vuejs.org/rules/slot-name-casing.html
7686
+ */
7687
+ 'vue/slot-name-casing'?: Linter.RuleEntry<VueSlotNameCasing>
7678
7688
  /**
7679
7689
  * enforce sort-keys in a manner that is compatible with order-in-components
7680
7690
  * @see https://eslint.vuejs.org/rules/sort-keys.html
@@ -8749,6 +8759,7 @@ type JsdocInformativeDocs = []|[{
8749
8759
  }]
8750
8760
  // ----- jsdoc/lines-before-block -----
8751
8761
  type JsdocLinesBeforeBlock = []|[{
8762
+ checkBlockStarts?: boolean
8752
8763
  excludedTags?: string[]
8753
8764
  ignoreSameLine?: boolean
8754
8765
  lines?: number
@@ -11237,9 +11248,10 @@ type ReactNamingConventionFilenameExtension = []|[(("always" | "as-needed") | {
11237
11248
  })]
11238
11249
  // ----- react-refresh/only-export-components -----
11239
11250
  type ReactRefreshOnlyExportComponents = []|[{
11251
+ allowExportNames?: string[]
11240
11252
  allowConstantExport?: boolean
11253
+ customHOCs?: string[]
11241
11254
  checkJS?: boolean
11242
- allowExportNames?: string[]
11243
11255
  }]
11244
11256
  // ----- react/no-useless-fragment -----
11245
11257
  type ReactNoUselessFragment = []|[{
@@ -11491,6 +11503,7 @@ type SortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
11491
11503
  natural?: boolean
11492
11504
  minKeys?: number
11493
11505
  allowLineSeparatedGroups?: boolean
11506
+ ignoreComputedKeys?: boolean
11494
11507
  }]
11495
11508
  // ----- sort-vars -----
11496
11509
  type SortVars = []|[{
@@ -14013,6 +14026,10 @@ type TsPreferOptionalChain = []|[{
14013
14026
  type TsPreferPromiseRejectErrors = []|[{
14014
14027
 
14015
14028
  allowEmptyReject?: boolean
14029
+
14030
+ allowThrowingAny?: boolean
14031
+
14032
+ allowThrowingUnknown?: boolean
14016
14033
  }]
14017
14034
  // ----- ts/prefer-readonly -----
14018
14035
  type TsPreferReadonly = []|[{
@@ -14485,6 +14502,7 @@ type VueAttributeHyphenation = []|[("always" | "never")]|[("always" | "never"),
14485
14502
  } & {
14486
14503
  [k: string]: unknown | undefined
14487
14504
  })[]
14505
+ ignoreTags?: string[]
14488
14506
  }]
14489
14507
  // ----- vue/attributes-order -----
14490
14508
  type VueAttributesOrder = []|[{
@@ -15201,6 +15219,10 @@ type VueNoDeprecatedSlotAttribute = []|[{
15201
15219
  type VueNoDupeKeys = []|[{
15202
15220
  groups?: unknown[]
15203
15221
  }]
15222
+ // ----- vue/no-duplicate-attr-inheritance -----
15223
+ type VueNoDuplicateAttrInheritance = []|[{
15224
+ checkMultiRootNodes?: boolean
15225
+ }]
15204
15226
  // ----- vue/no-duplicate-attributes -----
15205
15227
  type VueNoDuplicateAttributes = []|[{
15206
15228
  allowCoexistClass?: boolean
@@ -15436,6 +15458,7 @@ type VueNoUselessVBind = []|[{
15436
15458
  // ----- vue/no-v-text-v-html-on-component -----
15437
15459
  type VueNoVTextVHtmlOnComponent = []|[{
15438
15460
  allow?: string[]
15461
+ ignoreElementNamespaces?: boolean
15439
15462
  }]
15440
15463
  // ----- vue/object-curly-newline -----
15441
15464
  type VueObjectCurlyNewline = []|[((("always" | "never") | {
@@ -15556,6 +15579,10 @@ type VueRequirePropComment = []|[{
15556
15579
  type VueRequireToggleInsideTransition = []|[{
15557
15580
  additionalDirectives?: string[]
15558
15581
  }]
15582
+ // ----- vue/restricted-component-names -----
15583
+ type VueRestrictedComponentNames = []|[{
15584
+ allow?: string[]
15585
+ }]
15559
15586
  // ----- vue/return-in-computed-property -----
15560
15587
  type VueReturnInComputedProperty = []|[{
15561
15588
  treatUndefinedAsUnspecified?: boolean
@@ -15577,6 +15604,8 @@ type VueSinglelineHtmlElementContentNewline = []|[{
15577
15604
  ignores?: string[]
15578
15605
  externalIgnores?: string[]
15579
15606
  }]
15607
+ // ----- vue/slot-name-casing -----
15608
+ type VueSlotNameCasing = []|[("camelCase" | "kebab-case" | "singleword")]
15580
15609
  // ----- vue/sort-keys -----
15581
15610
  type VueSortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
15582
15611
  caseSensitive?: boolean
@@ -15620,6 +15649,7 @@ type VueVOnEventHyphenation = []|[("always" | "never")]|[("always" | "never"), {
15620
15649
  } & {
15621
15650
  [k: string]: unknown | undefined
15622
15651
  })[]
15652
+ ignoreTags?: string[]
15623
15653
  }]
15624
15654
  // ----- vue/v-on-function-call -----
15625
15655
  type VueVOnFunctionCall = []|[("always" | "never")]|[("always" | "never"), {
@@ -15867,11 +15897,8 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
15867
15897
  onlyEquality?: boolean
15868
15898
  }]
15869
15899
  // Names of all the configs
15870
- type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/imports/disables/bin' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/javascript/disables' | 'vinicunca/jsx/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/disables' | 'vinicunca/node/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/regexp/rules' | 'vinicunca/solid/setup' | 'vinicunca/solid/rules' | 'vinicunca/sonar/rules' | 'vinicunca/sort/package-json' | 'vinicunca/stylistic/rules' | 'vinicunca/svelte/setup' | 'vinicunca/svelte/rules' | 'vinicunca/test/setup' | 'vinicunca/test/rules' | 'vinicunca/toml/setup' | 'vinicunca/toml/rules' | 'vinicunca/typescript/setup' | 'vinicunca/typescript/parser' | 'vinicunca/typescript/rules' | 'vinicunca/typescript/disables/dts' | 'vinicunca/typescript/disables/tests' | 'vinicunca/typescript/disables/javascript' | 'vinicunca/unicorn/rules' | 'vinicunca/unocss' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules'
15900
+ type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/imports/disables/bin' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/javascript/disables' | 'vinicunca/jsx/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/disables' | 'vinicunca/node/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/solid/setup' | 'vinicunca/solid/rules' | 'vinicunca/sort/package-json' | 'vinicunca/stylistic/rules' | 'vinicunca/svelte/setup' | 'vinicunca/svelte/rules' | 'vinicunca/test/setup' | 'vinicunca/test/rules' | 'vinicunca/toml/setup' | 'vinicunca/toml/rules' | 'vinicunca/regexp/rules' | 'vinicunca/sonar/rules' | 'vinicunca/typescript/setup' | 'vinicunca/typescript/parser' | 'vinicunca/typescript/rules' | 'vinicunca/typescript/disables/dts' | 'vinicunca/typescript/disables/tests' | 'vinicunca/typescript/disables/javascript' | 'vinicunca/unicorn/rules' | 'vinicunca/unocss' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules'
15871
15901
 
15872
- /**
15873
- * Vendor types from Prettier so we don't rely on the dependency.
15874
- */
15875
15902
  type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
15876
15903
  interface VendoredPrettierOptionsRequired {
15877
15904
  /**
@@ -16321,6 +16348,7 @@ declare const defaultPluginRenaming: {
16321
16348
  vitest: string;
16322
16349
  yml: string;
16323
16350
  };
16351
+ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
16324
16352
  /**
16325
16353
  * Construct an array of ESLint flat config items.
16326
16354
  *
@@ -16332,7 +16360,6 @@ declare const defaultPluginRenaming: {
16332
16360
  * The merged ESLint configurations.
16333
16361
  */
16334
16362
  declare function vinicuncaESLint(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Array<Awaitable<Array<Linter.Config> | Array<TypedFlatConfigItem> | FlatConfigComposer<any, any> | TypedFlatConfigItem>>): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
16335
- type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
16336
16363
 
16337
16364
  declare function astro(options?: OptionsFiles & OptionsOverrides & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
16338
16365
 
@@ -16365,7 +16392,7 @@ declare function node(): Promise<Array<TypedFlatConfigItem>>;
16365
16392
  */
16366
16393
  declare function perfectionist(): Promise<Array<TypedFlatConfigItem>>;
16367
16394
 
16368
- declare function react(options?: OptionsFiles & OptionsOverrides & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
16395
+ declare function react(options?: OptionsFiles & OptionsOverrides & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
16369
16396
 
16370
16397
  declare function regexp(options?: OptionsOverrides & OptionsRegExp): Promise<Array<TypedFlatConfigItem>>;
16371
16398
 
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Linter } from 'eslint';
2
- import { FlatConfigComposer } from 'eslint-flat-config-utils';
3
2
  import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
4
3
  import { ParserOptions } from '@typescript-eslint/parser';
5
4
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
6
5
  import { Options } from 'eslint-processor-vue-blocks';
6
+ import { FlatConfigComposer } from 'eslint-flat-config-utils';
7
7
  export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
8
8
  export { default as pluginAntfu } from 'eslint-plugin-antfu';
9
9
  import * as eslintPluginImportX from 'eslint-plugin-import-x';
@@ -1634,7 +1634,7 @@ interface RuleOptions {
1634
1634
  */
1635
1635
  'no-class-assign'?: Linter.RuleEntry<[]>
1636
1636
  /**
1637
- * Disallow comparing against -0
1637
+ * Disallow comparing against `-0`
1638
1638
  * @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
1639
1639
  */
1640
1640
  'no-compare-neg-zero'?: Linter.RuleEntry<[]>
@@ -7090,7 +7090,7 @@ interface RuleOptions {
7090
7090
  * enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"`
7091
7091
  * @see https://eslint.vuejs.org/rules/no-duplicate-attr-inheritance.html
7092
7092
  */
7093
- 'vue/no-duplicate-attr-inheritance'?: Linter.RuleEntry<[]>
7093
+ 'vue/no-duplicate-attr-inheritance'?: Linter.RuleEntry<VueNoDuplicateAttrInheritance>
7094
7094
  /**
7095
7095
  * disallow duplication of attributes
7096
7096
  * @see https://eslint.vuejs.org/rules/no-duplicate-attributes.html
@@ -7535,7 +7535,7 @@ interface RuleOptions {
7535
7535
  */
7536
7536
  'vue/prefer-true-attribute-shorthand'?: Linter.RuleEntry<VuePreferTrueAttributeShorthand>
7537
7537
  /**
7538
- * require using `useTemplateRef` instead of `ref` for template refs
7538
+ * require using `useTemplateRef` instead of `ref`/`shallowRef` for template refs
7539
7539
  * @see https://eslint.vuejs.org/rules/prefer-use-template-ref.html
7540
7540
  */
7541
7541
  'vue/prefer-use-template-ref'?: Linter.RuleEntry<[]>
@@ -7649,6 +7649,11 @@ interface RuleOptions {
7649
7649
  * @see https://eslint.vuejs.org/rules/require-valid-default-prop.html
7650
7650
  */
7651
7651
  'vue/require-valid-default-prop'?: Linter.RuleEntry<[]>
7652
+ /**
7653
+ * enforce using only specific component names
7654
+ * @see https://eslint.vuejs.org/rules/restricted-component-names.html
7655
+ */
7656
+ 'vue/restricted-component-names'?: Linter.RuleEntry<VueRestrictedComponentNames>
7652
7657
  /**
7653
7658
  * enforce that a return statement is present in computed property
7654
7659
  * @see https://eslint.vuejs.org/rules/return-in-computed-property.html
@@ -7675,6 +7680,11 @@ interface RuleOptions {
7675
7680
  * @see https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html
7676
7681
  */
7677
7682
  'vue/singleline-html-element-content-newline'?: Linter.RuleEntry<VueSinglelineHtmlElementContentNewline>
7683
+ /**
7684
+ * enforce specific casing for slot names
7685
+ * @see https://eslint.vuejs.org/rules/slot-name-casing.html
7686
+ */
7687
+ 'vue/slot-name-casing'?: Linter.RuleEntry<VueSlotNameCasing>
7678
7688
  /**
7679
7689
  * enforce sort-keys in a manner that is compatible with order-in-components
7680
7690
  * @see https://eslint.vuejs.org/rules/sort-keys.html
@@ -8749,6 +8759,7 @@ type JsdocInformativeDocs = []|[{
8749
8759
  }]
8750
8760
  // ----- jsdoc/lines-before-block -----
8751
8761
  type JsdocLinesBeforeBlock = []|[{
8762
+ checkBlockStarts?: boolean
8752
8763
  excludedTags?: string[]
8753
8764
  ignoreSameLine?: boolean
8754
8765
  lines?: number
@@ -11237,9 +11248,10 @@ type ReactNamingConventionFilenameExtension = []|[(("always" | "as-needed") | {
11237
11248
  })]
11238
11249
  // ----- react-refresh/only-export-components -----
11239
11250
  type ReactRefreshOnlyExportComponents = []|[{
11251
+ allowExportNames?: string[]
11240
11252
  allowConstantExport?: boolean
11253
+ customHOCs?: string[]
11241
11254
  checkJS?: boolean
11242
- allowExportNames?: string[]
11243
11255
  }]
11244
11256
  // ----- react/no-useless-fragment -----
11245
11257
  type ReactNoUselessFragment = []|[{
@@ -11491,6 +11503,7 @@ type SortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
11491
11503
  natural?: boolean
11492
11504
  minKeys?: number
11493
11505
  allowLineSeparatedGroups?: boolean
11506
+ ignoreComputedKeys?: boolean
11494
11507
  }]
11495
11508
  // ----- sort-vars -----
11496
11509
  type SortVars = []|[{
@@ -14013,6 +14026,10 @@ type TsPreferOptionalChain = []|[{
14013
14026
  type TsPreferPromiseRejectErrors = []|[{
14014
14027
 
14015
14028
  allowEmptyReject?: boolean
14029
+
14030
+ allowThrowingAny?: boolean
14031
+
14032
+ allowThrowingUnknown?: boolean
14016
14033
  }]
14017
14034
  // ----- ts/prefer-readonly -----
14018
14035
  type TsPreferReadonly = []|[{
@@ -14485,6 +14502,7 @@ type VueAttributeHyphenation = []|[("always" | "never")]|[("always" | "never"),
14485
14502
  } & {
14486
14503
  [k: string]: unknown | undefined
14487
14504
  })[]
14505
+ ignoreTags?: string[]
14488
14506
  }]
14489
14507
  // ----- vue/attributes-order -----
14490
14508
  type VueAttributesOrder = []|[{
@@ -15201,6 +15219,10 @@ type VueNoDeprecatedSlotAttribute = []|[{
15201
15219
  type VueNoDupeKeys = []|[{
15202
15220
  groups?: unknown[]
15203
15221
  }]
15222
+ // ----- vue/no-duplicate-attr-inheritance -----
15223
+ type VueNoDuplicateAttrInheritance = []|[{
15224
+ checkMultiRootNodes?: boolean
15225
+ }]
15204
15226
  // ----- vue/no-duplicate-attributes -----
15205
15227
  type VueNoDuplicateAttributes = []|[{
15206
15228
  allowCoexistClass?: boolean
@@ -15436,6 +15458,7 @@ type VueNoUselessVBind = []|[{
15436
15458
  // ----- vue/no-v-text-v-html-on-component -----
15437
15459
  type VueNoVTextVHtmlOnComponent = []|[{
15438
15460
  allow?: string[]
15461
+ ignoreElementNamespaces?: boolean
15439
15462
  }]
15440
15463
  // ----- vue/object-curly-newline -----
15441
15464
  type VueObjectCurlyNewline = []|[((("always" | "never") | {
@@ -15556,6 +15579,10 @@ type VueRequirePropComment = []|[{
15556
15579
  type VueRequireToggleInsideTransition = []|[{
15557
15580
  additionalDirectives?: string[]
15558
15581
  }]
15582
+ // ----- vue/restricted-component-names -----
15583
+ type VueRestrictedComponentNames = []|[{
15584
+ allow?: string[]
15585
+ }]
15559
15586
  // ----- vue/return-in-computed-property -----
15560
15587
  type VueReturnInComputedProperty = []|[{
15561
15588
  treatUndefinedAsUnspecified?: boolean
@@ -15577,6 +15604,8 @@ type VueSinglelineHtmlElementContentNewline = []|[{
15577
15604
  ignores?: string[]
15578
15605
  externalIgnores?: string[]
15579
15606
  }]
15607
+ // ----- vue/slot-name-casing -----
15608
+ type VueSlotNameCasing = []|[("camelCase" | "kebab-case" | "singleword")]
15580
15609
  // ----- vue/sort-keys -----
15581
15610
  type VueSortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
15582
15611
  caseSensitive?: boolean
@@ -15620,6 +15649,7 @@ type VueVOnEventHyphenation = []|[("always" | "never")]|[("always" | "never"), {
15620
15649
  } & {
15621
15650
  [k: string]: unknown | undefined
15622
15651
  })[]
15652
+ ignoreTags?: string[]
15623
15653
  }]
15624
15654
  // ----- vue/v-on-function-call -----
15625
15655
  type VueVOnFunctionCall = []|[("always" | "never")]|[("always" | "never"), {
@@ -15867,11 +15897,8 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
15867
15897
  onlyEquality?: boolean
15868
15898
  }]
15869
15899
  // Names of all the configs
15870
- type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/imports/disables/bin' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/javascript/disables' | 'vinicunca/jsx/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/disables' | 'vinicunca/node/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/regexp/rules' | 'vinicunca/solid/setup' | 'vinicunca/solid/rules' | 'vinicunca/sonar/rules' | 'vinicunca/sort/package-json' | 'vinicunca/stylistic/rules' | 'vinicunca/svelte/setup' | 'vinicunca/svelte/rules' | 'vinicunca/test/setup' | 'vinicunca/test/rules' | 'vinicunca/toml/setup' | 'vinicunca/toml/rules' | 'vinicunca/typescript/setup' | 'vinicunca/typescript/parser' | 'vinicunca/typescript/rules' | 'vinicunca/typescript/disables/dts' | 'vinicunca/typescript/disables/tests' | 'vinicunca/typescript/disables/javascript' | 'vinicunca/unicorn/rules' | 'vinicunca/unocss' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules'
15900
+ type ConfigNames = 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/formatter/setup' | 'vinicunca/imports/rules' | 'vinicunca/imports/disables/bin' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/javascript/disables' | 'vinicunca/jsx/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/disables' | 'vinicunca/node/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/solid/setup' | 'vinicunca/solid/rules' | 'vinicunca/sort/package-json' | 'vinicunca/stylistic/rules' | 'vinicunca/svelte/setup' | 'vinicunca/svelte/rules' | 'vinicunca/test/setup' | 'vinicunca/test/rules' | 'vinicunca/toml/setup' | 'vinicunca/toml/rules' | 'vinicunca/regexp/rules' | 'vinicunca/sonar/rules' | 'vinicunca/typescript/setup' | 'vinicunca/typescript/parser' | 'vinicunca/typescript/rules' | 'vinicunca/typescript/disables/dts' | 'vinicunca/typescript/disables/tests' | 'vinicunca/typescript/disables/javascript' | 'vinicunca/unicorn/rules' | 'vinicunca/unocss' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules'
15871
15901
 
15872
- /**
15873
- * Vendor types from Prettier so we don't rely on the dependency.
15874
- */
15875
15902
  type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
15876
15903
  interface VendoredPrettierOptionsRequired {
15877
15904
  /**
@@ -16321,6 +16348,7 @@ declare const defaultPluginRenaming: {
16321
16348
  vitest: string;
16322
16349
  yml: string;
16323
16350
  };
16351
+ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
16324
16352
  /**
16325
16353
  * Construct an array of ESLint flat config items.
16326
16354
  *
@@ -16332,7 +16360,6 @@ declare const defaultPluginRenaming: {
16332
16360
  * The merged ESLint configurations.
16333
16361
  */
16334
16362
  declare function vinicuncaESLint(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Array<Awaitable<Array<Linter.Config> | Array<TypedFlatConfigItem> | FlatConfigComposer<any, any> | TypedFlatConfigItem>>): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
16335
- type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
16336
16363
 
16337
16364
  declare function astro(options?: OptionsFiles & OptionsOverrides & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
16338
16365
 
@@ -16365,7 +16392,7 @@ declare function node(): Promise<Array<TypedFlatConfigItem>>;
16365
16392
  */
16366
16393
  declare function perfectionist(): Promise<Array<TypedFlatConfigItem>>;
16367
16394
 
16368
- declare function react(options?: OptionsFiles & OptionsOverrides & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
16395
+ declare function react(options?: OptionsFiles & OptionsOverrides & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
16369
16396
 
16370
16397
  declare function regexp(options?: OptionsOverrides & OptionsRegExp): Promise<Array<TypedFlatConfigItem>>;
16371
16398
 
package/dist/index.js CHANGED
@@ -1231,10 +1231,10 @@ async function perfectionist() {
1231
1231
  {
1232
1232
  groups: [
1233
1233
  "type",
1234
- ["parent-type", "sibling-type", "index-type"],
1234
+ ["parent-type", "sibling-type", "index-type", "internal-type"],
1235
1235
  "builtin",
1236
1236
  "external",
1237
- ["internal", "internal-type"],
1237
+ "internal",
1238
1238
  ["parent", "sibling", "index"],
1239
1239
  "side-effect",
1240
1240
  "object",
@@ -1276,20 +1276,26 @@ var NextJsPackages = [
1276
1276
  async function react(options = {}) {
1277
1277
  const {
1278
1278
  files = [GLOB_SRC],
1279
- overrides = {}
1279
+ filesTypeAware = [GLOB_TS, GLOB_TSX],
1280
+ ignoresTypeAware = [
1281
+ `${GLOB_MARKDOWN}/**`,
1282
+ GLOB_ASTRO_TS
1283
+ ],
1284
+ overrides = {},
1285
+ tsconfigPath
1280
1286
  } = options;
1281
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1282
1287
  const isTypeAware = !!tsconfigPath;
1288
+ const typeAwareRules = {
1289
+ "react/no-leaked-conditional-rendering": "warn"
1290
+ };
1283
1291
  const [
1284
1292
  pluginReact,
1285
1293
  pluginReactHooks,
1286
- pluginReactRefresh,
1287
- parserTs
1294
+ pluginReactRefresh
1288
1295
  ] = await Promise.all([
1289
1296
  interopDefault(import("@eslint-react/eslint-plugin")),
1290
1297
  interopDefault(import("eslint-plugin-react-hooks")),
1291
- interopDefault(import("eslint-plugin-react-refresh")),
1292
- interopDefault(import("@typescript-eslint/parser"))
1298
+ interopDefault(import("eslint-plugin-react-refresh"))
1293
1299
  ]);
1294
1300
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists3(i));
1295
1301
  const isUsingRemix = RemixPackages.some((i) => isPackageExists3(i));
@@ -1310,12 +1316,10 @@ async function react(options = {}) {
1310
1316
  {
1311
1317
  files,
1312
1318
  languageOptions: {
1313
- parser: parserTs,
1314
1319
  parserOptions: {
1315
1320
  ecmaFeatures: {
1316
1321
  jsx: true
1317
- },
1318
- ...isTypeAware ? { project: tsconfigPath } : {}
1322
+ }
1319
1323
  },
1320
1324
  sourceType: "module"
1321
1325
  },
@@ -1397,13 +1401,18 @@ async function react(options = {}) {
1397
1401
  "react/prefer-destructuring-assignment": WARN,
1398
1402
  "react/prefer-shorthand-boolean": WARN,
1399
1403
  "react/prefer-shorthand-fragment": WARN,
1400
- ...isTypeAware ? {
1401
- "react/no-leaked-conditional-rendering": WARN
1402
- } : {},
1403
1404
  // overrides
1404
1405
  ...overrides
1405
1406
  }
1406
- }
1407
+ },
1408
+ ...isTypeAware ? [{
1409
+ files: filesTypeAware,
1410
+ ignores: ignoresTypeAware,
1411
+ name: "antfu/react/type-aware-rules",
1412
+ rules: {
1413
+ ...typeAwareRules
1414
+ }
1415
+ }] : []
1407
1416
  ];
1408
1417
  }
1409
1418
 
@@ -2425,8 +2434,7 @@ async function yaml(options = {}) {
2425
2434
  "yaml/indent": [ERROR, indent === "tab" ? 2 : indent],
2426
2435
  "yaml/key-spacing": ERROR,
2427
2436
  "yaml/no-tab-indent": ERROR,
2428
- // quotes only supports single and double quotes but in options we have backtick as well
2429
- "yaml/quotes": [ERROR, { avoidEscape: false, prefer: quotes }],
2437
+ "yaml/quotes": [ERROR, { avoidEscape: true, prefer: quotes === "backtick" ? "single" : quotes }],
2430
2438
  "yaml/spaced-comment": ERROR
2431
2439
  } : {},
2432
2440
  ...overrides
@@ -2576,6 +2584,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2576
2584
  }
2577
2585
  if (enableReact) {
2578
2586
  configs2.push(react({
2587
+ ...typescriptOptions,
2579
2588
  overrides: getOverrides(options, "react"),
2580
2589
  tsconfigPath
2581
2590
  }));
@@ -2668,15 +2677,15 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2668
2677
  }
2669
2678
  return composer;
2670
2679
  }
2671
- function resolveSubOptions(options, key) {
2672
- return e(options[key]) ? {} : options[key] || {};
2673
- }
2674
2680
  function getOverrides(options, key) {
2675
2681
  const sub = resolveSubOptions(options, key);
2676
2682
  return {
2677
2683
  ..."overrides" in sub ? sub.overrides : {}
2678
2684
  };
2679
2685
  }
2686
+ function resolveSubOptions(options, key) {
2687
+ return e(options[key]) ? {} : options[key] || {};
2688
+ }
2680
2689
  export {
2681
2690
  GLOB_ALL_SRC,
2682
2691
  GLOB_ASTRO,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/eslint-config",
3
3
  "type": "module",
4
- "version": "2.13.0",
4
+ "version": "2.14.0",
5
5
  "description": "Vinicunca ESLint config",
6
6
  "author": {
7
7
  "name": "praburangki",
@@ -55,15 +55,15 @@
55
55
  "node": ">=20.0.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "@eslint-react/eslint-plugin": "^1.17.1",
58
+ "@eslint-react/eslint-plugin": "^1.17.3",
59
59
  "@prettier/plugin-xml": "^3.4.1",
60
60
  "astro-eslint-parser": "^1.1.0",
61
- "eslint": "^9.15.0",
61
+ "eslint": "^9.16.0",
62
62
  "eslint-plugin-astro": "^1.3.1",
63
63
  "eslint-plugin-react-hooks": "^5.0.0",
64
- "eslint-plugin-react-refresh": "^0.4.14",
64
+ "eslint-plugin-react-refresh": "^0.4.16",
65
65
  "eslint-plugin-solid": "^0.14.4",
66
- "eslint-plugin-svelte": ">=2.46.0",
66
+ "eslint-plugin-svelte": ">=2.46.1",
67
67
  "prettier-plugin-astro": "^0.14.1",
68
68
  "prettier-plugin-slidev": "^1.0.5",
69
69
  "svelte-eslint-parser": ">=0.43.0"
@@ -75,12 +75,18 @@
75
75
  "@prettier/plugin-xml": {
76
76
  "optional": true
77
77
  },
78
+ "@unocss/eslint-plugin": {
79
+ "optional": true
80
+ },
78
81
  "astro-eslint-parser": {
79
82
  "optional": true
80
83
  },
81
84
  "eslint-plugin-astro": {
82
85
  "optional": true
83
86
  },
87
+ "eslint-plugin-format": {
88
+ "optional": true
89
+ },
84
90
  "eslint-plugin-react-hooks": {
85
91
  "optional": true
86
92
  },
@@ -104,36 +110,36 @@
104
110
  }
105
111
  },
106
112
  "dependencies": {
107
- "@antfu/install-pkg": "^0.4.1",
113
+ "@antfu/install-pkg": "^0.5.0",
108
114
  "@clack/prompts": "^0.8.2",
109
115
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
110
116
  "@eslint/markdown": "^6.2.1",
111
117
  "@stylistic/eslint-plugin": "^2.11.0",
112
- "@typescript-eslint/eslint-plugin": "^8.16.0",
113
- "@typescript-eslint/parser": "^8.16.0",
114
- "@unocss/eslint-plugin": "^0.64.1",
115
- "@vitest/eslint-plugin": "^1.1.10",
118
+ "@typescript-eslint/eslint-plugin": "^8.17.0",
119
+ "@typescript-eslint/parser": "^8.17.0",
120
+ "@unocss/eslint-plugin": "^0.65.0",
121
+ "@vitest/eslint-plugin": "^1.1.14",
116
122
  "eslint-config-flat-gitignore": "^0.3.0",
117
123
  "eslint-flat-config-utils": "^0.4.0",
118
124
  "eslint-merge-processors": "^0.1.0",
119
125
  "eslint-plugin-antfu": "^2.7.0",
120
126
  "eslint-plugin-command": "^0.2.6",
121
- "eslint-plugin-format": "^0.1.2",
127
+ "eslint-plugin-format": "^0.1.3",
122
128
  "eslint-plugin-import-x": "^4.4.3",
123
- "eslint-plugin-jsdoc": "^50.5.0",
129
+ "eslint-plugin-jsdoc": "^50.6.0",
124
130
  "eslint-plugin-jsonc": "^2.18.2",
125
131
  "eslint-plugin-n": "^17.14.0",
126
132
  "eslint-plugin-no-only-tests": "^3.3.0",
127
133
  "eslint-plugin-perfectionist": "^4.1.2",
128
134
  "eslint-plugin-regexp": "^2.7.0",
129
135
  "eslint-plugin-sonarjs": "^1.0.4",
130
- "eslint-plugin-toml": "^0.11.1",
136
+ "eslint-plugin-toml": "^0.12.0",
131
137
  "eslint-plugin-unicorn": "^56.0.1",
132
138
  "eslint-plugin-unused-imports": "^4.1.4",
133
- "eslint-plugin-vue": "^9.31.0",
134
- "eslint-plugin-yml": "^1.15.0",
139
+ "eslint-plugin-vue": "^9.32.0",
140
+ "eslint-plugin-yml": "^1.16.0",
135
141
  "eslint-processor-vue-blocks": "^0.1.2",
136
- "globals": "^15.12.0",
142
+ "globals": "^15.13.0",
137
143
  "jsonc-eslint-parser": "^2.4.0",
138
144
  "local-pkg": "^0.5.1",
139
145
  "toml-eslint-parser": "^0.10.0",