@ntnyq/eslint-config 3.10.3 → 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,
@@ -1133,20 +1134,24 @@ var test = (options = {}) => [
1133
1134
  }
1134
1135
  }
1135
1136
  ];
1136
- var vitest = (options = {}) => [
1137
- {
1138
- name: "ntnyq/vitest",
1139
- plugins: {
1140
- vitest: import_eslint_plugin2.default
1141
- },
1142
- files: [...GLOB_TEST],
1143
- rules: {
1144
- ...import_eslint_plugin2.default.configs.recommended.rules,
1145
- // Overrides rules
1146
- ...options.overridesVitestRules
1137
+ var vitest = (options = {}) => {
1138
+ if (!import_eslint_plugin2.default.configs?.recommended) return [];
1139
+ const vitestConfigs = import_eslint_plugin2.default.configs;
1140
+ return [
1141
+ {
1142
+ name: "ntnyq/vitest",
1143
+ plugins: {
1144
+ vitest: import_eslint_plugin2.default
1145
+ },
1146
+ files: [...GLOB_TEST],
1147
+ rules: {
1148
+ ...vitestConfigs.recommended.rules,
1149
+ // Overrides rules
1150
+ ...options.overridesVitestRules
1151
+ }
1147
1152
  }
1148
- }
1149
- ];
1153
+ ];
1154
+ };
1150
1155
 
1151
1156
  // src/configs/svgo.ts
1152
1157
  var import_eslint_plugin_svgo2 = require("eslint-plugin-svgo");
@@ -1641,6 +1646,7 @@ var import_node_process = __toESM(require("process"), 1);
1641
1646
  var import_local_pkg = require("local-pkg");
1642
1647
  var hasTypeScript = (0, import_local_pkg.isPackageExists)("typescript");
1643
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");
1644
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", {
1645
1651
  paths: [(0, import_node_path.resolve)(import_node_process.default.cwd(), "playground")]
1646
1652
  });
@@ -1675,8 +1681,8 @@ function resolveSubOptions(options, key) {
1675
1681
 
1676
1682
  // src/utils/getOverrides.ts
1677
1683
  function getOverrides(options, key) {
1678
- const sub = resolveSubOptions(options, key);
1679
- return "overrides" in sub && sub.overrides ? sub.overrides : {};
1684
+ const subOptions = resolveSubOptions(options, key);
1685
+ return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
1680
1686
  }
1681
1687
 
1682
1688
  // src/utils/mergePrettierOptions.ts
@@ -1997,73 +2003,93 @@ var unicorn = (options = {}) => [
1997
2003
 
1998
2004
  // src/configs/specials.ts
1999
2005
  var import_globals = __toESM(require("globals"), 1);
2000
- var specials = (options = {}) => [
2001
- {
2002
- name: "ntnyq/specials/scripts",
2003
- files: [`**/scripts/${GLOB_SRC}`],
2004
- rules: {
2005
- "no-console": "off",
2006
- "@typescript-eslint/explicit-function-return-type": "off",
2007
- // Overrides rules
2008
- ...options.overridesScriptsRules
2009
- }
2010
- },
2011
- {
2012
- name: "ntnyq/specials/cli",
2013
- files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
2014
- rules: {
2015
- "no-console": "off",
2016
- "@typescript-eslint/explicit-function-return-type": "off",
2017
- // Overrides rules
2018
- ...options.overridesCliRules
2019
- }
2020
- },
2021
- {
2022
- name: "ntnyq/specials/userscript",
2023
- files: [`**/*.user.${GLOB_SRC_EXT}`],
2024
- languageOptions: {
2025
- globals: {
2026
- ...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
2027
2020
  }
2028
2021
  },
2029
- rules: {
2030
- camelcase: [
2031
- "error",
2032
- {
2033
- allow: ["^GM_.+"]
2034
- }
2035
- ],
2036
- // Overrides rules
2037
- ...options.overridesUserScriptsRules
2038
- }
2039
- },
2040
- {
2041
- name: "ntnyq/specials/config-file",
2042
- files: [`**/*.config*.${GLOB_SRC_EXT}`],
2043
- plugins: {
2044
- "import-x": import_eslint_plugin_import_x.default,
2045
- 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
+ }
2046
2031
  },
2047
- rules: {
2048
- "no-console": "off",
2049
- "import-x/no-default-export": "off",
2050
- "@typescript-eslint/explicit-function-return-type": "off",
2051
- "perfectionist/sort-objects": [
2052
- "error",
2053
- {
2054
- type: "alphabetical",
2055
- order: "asc",
2056
- partitionByComment: true,
2057
- 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
2058
2038
  }
2059
- ],
2060
- ...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
+ }
2061
2073
  }
2062
- },
2063
- // More special case configs
2064
- // So don't need to append configs to composer
2065
- ...options.specialCaseConfigs ? options.specialCaseConfigs : []
2066
- ];
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
+ };
2067
2093
 
