@ntnyq/eslint-config 3.10.4 → 3.11.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
@@ -80,6 +80,7 @@ __export(index_exports, {
80
80
  githubAction: () => githubAction,
81
81
  gitignore: () => gitignore,
82
82
  hasPinia: () => hasPinia,
83
+ hasShadcnVue: () => hasShadcnVue,
83
84
  hasTypeScript: () => hasTypeScript,
84
85
  hasUnoCSS: () => hasUnoCSS,
85
86
  hasVitest: () => hasVitest,
@@ -1645,6 +1646,7 @@ var import_node_process = __toESM(require("process"), 1);
1645
1646
  var import_local_pkg = require("local-pkg");
1646
1647
  var hasTypeScript = (0, import_local_pkg.isPackageExists)("typescript");
1647
1648
  var hasVitest = (0, import_local_pkg.isPackageExists)("vitest");
1649
+ var hasShadcnVue = (0, import_local_pkg.isPackageExists)("radix-vue") && (0, import_local_pkg.isPackageExists)("clsx");
1648
1650
  var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pkg.isPackageExists)("nuxt") || (0, import_local_pkg.isPackageExists)("vitepress") || (0, import_local_pkg.isPackageExists)("@slidev/cli") || (0, import_local_pkg.isPackageExists)("vue", {
1649
1651
  paths: [(0, import_node_path.resolve)(import_node_process.default.cwd(), "playground")]
1650
1652
  });
@@ -1679,8 +1681,8 @@ function resolveSubOptions(options, key) {
1679
1681
 
1680
1682
  // src/utils/getOverrides.ts
1681
1683
  function getOverrides(options, key) {
1682
- const sub = resolveSubOptions(options, key);
1683
- return "overrides" in sub && sub.overrides ? sub.overrides : {};
1684
+ const subOptions = resolveSubOptions(options, key);
1685
+ return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
1684
1686
  }
1685
1687
 
1686
1688
  // src/utils/mergePrettierOptions.ts
@@ -2001,73 +2003,93 @@ var unicorn = (options = {}) => [
2001
2003
 
2002
2004
  // src/configs/specials.ts
2003
2005
  var import_globals = __toESM(require("globals"), 1);
2004
- var specials = (options = {}) => [
2005
- {
2006
- name: "ntnyq/specials/scripts",
2007
- files: [`**/scripts/${GLOB_SRC}`],
2008
- rules: {
2009
- "no-console": "off",
2010
- "@typescript-eslint/explicit-function-return-type": "off",
2011
- // Overrides rules
2012
- ...options.overridesScriptsRules
2013
- }
2014
- },
2015
- {
2016
- name: "ntnyq/specials/cli",
2017
- files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
2018
- rules: {
2019
- "no-console": "off",
2020
- "@typescript-eslint/explicit-function-return-type": "off",
2021
- // Overrides rules
2022
- ...options.overridesCliRules
2023
- }
2024
- },
2025
- {
2026
- name: "ntnyq/specials/userscript",
2027
- files: [`**/*.user.${GLOB_SRC_EXT}`],
2028
- languageOptions: {
2029
- globals: {
2030
- ...import_globals.default.greasemonkey
2006
+ var specials = (options = {}) => {
2007
+ const {
2008
+ // Enable shadcn-vue support
2009
+ shadcnVue: enableShadcnVue = hasShadcnVue
2010
+ } = options;
2011
+ const configs2 = [
2012
+ {
2013
+ name: "ntnyq/specials/scripts",
2014
+ files: [`**/scripts/${GLOB_SRC}`],
2015
+ rules: {
2016
+ "no-console": "off",
2017
+ "@typescript-eslint/explicit-function-return-type": "off",
2018
+ // Overrides rules
2019
+ ...options.overridesScriptsRules
2031
2020
  }
2032
2021
  },
2033
- rules: {
2034
- camelcase: [
2035
- "error",
2036
- {
2037
- allow: ["^GM_.+"]
2038
- }
2039
- ],
2040
- // Overrides rules
2041
- ...options.overridesUserScriptsRules
2042
- }
2043
- },
2044
- {
2045
- name: "ntnyq/specials/config-file",
2046
- files: [`**/*.config*.${GLOB_SRC_EXT}`],
2047
- plugins: {
2048
- "import-x": import_eslint_plugin_import_x.default,
2049
- perfectionist: import_eslint_plugin_perfectionist.default
2022
+ {
2023
+ name: "ntnyq/specials/cli",
2024
+ files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
2025
+ rules: {
2026
+ "no-console": "off",
2027
+ "@typescript-eslint/explicit-function-return-type": "off",
2028
+ // Overrides rules
2029
+ ...options.overridesCliRules
2030
+ }
2050
2031
  },
2051
- rules: {
2052
- "no-console": "off",
2053
- "import-x/no-default-export": "off",
2054
- "@typescript-eslint/explicit-function-return-type": "off",
2055
- "perfectionist/sort-objects": [
2056
- "error",
2057
- {
2058
- type: "alphabetical",
2059
- order: "asc",
2060
- partitionByComment: true,
2061
- groups: ["unknown", "method", "multiline"]
2032
+ {
2033
+ name: "ntnyq/specials/userscript",
2034
+ files: [`**/*.user.${GLOB_SRC_EXT}`],
2035
+ languageOptions: {
2036
+ globals: {
2037
+ ...import_globals.default.greasemonkey
2062
2038
  }
2063
- ],
2064
- ...options.overridesConfigFileRules
2039
+ },
2040
+ rules: {
2041
+ camelcase: [
2042
+ "error",
2043
+ {
2044
+ allow: ["^GM_.+"]
2045
+ }
2046
+ ],
2047
+ // Overrides rules
2048
+ ...options.overridesUserScriptsRules
2049
+ }
2050
+ },
2051
+ {
2052
+ name: "ntnyq/specials/config-file",
2053
+ files: [`**/*.config*.${GLOB_SRC_EXT}`],
2054
+ plugins: {
2055
+ "import-x": import_eslint_plugin_import_x.default,
2056
+ perfectionist: import_eslint_plugin_perfectionist.default
2057
+ },
2058
+ rules: {
2059
+ "no-console": "off",
2060
+ "import-x/no-default-export": "off",
2061
+ "@typescript-eslint/explicit-function-return-type": "off",
2062
+ "perfectionist/sort-objects": [
2063
+ "error",
2064
+ {
2065
+ type: "alphabetical",
2066
+ order: "asc",
2067
+ partitionByComment: true,
2068
+ groups: ["unknown", "method", "multiline"]
2069
+ }
2070
+ ],
2071
+ ...options.overridesConfigFileRules
2072
+ }
2065
2073
  }
2066
- },
2067
- // More special case configs
2068
- // So don't need to append configs to composer
2069
- ...options.specialCaseConfigs ? options.specialCaseConfigs : []
2070
- ];
2074
+ ];
2075
+ if (enableShadcnVue) {
2076
+ const shadcnOptions = resolveSubOptions(options, "shadcnVue");
2077
+ configs2.push({
2078
+ name: "ntnyq/specials/shadcn-vue",
2079
+ files: shadcnOptions.files || ["**/components/ui/**/*.ts", "**/components/ui/**/*.vue"],
2080
+ rules: {
2081
+ "@typescript-eslint/no-unused-vars": "off",
2082
+ "@typescript-eslint/consistent-type-imports": "off",
2083
+ // Overrides rules
2084
+ ...shadcnOptions.overridesRules
2085
+ }
2086
+ });
2087
+ }
2088
+ if (options.specialCaseConfigs) {
2089
+ configs2.push(...options.specialCaseConfigs);
2090
+ }
2091
+ return configs2;
2092
+ };
2071
2093
 
2072
2094
  // src/configs/comments.ts
2073
2095
  var comments = (options = {}) => [
@@ -2592,11 +2614,24 @@ var typescript = (options = {}) => {
2592
2614
  files,
2593
2615
  rules: {
2594
2616
  ...recommendedRules,
2595
- // Disabled in favor of ts rules
2617
+ "@typescript-eslint/no-namespace": "off",
2618
+ "@typescript-eslint/no-explicit-any": "off",
2619
+ "@typescript-eslint/naming-convention": "off",
2620
+ "@typescript-eslint/no-empty-function": "off",
2621
+ "@typescript-eslint/no-non-null-assertion": "off",
2622
+ "@typescript-eslint/triple-slash-reference": "off",
2623
+ "@typescript-eslint/explicit-member-accessibility": "off",
2624
+ "@typescript-eslint/explicit-function-return-type": "off",
2625
+ "@typescript-eslint/explicit-module-boundary-types": "off",
2626
+ "@typescript-eslint/consistent-indexed-object-style": "off",
2627
+ "@typescript-eslint/prefer-as-const": "warn",
2628
+ // Disabled in favor of enhanced ts rules
2596
2629
  "no-redeclare": "off",
2597
2630
  "no-unused-vars": "off",
2631
+ "default-param-last": "off",
2598
2632
  "no-use-before-define": "off",
2599
2633
  "no-useless-constructor": "off",
2634
+ "@typescript-eslint/default-param-last": "error",
2600
2635
  "@typescript-eslint/no-useless-constructor": "error",
2601
2636
  "@typescript-eslint/no-redeclare": [
2602
2637
  "error",
@@ -2630,6 +2665,19 @@ var typescript = (options = {}) => {
2630
2665
  ignoreRestSiblings: true
2631
2666
  }
2632
2667
  ],
2668
+ // Extra rules
2669
+ "@typescript-eslint/ban-tslint-comment": "error",
2670
+ "@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
2671
+ "@typescript-eslint/ban-ts-comment": [
2672
+ "error",
2673
+ {
2674
+ minimumDescriptionLength: 1,
2675
+ "ts-check": false,
2676
+ "ts-expect-error": "allow-with-description",
2677
+ "ts-ignore": "allow-with-description",
2678
+ "ts-nocheck": "allow-with-description"
2679
+ }
2680
+ ],
2633
2681
  "@typescript-eslint/no-unused-expressions": [
2634
2682
  "error",
2635
2683
  {
@@ -2660,18 +2708,6 @@ var typescript = (options = {}) => {
2660
2708
  objectLiteralTypeAssertions: "allow-as-parameter"
2661
2709
  }
2662
2710
  ],
2663
- "@typescript-eslint/prefer-as-const": "warn",
2664
- "@typescript-eslint/no-namespace": "off",
2665
- "@typescript-eslint/ban-ts-comment": "off",
2666
- "@typescript-eslint/no-explicit-any": "off",
2667
- "@typescript-eslint/no-empty-function": "off",
2668
- "@typescript-eslint/naming-convention": "off",
2669
- "@typescript-eslint/no-non-null-assertion": "off",
2670
- "@typescript-eslint/triple-slash-reference": "off",
2671
- "@typescript-eslint/explicit-member-accessibility": "off",
2672
- "@typescript-eslint/explicit-function-return-type": "off",
2673
- "@typescript-eslint/explicit-module-boundary-types": "off",
2674
- "@typescript-eslint/consistent-indexed-object-style": "off",
2675
2711
  // Overrides rules
2676
2712
  ...options.overrides
2677
2713
  }
@@ -3339,6 +3375,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3339
3375
  githubAction,
3340
3376
  gitignore,
3341
3377
  hasPinia,
3378
+ hasShadcnVue,
3342
3379
  hasTypeScript,
3343
3380
  hasUnoCSS,
3344
3381
  hasVitest,
package/dist/index.d.cts CHANGED
@@ -10,7 +10,6 @@ import { Linter } from 'eslint';
10
10
  import { ConfigWithExtends } from 'typescript-eslint';
11
11
  export { plugin as pluginTypeScript, configs as typescriptConfigs } from 'typescript-eslint';
12
12
  import { RequiredOptions, BuiltInParserName } from 'prettier';
13
- import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
14
13
  import * as eslintPluginRegexp from 'eslint-plugin-regexp';
15
14
  export { eslintPluginRegexp as pluginRegexp };
16
15
  import * as eslintPluginDepend from 'eslint-plugin-depend';
@@ -6954,7 +6953,7 @@ interface RuleOptions {
6954
6953
  */
6955
6954
  'vitest/padding-around-expect-groups'?: Linter.RuleEntry<[]>;
6956
6955
  /**
6957
- * Enforce padding around afterAll blocks
6956
+ * Enforce padding around `test` blocks
6958
6957
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
6959
6958
  */
6960
6959
  'vitest/padding-around-test-blocks'?: Linter.RuleEntry<[]>;
@@ -15997,8 +15996,7 @@ type VitestNoRestrictedViMethods = [] | [
15997
15996
  ];
15998
15997
  type VitestNoStandaloneExpect = [] | [
15999
15998
  {
16000
- additionaltestblockfunctions?: string[];
16001
- [k: string]: unknown | undefined;
15999
+ additionalTestBlockFunctions?: string[];
16002
16000
  }
16003
16001
  ];
16004
16002
  type VitestPreferExpectAssertions = [] | [
@@ -17846,6 +17844,13 @@ interface ConfigSpecialsOptions {
17846
17844
  * More special case configs
17847
17845
  */
17848
17846
  specialCaseConfigs?: TypedConfigItem[];
17847
+ /**
17848
+ * ShadcnVue config
17849
+ */
17850
+ shadcnVue?: boolean | {
17851
+ files?: TypedConfigItem['files'];
17852
+ overridesRules?: TypedConfigItem['rules'];
17853
+ };
17849
17854
  }
17850
17855
  interface ConfigStylisticOptions extends OptionsOverrides {
17851
17856
  }
@@ -18043,6 +18048,7 @@ declare const GLOB_EXCLUDE: string[];
18043
18048
 
18044
18049
  declare const hasTypeScript: boolean;
18045
18050
  declare const hasVitest: boolean;
18051
+ declare const hasShadcnVue: boolean;
18046
18052
  declare const hasVue: boolean;
18047
18053
  declare const hasPinia: boolean;
18048
18054
  declare const hasUnoCSS: boolean;
@@ -18065,7 +18071,7 @@ declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOpti
18065
18071
  */
18066
18072
  declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
18067
18073
 
18068
- declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
18074
+ declare function resolveSubOptions<T extends Record<string, any>, K extends keyof T>(options: T, key: K): Partial<ResolvedOptions<T[K]>>;
18069
18075
 
18070
18076
  /**
18071
18077
  * @file Merge prettier options
@@ -18073,12 +18079,24 @@ declare function resolveSubOptions<K extends keyof ConfigOptions>(options: Confi
18073
18079
 
18074
18080
  declare function mergePrettierOptions(options?: PrettierOptions, overrides?: PrettierOptions): PrettierOptions;
18075
18081
 
18082
+ /**
18083
+ * @file ESLint parsers
18084
+ */
18085
+
18076
18086
  /**
18077
18087
  * With meta
18078
18088
  */
18079
18089
  declare const parserTypeScript: {
18080
- meta?: { [K in keyof _typescript_eslint_utils_ts_eslint.Parser.ParserMeta]?: _typescript_eslint_utils_ts_eslint.Parser.ParserMeta[K] | undefined; };
18081
- parseForESLint(text: string, options?: unknown): { [k in keyof _typescript_eslint_utils_ts_eslint.Parser.ParseResult]: unknown; };
18090
+ meta?: {
18091
+ name?: string | undefined;
18092
+ version?: string | undefined;
18093
+ };
18094
+ parseForESLint(text: string, options?: unknown): {
18095
+ ast: unknown;
18096
+ scopeManager?: unknown;
18097
+ services?: unknown;
18098
+ visitorKeys?: unknown;
18099
+ };
18082
18100
  };
18083
18101
 
18084
18102
  /**
@@ -18173,4 +18191,4 @@ declare const unusedImports: (options?: ConfigUnusedImportsOptions) => TypedConf
18173
18191
  */
18174
18192
  declare const DEFAULT_PRETTIER_OPTIONS: PrettierOptions;
18175
18193
 
18176
- export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigDependOptions, type ConfigEsXOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPiniaOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSVGOOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigStylisticOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, DEFAULT_PRETTIER_OPTIONS, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, type ESLintRuleSeverity, type ESLintRulesRecord, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TYPES, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsExtensions, type OptionsFeatures, type OptionsFiles, type OptionsOverrides, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, antfu, command, comments, createNodeResolver, defineESLintConfig, depend, esX, format, getOverrides, githubAction, gitignore, hasPinia, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, importX, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, mergePrettierOptions, node, ntnyq, parserPlain, parserTypeScript, perfectionist, pinia, prettier, regexp, resolveSubOptions, sort, specials, stylistic, svgo, test, toArray, toml, typescript, unicorn, unocss, unusedImports, vitest, vue, yml };
18194
+ export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigDependOptions, type ConfigEsXOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPiniaOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSVGOOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigStylisticOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, DEFAULT_PRETTIER_OPTIONS, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, type ESLintRuleSeverity, type ESLintRulesRecord, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TYPES, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsExtensions, type OptionsFeatures, type OptionsFiles, type OptionsOverrides, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, antfu, command, comments, createNodeResolver, defineESLintConfig, depend, esX, format, getOverrides, githubAction, gitignore, hasPinia, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, importX, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, mergePrettierOptions, node, ntnyq, parserPlain, parserTypeScript, perfectionist, pinia, prettier, regexp, resolveSubOptions, sort, specials, stylistic, svgo, test, toArray, toml, typescript, unicorn, unocss, unusedImports, vitest, vue, yml };
package/dist/index.d.ts CHANGED
@@ -10,7 +10,6 @@ import { Linter } from 'eslint';
10
10
  import { ConfigWithExtends } from 'typescript-eslint';
11
11
  export { plugin as pluginTypeScript, configs as typescriptConfigs } from 'typescript-eslint';
12
12
  import { RequiredOptions, BuiltInParserName } from 'prettier';
13
- import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
14
13
  import * as eslintPluginRegexp from 'eslint-plugin-regexp';
15
14
  export { eslintPluginRegexp as pluginRegexp };
16
15
  import * as eslintPluginDepend from 'eslint-plugin-depend';
@@ -6954,7 +6953,7 @@ interface RuleOptions {
6954
6953
  */
6955
6954
  'vitest/padding-around-expect-groups'?: Linter.RuleEntry<[]>;
6956
6955
  /**
6957
- * Enforce padding around afterAll blocks
6956
+ * Enforce padding around `test` blocks
6958
6957
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
6959
6958
  */
6960
6959
  'vitest/padding-around-test-blocks'?: Linter.RuleEntry<[]>;
@@ -15997,8 +15996,7 @@ type VitestNoRestrictedViMethods = [] | [
15997
15996
  ];
15998
15997
  type VitestNoStandaloneExpect = [] | [
15999
15998
  {
16000
- additionaltestblockfunctions?: string[];
16001
- [k: string]: unknown | undefined;
15999
+ additionalTestBlockFunctions?: string[];
16002
16000
  }
16003
16001
  ];
16004
16002
  type VitestPreferExpectAssertions = [] | [
@@ -17846,6 +17844,13 @@ interface ConfigSpecialsOptions {
17846
17844
  * More special case configs
17847
17845
  */
17848
17846
  specialCaseConfigs?: TypedConfigItem[];
17847
+ /**
17848
+ * ShadcnVue config
17849
+ */
17850
+ shadcnVue?: boolean | {
17851
+ files?: TypedConfigItem['files'];
17852
+ overridesRules?: TypedConfigItem['rules'];
17853
+ };
17849
17854
  }
17850
17855
  interface ConfigStylisticOptions extends OptionsOverrides {
17851
17856
  }
@@ -18043,6 +18048,7 @@ declare const GLOB_EXCLUDE: string[];
18043
18048
 
18044
18049
  declare const hasTypeScript: boolean;
18045
18050
  declare const hasVitest: boolean;
18051
+ declare const hasShadcnVue: boolean;
18046
18052
  declare const hasVue: boolean;
18047
18053
  declare const hasPinia: boolean;
18048
18054
  declare const hasUnoCSS: boolean;
@@ -18065,7 +18071,7 @@ declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOpti
18065
18071
  */
18066
18072
  declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
18067
18073
 
18068
- declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
18074
+ declare function resolveSubOptions<T extends Record<string, any>, K extends keyof T>(options: T, key: K): Partial<ResolvedOptions<T[K]>>;
18069
18075
 
18070
18076
  /**
18071
18077
  * @file Merge prettier options
@@ -18073,12 +18079,24 @@ declare function resolveSubOptions<K extends keyof ConfigOptions>(options: Confi
18073
18079
 
18074
18080
  declare function mergePrettierOptions(options?: PrettierOptions, overrides?: PrettierOptions): PrettierOptions;
18075
18081
 
18082
+ /**
18083
+ * @file ESLint parsers
18084
+ */
18085
+
18076
18086
  /**
18077
18087
  * With meta
18078
18088
  */
18079
18089
  declare const parserTypeScript: {
18080
- meta?: { [K in keyof _typescript_eslint_utils_ts_eslint.Parser.ParserMeta]?: _typescript_eslint_utils_ts_eslint.Parser.ParserMeta[K] | undefined; };
18081
- parseForESLint(text: string, options?: unknown): { [k in keyof _typescript_eslint_utils_ts_eslint.Parser.ParseResult]: unknown; };
18090
+ meta?: {
18091
+ name?: string | undefined;
18092
+ version?: string | undefined;
18093
+ };
18094
+ parseForESLint(text: string, options?: unknown): {
18095
+ ast: unknown;
18096
+ scopeManager?: unknown;
18097
+ services?: unknown;
18098
+ visitorKeys?: unknown;
18099
+ };
18082
18100
  };
18083
18101
 
18084
18102
  /**
@@ -18173,4 +18191,4 @@ declare const unusedImports: (options?: ConfigUnusedImportsOptions) => TypedConf
18173
18191
  */
18174
18192
  declare const DEFAULT_PRETTIER_OPTIONS: PrettierOptions;
18175
18193
 
18176
- export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigDependOptions, type ConfigEsXOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPiniaOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSVGOOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigStylisticOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, DEFAULT_PRETTIER_OPTIONS, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, type ESLintRuleSeverity, type ESLintRulesRecord, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TYPES, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsExtensions, type OptionsFeatures, type OptionsFiles, type OptionsOverrides, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, antfu, command, comments, createNodeResolver, defineESLintConfig, depend, esX, format, getOverrides, githubAction, gitignore, hasPinia, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, importX, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, mergePrettierOptions, node, ntnyq, parserPlain, parserTypeScript, perfectionist, pinia, prettier, regexp, resolveSubOptions, sort, specials, stylistic, svgo, test, toArray, toml, typescript, unicorn, unocss, unusedImports, vitest, vue, yml };
18194
+ export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigDependOptions, type ConfigEsXOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPiniaOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSVGOOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigStylisticOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, DEFAULT_PRETTIER_OPTIONS, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, type ESLintRuleSeverity, type ESLintRulesRecord, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TYPES, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsExtensions, type OptionsFeatures, type OptionsFiles, type OptionsOverrides, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, antfu, command, comments, createNodeResolver, defineESLintConfig, depend, esX, format, getOverrides, githubAction, gitignore, hasPinia, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, importX, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, mergePrettierOptions, node, ntnyq, parserPlain, parserTypeScript, perfectionist, pinia, prettier, regexp, resolveSubOptions, sort, specials, stylistic, svgo, test, toArray, toml, typescript, unicorn, unocss, unusedImports, vitest, vue, yml };
package/dist/index.js CHANGED
@@ -1489,6 +1489,7 @@ import process from "node:process";
1489
1489
  import { isPackageExists } from "local-pkg";
1490
1490
  var hasTypeScript = isPackageExists("typescript");
1491
1491
  var hasVitest = isPackageExists("vitest");
1492
+ var hasShadcnVue = isPackageExists("radix-vue") && isPackageExists("clsx");
1492
1493
  var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
1493
1494
  paths: [resolve(process.cwd(), "playground")]
1494
1495
  });
@@ -1523,8 +1524,8 @@ function resolveSubOptions(options, key) {
1523
1524
 
1524
1525
  // src/utils/getOverrides.ts
1525
1526
  function getOverrides(options, key) {
1526
- const sub = resolveSubOptions(options, key);
1527
- return "overrides" in sub && sub.overrides ? sub.overrides : {};
1527
+ const subOptions = resolveSubOptions(options, key);
1528
+ return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
1528
1529
  }
1529
1530
 
1530
1531
  // src/utils/mergePrettierOptions.ts
@@ -1845,73 +1846,93 @@ var unicorn = (options = {}) => [
1845
1846
 
1846
1847
  // src/configs/specials.ts
1847
1848
  import globals from "globals";
1848
- var specials = (options = {}) => [
1849
- {
1850
- name: "ntnyq/specials/scripts",
1851
- files: [`**/scripts/${GLOB_SRC}`],
1852
- rules: {
1853
- "no-console": "off",
1854
- "@typescript-eslint/explicit-function-return-type": "off",
1855
- // Overrides rules
1856
- ...options.overridesScriptsRules
1857
- }
1858
- },
1859
- {
1860
- name: "ntnyq/specials/cli",
1861
- files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
1862
- rules: {
1863
- "no-console": "off",
1864
- "@typescript-eslint/explicit-function-return-type": "off",
1865
- // Overrides rules
1866
- ...options.overridesCliRules
1867
- }
1868
- },
1869
- {
1870
- name: "ntnyq/specials/userscript",
1871
- files: [`**/*.user.${GLOB_SRC_EXT}`],
1872
- languageOptions: {
1873
- globals: {
1874
- ...globals.greasemonkey
1849
+ var specials = (options = {}) => {
1850
+ const {
1851
+ // Enable shadcn-vue support
1852
+ shadcnVue: enableShadcnVue = hasShadcnVue
1853
+ } = options;
1854
+ const configs2 = [
1855
+ {
1856
+ name: "ntnyq/specials/scripts",
1857
+ files: [`**/scripts/${GLOB_SRC}`],
1858
+ rules: {
1859
+ "no-console": "off",
1860
+ "@typescript-eslint/explicit-function-return-type": "off",
1861
+ // Overrides rules
1862
+ ...options.overridesScriptsRules
1875
1863
  }
1876
1864
  },
1877
- rules: {
1878
- camelcase: [
1879
- "error",
1880
- {
1881
- allow: ["^GM_.+"]
1882
- }
1883
- ],
1884
- // Overrides rules
1885
- ...options.overridesUserScriptsRules
1886
- }
1887
- },
1888
- {
1889
- name: "ntnyq/specials/config-file",
1890
- files: [`**/*.config*.${GLOB_SRC_EXT}`],
1891
- plugins: {
1892
- "import-x": default18,
1893
- perfectionist: default22
1865
+ {
1866
+ name: "ntnyq/specials/cli",
1867
+ files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
1868
+ rules: {
1869
+ "no-console": "off",
1870
+ "@typescript-eslint/explicit-function-return-type": "off",
1871
+ // Overrides rules
1872
+ ...options.overridesCliRules
1873
+ }
1894
1874
  },
1895
- rules: {
1896
- "no-console": "off",
1897
- "import-x/no-default-export": "off",
1898
- "@typescript-eslint/explicit-function-return-type": "off",
1899
- "perfectionist/sort-objects": [
1900
- "error",
1901
- {
1902
- type: "alphabetical",
1903
- order: "asc",
1904
- partitionByComment: true,
1905
- groups: ["unknown", "method", "multiline"]
1875
+ {
1876
+ name: "ntnyq/specials/userscript",
1877
+ files: [`**/*.user.${GLOB_SRC_EXT}`],
1878
+ languageOptions: {
1879
+ globals: {
1880
+ ...globals.greasemonkey
1906
1881
  }
1907
- ],
1908
- ...options.overridesConfigFileRules
1882
+ },
1883
+ rules: {
1884
+ camelcase: [
1885
+ "error",
1886
+ {
1887
+ allow: ["^GM_.+"]
1888
+ }
1889
+ ],
1890
+ // Overrides rules
1891
+ ...options.overridesUserScriptsRules
1892
+ }
1893
+ },
1894
+ {
1895
+ name: "ntnyq/specials/config-file",
1896
+ files: [`**/*.config*.${GLOB_SRC_EXT}`],
1897
+ plugins: {
1898
+ "import-x": default18,
1899
+ perfectionist: default22
1900
+ },
1901
+ rules: {
1902
+ "no-console": "off",
1903
+ "import-x/no-default-export": "off",
1904
+ "@typescript-eslint/explicit-function-return-type": "off",
1905
+ "perfectionist/sort-objects": [
1906
+ "error",
1907
+ {
1908
+ type: "alphabetical",
1909
+ order: "asc",
1910
+ partitionByComment: true,
1911
+ groups: ["unknown", "method", "multiline"]
1912
+ }
1913
+ ],
1914
+ ...options.overridesConfigFileRules
1915
+ }
1909
1916
  }
1910
- },
1911
- // More special case configs
1912
- // So don't need to append configs to composer
1913
- ...options.specialCaseConfigs ? options.specialCaseConfigs : []
1914
- ];
1917
+ ];
1918
+ if (enableShadcnVue) {
1919
+ const shadcnOptions = resolveSubOptions(options, "shadcnVue");
1920
+ configs2.push({
1921
+ name: "ntnyq/specials/shadcn-vue",
1922
+ files: shadcnOptions.files || ["**/components/ui/**/*.ts", "**/components/ui/**/*.vue"],
1923
+ rules: {
1924
+ "@typescript-eslint/no-unused-vars": "off",
1925
+ "@typescript-eslint/consistent-type-imports": "off",
1926
+ // Overrides rules
1927
+ ...shadcnOptions.overridesRules
1928
+ }
1929
+ });
1930
+ }
1931
+ if (options.specialCaseConfigs) {
1932
+ configs2.push(...options.specialCaseConfigs);
1933
+ }
1934
+ return configs2;
1935
+ };
1915
1936
 
1916
1937
  // src/configs/comments.ts
1917
1938
  var comments = (options = {}) => [
@@ -2436,11 +2457,24 @@ var typescript = (options = {}) => {
2436
2457
  files,
2437
2458
  rules: {
2438
2459
  ...recommendedRules,
2439
- // Disabled in favor of ts rules
2460
+ "@typescript-eslint/no-namespace": "off",
2461
+ "@typescript-eslint/no-explicit-any": "off",
2462
+ "@typescript-eslint/naming-convention": "off",
2463
+ "@typescript-eslint/no-empty-function": "off",
2464
+ "@typescript-eslint/no-non-null-assertion": "off",
2465
+ "@typescript-eslint/triple-slash-reference": "off",
2466
+ "@typescript-eslint/explicit-member-accessibility": "off",
2467
+ "@typescript-eslint/explicit-function-return-type": "off",
2468
+ "@typescript-eslint/explicit-module-boundary-types": "off",
2469
+ "@typescript-eslint/consistent-indexed-object-style": "off",
2470
+ "@typescript-eslint/prefer-as-const": "warn",
2471
+ // Disabled in favor of enhanced ts rules
2440
2472
  "no-redeclare": "off",
2441
2473
  "no-unused-vars": "off",
2474
+ "default-param-last": "off",
2442
2475
  "no-use-before-define": "off",
2443
2476
  "no-useless-constructor": "off",
2477
+ "@typescript-eslint/default-param-last": "error",
2444
2478
  "@typescript-eslint/no-useless-constructor": "error",
2445
2479
  "@typescript-eslint/no-redeclare": [
2446
2480
  "error",
@@ -2474,6 +2508,19 @@ var typescript = (options = {}) => {
2474
2508
  ignoreRestSiblings: true
2475
2509
  }
2476
2510
  ],
2511
+ // Extra rules
2512
+ "@typescript-eslint/ban-tslint-comment": "error",
2513
+ "@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
2514
+ "@typescript-eslint/ban-ts-comment": [
2515
+ "error",
2516
+ {
2517
+ minimumDescriptionLength: 1,
2518
+ "ts-check": false,
2519
+ "ts-expect-error": "allow-with-description",
2520
+ "ts-ignore": "allow-with-description",
2521
+ "ts-nocheck": "allow-with-description"
2522
+ }
2523
+ ],
2477
2524
  "@typescript-eslint/no-unused-expressions": [
2478
2525
  "error",
2479
2526
  {
@@ -2504,18 +2551,6 @@ var typescript = (options = {}) => {
2504
2551
  objectLiteralTypeAssertions: "allow-as-parameter"
2505
2552
  }
2506
2553
  ],
2507
- "@typescript-eslint/prefer-as-const": "warn",
2508
- "@typescript-eslint/no-namespace": "off",
2509
- "@typescript-eslint/ban-ts-comment": "off",
2510
- "@typescript-eslint/no-explicit-any": "off",
2511
- "@typescript-eslint/no-empty-function": "off",
2512
- "@typescript-eslint/naming-convention": "off",
2513
- "@typescript-eslint/no-non-null-assertion": "off",
2514
- "@typescript-eslint/triple-slash-reference": "off",
2515
- "@typescript-eslint/explicit-member-accessibility": "off",
2516
- "@typescript-eslint/explicit-function-return-type": "off",
2517
- "@typescript-eslint/explicit-module-boundary-types": "off",
2518
- "@typescript-eslint/consistent-indexed-object-style": "off",
2519
2554
  // Overrides rules
2520
2555
  ...options.overrides
2521
2556
  }
@@ -3182,6 +3217,7 @@ export {
3182
3217
  githubAction,
3183
3218
  gitignore,
3184
3219
  hasPinia,
3220
+ hasShadcnVue,
3185
3221
  hasTypeScript,
3186
3222
  hasUnoCSS,
3187
3223
  hasVitest,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "3.10.4",
4
+ "version": "3.11.0",
5
5
  "packageManager": "pnpm@9.15.2",
6
6
  "description": "An opinionated ESLint config preset of ntnyq",
7
7
  "keywords": [
@@ -60,7 +60,7 @@
60
60
  "@eslint/markdown": "^6.2.1",
61
61
  "@stylistic/eslint-plugin": "^2.12.1",
62
62
  "@unocss/eslint-plugin": "^0.65.3",
63
- "@vitest/eslint-plugin": "^1.1.21",
63
+ "@vitest/eslint-plugin": "^1.1.22",
64
64
  "eslint-config-flat-gitignore": "^0.3.0",
65
65
  "eslint-flat-config-utils": "^0.4.0",
66
66
  "eslint-import-resolver-typescript": "^3.7.0",
@@ -92,7 +92,7 @@
92
92
  "local-pkg": "^0.5.1",
93
93
  "prettier": "^3.4.2",
94
94
  "toml-eslint-parser": "^0.10.0",
95
- "typescript-eslint": "^8.18.2",
95
+ "typescript-eslint": "^8.19.0",
96
96
  "vue-eslint-parser": "^9.4.3",
97
97
  "yaml-eslint-parser": "^1.2.3"
98
98
  },