2068
2094
  // src/configs/comments.ts
2069
2095
  var comments = (options = {}) => [
@@ -2084,12 +2110,27 @@ var comments = (options = {}) => [
2084
2110
  // src/configs/markdown.ts
2085
2111
  var markdown = (options = {}) => {
2086
2112
  if (!Array.isArray(import_markdown.default.configs?.processor)) return [];
2087
- const { files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`], extensions = [] } = options;
2113
+ const {
2114
+ /**
2115
+ * code block files
2116
+ */
2117
+ files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`],
2118
+ /**
2119
+ * other extensions
2120
+ */
2121
+ extensions = []
2122
+ } = options;
2088
2123
  return [
2124
+ /**
2125
+ * extracting code blocks to be linted individually
2126
+ */
2089
2127
  ...import_markdown.default.configs.processor.map((config) => ({
2090
2128
  ...config,
2091
2129
  name: `ntnyq/${config.name}`
2092
2130
  })),
2131
+ /**
2132
+ * enhance `markdown/recommended/processor`
2133
+ */
2093
2134
  {
2094
2135
  name: "ntnyq/markdown/processor",
2095
2136
  files,
@@ -2573,10 +2614,25 @@ var typescript = (options = {}) => {
2573
2614
  files,
2574
2615
  rules: {
2575
2616
  ...recommendedRules,
2576
- // 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
2577
2629
  "no-redeclare": "off",
2578
- "no-use-before-define": "off",
2579
2630
  "no-unused-vars": "off",
2631
+ "default-param-last": "off",
2632
+ "no-use-before-define": "off",
2633
+ "no-useless-constructor": "off",
2634
+ "@typescript-eslint/default-param-last": "error",
2635
+ "@typescript-eslint/no-useless-constructor": "error",
2580
2636
  "@typescript-eslint/no-redeclare": [
2581
2637
  "error",
2582
2638
  {
@@ -2609,6 +2665,19 @@ var typescript = (options = {}) => {
2609
2665
  ignoreRestSiblings: true
2610
2666
  }
2611
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
+ ],
2612
2681
  "@typescript-eslint/no-unused-expressions": [
2613
2682
  "error",
2614
2683
  {
@@ -2639,18 +2708,6 @@ var typescript = (options = {}) => {
2639
2708
  objectLiteralTypeAssertions: "allow-as-parameter"
2640
2709
  }
2641
2710
  ],
2642
- "@typescript-eslint/prefer-as-const": "warn",
2643
- "@typescript-eslint/no-namespace": "off",
2644
- "@typescript-eslint/ban-ts-comment": "off",
2645
- "@typescript-eslint/no-explicit-any": "off",
2646
- "@typescript-eslint/no-empty-function": "off",
2647
- "@typescript-eslint/naming-convention": "off",
2648
- "@typescript-eslint/no-non-null-assertion": "off",
2649
- "@typescript-eslint/triple-slash-reference": "off",
2650
- "@typescript-eslint/explicit-member-accessibility": "off",
2651
- "@typescript-eslint/explicit-function-return-type": "off",
2652
- "@typescript-eslint/explicit-module-boundary-types": "off",
2653
- "@typescript-eslint/consistent-indexed-object-style": "off",
2654
2711
  // Overrides rules
2655
2712
  ...options.overrides
2656
2713
  }
@@ -3318,6 +3375,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3318
3375
  githubAction,
3319
3376
  gitignore,
3320
3377
  hasPinia,
3378
+ hasShadcnVue,
3321
3379
  hasTypeScript,
3322
3380
  hasUnoCSS,
3323
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';
@@ -5099,6 +5098,11 @@ interface RuleOptions {
5099
5098
  * @deprecated
5100
5099
  */
5101
5100
  'nonblock-statement-body-position'?: Linter.RuleEntry<NonblockStatementBodyPosition>;
5101
+ /**
5102
+ * disallow duplicate exports statement
5103
+ * @see https://eslint-plugin.ntnyq.com/rules/no-duplicate-exports.html
5104
+ */
5105
+ 'ntnyq/no-duplicate-exports'?: Linter.RuleEntry<NtnyqNoDuplicateExports>;
5102
5106
  /**
5103
5107
  * disallow usage of typescript member accessibility
5104
5108
  * @see https://eslint-plugin.ntnyq.com/rules/no-member-accessibility.html
@@ -6949,7 +6953,7 @@ interface RuleOptions {
6949
6953
  */
6950
6954
  'vitest/padding-around-expect-groups'?: Linter.RuleEntry<[]>;
6951
6955
  /**
6952
- * Enforce padding around afterAll blocks
6956
+ * Enforce padding around `test` blocks
6953
6957
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
6954
6958
  */
6955
6959
  'vitest/padding-around-test-blocks'?: Linter.RuleEntry<[]>;
@@ -14157,6 +14161,11 @@ type NonblockStatementBodyPosition = [] | [("beside" | "below" | "any")] | [
14157
14161
  };
14158
14162
  }
14159
14163
  ];
14164
+ type NtnyqNoDuplicateExports = [] | [
14165
+ {
14166
+ style?: ("inline" | "separate");
14167
+ }
14168
+ ];
14160
14169
  type ObjectCurlyNewline = [] | [
14161
14170
  ((("always" | "never") | {
14162
14171
  multiline?: boolean;
@@ -15987,8 +15996,7 @@ type VitestNoRestrictedViMethods = [] | [
15987
15996
  ];
15988
15997
  type VitestNoStandaloneExpect = [] | [
15989
15998
  {
15990
- additionaltestblockfunctions?: string[];
15991
- [k: string]: unknown | undefined;
15999
+ additionalTestBlockFunctions?: string[];
15992
16000
  }
15993
16001
  ];
15994
16002
  type VitestPreferExpectAssertions = [] | [
@@ -17836,6 +17844,13 @@ interface ConfigSpecialsOptions {
17836
17844
  * More special case configs
17837
17845
  */
17838
17846
  specialCaseConfigs?: TypedConfigItem[];
17847
+ /**
17848
+ * ShadcnVue config
17849
+ */
17850
+ shadcnVue?: boolean | {
17851
+ files?: TypedConfigItem['files'];
17852
+ overridesRules?: TypedConfigItem['rules'];
17853
+ };
17839
17854
  }
17840
17855
  interface ConfigStylisticOptions extends OptionsOverrides {
17841
17856
  }
@@ -18033,6 +18048,7 @@ declare const GLOB_EXCLUDE: string[];
18033
18048
 
18034
18049
  declare const hasTypeScript: boolean;
18035
18050
  declare const hasVitest: boolean;
18051
+ declare const hasShadcnVue: boolean;
18036
18052
  declare const hasVue: boolean;
18037
18053
  declare const hasPinia: boolean;
18038
18054
  declare const hasUnoCSS: boolean;
@@ -18055,7 +18071,7 @@ declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOpti
18055
18071
  */
18056
18072
  declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
18057
18073
 
18058
- 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]>>;
18059
18075
 
18060
18076
  /**
18061
18077
  * @file Merge prettier options
@@ -18063,12 +18079,24 @@ declare function resolveSubOptions<K extends keyof ConfigOptions>(options: Confi
18063
18079
 
18064
18080
  declare function mergePrettierOptions(options?: PrettierOptions, overrides?: PrettierOptions): PrettierOptions;
18065
18081
 
18082
+ /**
18083
+ * @file ESLint parsers
18084
+ */
18085
+
18066
18086
  /**
18067
18087
  * With meta
18068
18088
  */
18069
18089
  declare const parserTypeScript: {
18070
- meta?: { [K in keyof _typescript_eslint_utils_ts_eslint.Parser.ParserMeta]?: _typescript_eslint_utils_ts_eslint.Parser.ParserMeta[K] | undefined; };
18071
- 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
+ };
18072
18100
  };
18073
18101
 
18074
18102
  /**
@@ -18163,4 +18191,4 @@ declare const unusedImports: (options?: ConfigUnusedImportsOptions) => TypedConf
18163
18191
  */
18164
18192
  declare const DEFAULT_PRETTIER_OPTIONS: PrettierOptions;
18165
18193
 
18166
- 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';
@@ -5099,6 +5098,11 @@ interface RuleOptions {
5099
5098
  * @deprecated
5100
5099
  */
5101
5100
  'nonblock-statement-body-position'?: Linter.RuleEntry<NonblockStatementBodyPosition>;
5101
+ /**
5102
+ * disallow duplicate exports statement
5103
+ * @see https://eslint-plugin.ntnyq.com/rules/no-duplicate-exports.html
5104
+ */
5105
+ 'ntnyq/no-duplicate-exports'?: Linter.RuleEntry<NtnyqNoDuplicateExports>;
5102
5106
  /**
5103
5107
  * disallow usage of typescript member accessibility
5104
5108
  * @see https://eslint-plugin.ntnyq.com/rules/no-member-accessibility.html
@@ -6949,7 +6953,7 @@ interface RuleOptions {
6949
6953
  */
6950
6954
  'vitest/padding-around-expect-groups'?: Linter.RuleEntry<[]>;
6951
6955
  /**
6952
- * Enforce padding around afterAll blocks
6956
+ * Enforce padding around `test` blocks
6953
6957
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
6954
6958
  */
6955
6959
  'vitest/padding-around-test-blocks'?: Linter.RuleEntry<[]>;
@@ -14157,6 +14161,11 @@ type NonblockStatementBodyPosition = [] | [("beside" | "below" | "any")] | [
14157
14161
  };
14158
14162
  }
14159
14163
  ];
14164
+ type NtnyqNoDuplicateExports = [] | [
14165
+ {
14166
+ style?: ("inline" | "separate");
14167
+ }
14168
+ ];
14160
14169
  type ObjectCurlyNewline = [] | [
14161
14170
  ((("always" | "never") | {
14162
14171
  multiline?: boolean;
@@ -15987,8 +15996,7 @@ type VitestNoRestrictedViMethods = [] | [
15987
15996
  ];
15988
15997
  type VitestNoStandaloneExpect = [] | [
15989
15998
  {
15990
- additionaltestblockfunctions?: string[];
15991
- [k: string]: unknown | undefined;
15999
+ additionalTestBlockFunctions?: string[];
15992
16000
  }
15993
16001
  ];
15994
16002
  type VitestPreferExpectAssertions = [] | [
@@ -17836,6 +17844,13 @@ interface ConfigSpecialsOptions {
17836
17844
  * More special case configs
17837
17845
  */
17838
17846
  specialCaseConfigs?: TypedConfigItem[];
17847
+ /**
17848
+ * ShadcnVue config
17849
+ */
17850
+ shadcnVue?: boolean | {
17851
+ files?: TypedConfigItem['files'];
17852
+ overridesRules?: TypedConfigItem['rules'];
17853
+ };
17839
17854
  }
17840
17855
  interface ConfigStylisticOptions extends OptionsOverrides {
17841
17856
  }
@@ -18033,6 +18048,7 @@ declare const GLOB_EXCLUDE: string[];
18033
18048
 
18034
18049
  declare const hasTypeScript: boolean;
18035
18050
  declare const hasVitest: boolean;
18051
+ declare const hasShadcnVue: boolean;
18036
18052
  declare const hasVue: boolean;
18037
18053
  declare const hasPinia: boolean;
18038
18054
  declare const hasUnoCSS: boolean;
@@ -18055,7 +18071,7 @@ declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOpti
18055
18071
  */
18056
18072
  declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
18057
18073
 
18058
- 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]>>;
18059
18075
 
18060
18076
  /**
18061
18077
  * @file Merge prettier options
@@ -18063,12 +18079,24 @@ declare function resolveSubOptions<K extends keyof ConfigOptions>(options: Confi
18063
18079
 
18064
18080
  declare function mergePrettierOptions(options?: PrettierOptions, overrides?: PrettierOptions): PrettierOptions;
18065
18081
 
18082
+ /**
18083
+ * @file ESLint parsers
18084
+ */
18085
+
18066
18086
  /**
18067
18087
  * With meta
18068
18088
  */
18069
18089
  declare const parserTypeScript: {
18070
- meta?: { [K in keyof _typescript_eslint_utils_ts_eslint.Parser.ParserMeta]?: _typescript_eslint_utils_ts_eslint.Parser.ParserMeta[K] | undefined; };
18071
- 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
+ };
18072
18100
  };
18073
18101
 
18074
18102
  /**
@@ -18163,4 +18191,4 @@ declare const unusedImports: (options?: ConfigUnusedImportsOptions) => TypedConf
18163
18191
  */
18164
18192
  declare const DEFAULT_PRETTIER_OPTIONS: PrettierOptions;
18165
18193
 
18166
- 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
@@ -977,20 +977,24 @@ var test = (options = {}) => [
977
977
  }
978
978
  }
979
979
  ];
980
- var vitest = (options = {}) => [
981
- {
982
- name: "ntnyq/vitest",
983
- plugins: {
984
- vitest: default16
985
- },
986
- files: [...GLOB_TEST],
987
- rules: {
988
- ...default16.configs.recommended.rules,
989
- // Overrides rules
990
- ...options.overridesVitestRules
980
+ var vitest = (options = {}) => {
981
+ if (!default16.configs?.recommended) return [];
982
+ const vitestConfigs = default16.configs;
983
+ return [
984
+ {
985
+ name: "ntnyq/vitest",
986
+ plugins: {
987
+ vitest: default16
988
+ },
989
+ files: [...GLOB_TEST],
990
+ rules: {
991
+ ...vitestConfigs.recommended.rules,
992
+ // Overrides rules
993
+ ...options.overridesVitestRules
994
+ }
991
995
  }
992
- }
993
- ];
996
+ ];
997
+ };
994
998
 
995
999
  // src/configs/svgo.ts
996
1000
  import { config as createSVGOConfig } from "eslint-plugin-svgo";
@@ -1485,6 +1489,7 @@ import process from "node:process";
1485
1489
  import { isPackageExists } from "local-pkg";
1486
1490
  var hasTypeScript = isPackageExists("typescript");
1487
1491
  var hasVitest = isPackageExists("vitest");
1492
+ var hasShadcnVue = isPackageExists("radix-vue") && isPackageExists("clsx");
1488
1493
  var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli") || isPackageExists("vue", {
1489
1494
  paths: [resolve(process.cwd(), "playground")]
1490
1495
  });
@@ -1519,8 +1524,8 @@ function resolveSubOptions(options, key) {
1519
1524
 
1520
1525
  // src/utils/getOverrides.ts
1521
1526
  function getOverrides(options, key) {
1522
- const sub = resolveSubOptions(options, key);
1523
- return "overrides" in sub && sub.overrides ? sub.overrides : {};
1527
+ const subOptions = resolveSubOptions(options, key);
1528
+ return "overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {};
1524
1529
  }
1525
1530
 
1526
1531
  // src/utils/mergePrettierOptions.ts
@@ -1841,73 +1846,93 @@ var unicorn = (options = {}) => [
1841
1846
 
1842
1847
  // src/configs/specials.ts
1843
1848
  import globals from "globals";
1844
- var specials = (options = {}) => [
1845
- {
1846
- name: "ntnyq/specials/scripts",
1847
- files: [`**/scripts/${GLOB_SRC}`],
1848
- rules: {
1849
- "no-console": "off",
1850
- "@typescript-eslint/explicit-function-return-type": "off",
1851
- // Overrides rules
1852
- ...options.overridesScriptsRules
1853
- }
1854
- },
1855
- {
1856
- name: "ntnyq/specials/cli",
1857
- files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
1858
- rules: {
1859
- "no-console": "off",
1860
- "@typescript-eslint/explicit-function-return-type": "off",
1861
- // Overrides rules
1862
- ...options.overridesCliRules
1863
- }
1864
- },
1865
- {
1866
- name: "ntnyq/specials/userscript",
1867
- files: [`**/*.user.${GLOB_SRC_EXT}`],
1868
- languageOptions: {
1869
- globals: {
1870
- ...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
1871
1863
  }
1872
1864
  },
1873
- rules: {
1874
- camelcase: [
1875
- "error",
1876
- {
1877
- allow: ["^GM_.+"]
1878
- }
1879
- ],
1880
- // Overrides rules
1881
- ...options.overridesUserScriptsRules
1882
- }
1883
- },
1884
- {
1885
- name: "ntnyq/specials/config-file",
1886
- files: [`**/*.config*.${GLOB_SRC_EXT}`],
1887
- plugins: {
1888
- "import-x": default18,
1889
- 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
+ }
1890
1874
  },
1891
- rules: {
1892
- "no-console": "off",
1893
- "import-x/no-default-export": "off",
1894
- "@typescript-eslint/explicit-function-return-type": "off",
1895
- "perfectionist/sort-objects": [
1896
- "error",
1897
- {
1898
- type: "alphabetical",
1899
- order: "asc",
1900
- partitionByComment: true,
1901
- groups: ["unknown", "method", "multiline"]
1875
+ {
1876
+ name: "ntnyq/specials/userscript",
1877
+ files: [`**/*.user.${GLOB_SRC_EXT}`],
1878
+ languageOptions: {
1879
+ globals: {
1880
+ ...globals.greasemonkey
1902
1881
  }
1903
- ],
1904
- ...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
+ }
1905
1916
  }
1906
- },
1907
- // More special case configs
1908
- // So don't need to append configs to composer
1909
- ...options.specialCaseConfigs ? options.specialCaseConfigs : []
1910
- ];
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
+ };
1911
1936
 
1912
1937
  // src/configs/comments.ts
1913
1938
  var comments = (options = {}) => [
@@ -1928,12 +1953,27 @@ var comments = (options = {}) => [
1928
1953
  // src/configs/markdown.ts
1929
1954
  var markdown = (options = {}) => {
1930
1955
  if (!Array.isArray(default10.configs?.processor)) return [];
1931
- const { files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`], extensions = [] } = options;
1956
+ const {
1957
+ /**
1958
+ * code block files
1959
+ */
1960
+ files = [`${GLOB_MARKDOWN}/${GLOB_SRC}`],
1961
+ /**
1962
+ * other extensions
1963
+ */
1964
+ extensions = []
1965
+ } = options;
1932
1966
  return [
1967
+ /**
1968
+ * extracting code blocks to be linted individually
1969
+ */
1933
1970
  ...default10.configs.processor.map((config) => ({
1934
1971
  ...config,
1935
1972
  name: `ntnyq/${config.name}`
1936
1973
  })),
1974
+ /**
1975
+ * enhance `markdown/recommended/processor`
1976
+ */
1937
1977
  {
1938
1978
  name: "ntnyq/markdown/processor",
1939
1979
  files,
@@ -2417,10 +2457,25 @@ var typescript = (options = {}) => {
2417
2457
  files,
2418
2458
  rules: {
2419
2459
  ...recommendedRules,
2420
- // 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
2421
2472
  "no-redeclare": "off",
2422
- "no-use-before-define": "off",
2423
2473
  "no-unused-vars": "off",
2474
+ "default-param-last": "off",
2475
+ "no-use-before-define": "off",
2476
+ "no-useless-constructor": "off",
2477
+ "@typescript-eslint/default-param-last": "error",
2478
+ "@typescript-eslint/no-useless-constructor": "error",
2424
2479
  "@typescript-eslint/no-redeclare": [
2425
2480
  "error",
2426
2481
  {
@@ -2453,6 +2508,19 @@ var typescript = (options = {}) => {
2453
2508
  ignoreRestSiblings: true
2454
2509
  }
2455
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
+ ],
2456
2524
  "@typescript-eslint/no-unused-expressions": [
2457
2525
  "error",
2458
2526
  {
@@ -2483,18 +2551,6 @@ var typescript = (options = {}) => {
2483
2551
  objectLiteralTypeAssertions: "allow-as-parameter"
2484
2552
  }
2485
2553
  ],
2486
- "@typescript-eslint/prefer-as-const": "warn",
2487
- "@typescript-eslint/no-namespace": "off",
2488
- "@typescript-eslint/ban-ts-comment": "off",
2489
- "@typescript-eslint/no-explicit-any": "off",
2490
- "@typescript-eslint/no-empty-function": "off",
2491
- "@typescript-eslint/naming-convention": "off",
2492
- "@typescript-eslint/no-non-null-assertion": "off",
2493
- "@typescript-eslint/triple-slash-reference": "off",
2494
- "@typescript-eslint/explicit-member-accessibility": "off",
2495
- "@typescript-eslint/explicit-function-return-type": "off",
2496
- "@typescript-eslint/explicit-module-boundary-types": "off",
2497
- "@typescript-eslint/consistent-indexed-object-style": "off",
2498
2554
  // Overrides rules
2499
2555
  ...options.overrides
2500
2556
  }
@@ -3161,6 +3217,7 @@ export {
3161
3217
  githubAction,
3162
3218
  gitignore,
3163
3219
  hasPinia,
3220
+ hasShadcnVue,
3164
3221
  hasTypeScript,
3165
3222
  hasUnoCSS,
3166
3223
  hasVitest,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "3.10.3",
5
- "packageManager": "pnpm@9.15.1",
4
+ "version": "3.11.0",
5
+ "packageManager": "pnpm@9.15.2",
6
6
  "description": "An opinionated ESLint config preset of ntnyq",
7
7
  "keywords": [
8
8
  "eslint",
@@ -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.20",
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",
@@ -75,7 +75,7 @@
75
75
  "eslint-plugin-jsdoc": "^50.6.1",
76
76
  "eslint-plugin-jsonc": "^2.18.2",
77
77
  "eslint-plugin-n": "^17.15.1",
78
- "eslint-plugin-ntnyq": "^0.7.1",
78
+ "eslint-plugin-ntnyq": "^0.8.2",
79
79
  "eslint-plugin-perfectionist": "^4.4.0",
80
80
  "eslint-plugin-pinia": "^0.4.1",
81
81
  "eslint-plugin-prettier": "^5.2.1",
@@ -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
  },