@ntnyq/eslint-config 2.6.3 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -90,12 +90,6 @@ __export(src_exports, {
90
90
  pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
91
91
  pluginVue: () => import_eslint_plugin_vue.default,
92
92
  pluginYaml: () => import_eslint_plugin_yml.default,
93
- presetAll: () => presetAll,
94
- presetBasic: () => presetBasic,
95
- presetCommon: () => presetCommon,
96
- presetJavaScript: () => presetJavaScript,
97
- presetJsonc: () => presetJsonc,
98
- presetLanguageExtensions: () => presetLanguageExtensions,
99
93
  prettier: () => prettier,
100
94
  regexp: () => regexp,
101
95
  sortPackageJson: () => sortPackageJson,
@@ -179,7 +173,8 @@ var GLOB_LOCKFILE = [
179
173
  "**/package-lock.json",
180
174
  "**/yarn.lock",
181
175
  "**/pnpm-lock.yaml",
182
- "**/bun.lockb"
176
+ "**/bun.lockb",
177
+ "**/deno.lock"
183
178
  ];
184
179
  var GLOB_EXCLUDE = [
185
180
  GLOB_NODE_MODULES,
@@ -200,12 +195,14 @@ var GLOB_EXCLUDE = [
200
195
  "**/components.d.ts",
201
196
  // unplugin-vue-router
202
197
  "**/typed-router.d.ts",
198
+ // vite-plugin-uni-pages
199
+ "**/uni-pages.d.ts",
203
200
  "**/coverage",
204
201
  "**/fixtures",
205
202
  "**/output",
206
203
  "**/public",
207
204
  "**/static",
208
- // VitePress VuePress
205
+ // VitePress and VuePress
209
206
  "**/?(.)temp",
210
207
  "**/?(.)cache",
211
208
  "**/.eslintcache",
@@ -434,6 +431,19 @@ var prettier = defineConfig([
434
431
  ...import_eslint_plugin_prettier.default.configs.recommended.rules,
435
432
  "prettier/prettier": "warn"
436
433
  }
434
+ },
435
+ /**
436
+ * Languages that prettier currently does not support
437
+ */
438
+ {
439
+ name: "ntnyq/prettier/ignore",
440
+ files: [GLOB_TOML],
441
+ plugins: {
442
+ prettier: import_eslint_plugin_prettier.default
443
+ },
444
+ rules: {
445
+ "prettier/prettier": "off"
446
+ }
437
447
  }
438
448
  ]);
439
449
 
@@ -1015,8 +1025,6 @@ var toml = defineConfig([
1015
1025
  toml: import_eslint_plugin_toml.default
1016
1026
  },
1017
1027
  rules: {
1018
- // Prettier do not have official support for TOML currently
1019
- "prettier/prettier": "off",
1020
1028
  // Avoid conflicts with js comment
1021
1029
  "spaced-comment": "off",
1022
1030
  "toml/comma-style": "error",
@@ -1263,7 +1271,7 @@ var sortTsConfig = defineConfig([
1263
1271
  var jsonc = defineConfig([
1264
1272
  {
1265
1273
  name: "ntnyq/jsonc",
1266
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
1274
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1267
1275
  plugins: {
1268
1276
  jsonc: import_eslint_plugin_jsonc.default
1269
1277
  },
@@ -1597,23 +1605,7 @@ var vue = defineConfig([
1597
1605
  }
1598
1606
  ]);
1599
1607
 
1600
- // src/presets.ts
1601
- var presetJavaScript = [
1602
- ...ignores,
1603
- ...jsdoc,
1604
- ...jsx,
1605
- ...node,
1606
- ...imports,
1607
- ...unicorn,
1608
- ...comments,
1609
- ...javascript,
1610
- ...regexp
1611
- ];
1612
- var presetBasic = [...presetJavaScript, ...typescript];
1613
- var presetJsonc = [...jsonc, ...sortPackageJson, ...sortTsConfig];
1614
- var presetLanguageExtensions = [...presetJsonc, ...yml, ...toml, ...markdown];
1615
- var presetCommon = [...presetBasic, ...presetLanguageExtensions, ...prettier];
1616
- var presetAll = [...presetCommon, ...vue, ...unocss];
1608
+ // src/core.ts
1617
1609
  function ntnyq(config = [], {
1618
1610
  vue: enableVue = hasVue,
1619
1611
  unocss: enableUnoCSS = hasUnoCSS,
@@ -1621,22 +1613,44 @@ function ntnyq(config = [], {
1621
1613
  markdown: enableMarkdown = true,
1622
1614
  command: enableCommand = true
1623
1615
  } = {}) {
1624
- const configs = defineConfig([...presetBasic, ...yml, ...toml, ...presetJsonc]);
1616
+ const configs = defineConfig([
1617
+ /**
1618
+ * Basic
1619
+ */
1620
+ ...ignores,
1621
+ ...jsdoc,
1622
+ ...jsx,
1623
+ ...node,
1624
+ ...imports,
1625
+ ...unicorn,
1626
+ ...comments,
1627
+ ...javascript,
1628
+ ...regexp,
1629
+ ...typescript,
1630
+ /**
1631
+ * Language extensions
1632
+ */
1633
+ ...yml,
1634
+ ...toml,
1635
+ ...jsonc,
1636
+ ...sortPackageJson,
1637
+ ...sortTsConfig
1638
+ ]);
1625
1639
  if (enableVue) {
1626
1640
  configs.push(...vue);
1627
1641
  }
1628
1642
  if (enableUnoCSS) {
1629
1643
  configs.push(...unocss);
1630
1644
  }
1631
- if (enablePrettier) {
1632
- configs.push(...prettier);
1633
- }
1634
1645
  if (enableMarkdown) {
1635
1646
  configs.push(...markdown);
1636
1647
  }
1637
1648
  if (enableCommand) {
1638
1649
  configs.push(...command);
1639
1650
  }
1651
+ if (enablePrettier) {
1652
+ configs.push(...prettier);
1653
+ }
1640
1654
  if (Object.keys(config).length > 0) {
1641
1655
  configs.push(...Array.isArray(config) ? config : [config]);
1642
1656
  }
@@ -1704,12 +1718,6 @@ function ntnyq(config = [], {
1704
1718
  pluginUnusedImports,
1705
1719
  pluginVue,
1706
1720
  pluginYaml,
1707
- presetAll,
1708
- presetBasic,
1709
- presetCommon,
1710
- presetJavaScript,
1711
- presetJsonc,
1712
- presetLanguageExtensions,
1713
1721
  prettier,
1714
1722
  regexp,
1715
1723
  sortPackageJson,
package/dist/index.d.cts CHANGED
@@ -24,17 +24,6 @@ export { vueEslintParser as parserVue };
24
24
  import * as jsoncEslintParser from 'jsonc-eslint-parser';
25
25
  export { jsoncEslintParser as parserJsonc };
26
26
 
27
- declare const hasTypeScript: boolean;
28
- declare const hasVue: boolean;
29
- declare const hasUnoCSS: boolean;
30
-
31
- /**
32
- * Load an ESLint plugin by name.
33
- * @param name - The name of the plugin
34
- * @returns The plugin module
35
- */
36
- declare function loadPlugin<T = unknown>(name: string): Promise<T>;
37
-
38
27
  /* eslint-disable */
39
28
  /* prettier-ignore */
40
29
 
@@ -995,42 +984,42 @@ interface RuleOptions {
995
984
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
996
985
  /**
997
986
  * Enforce or ban the use of inline type-only markers for named imports.
998
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/consistent-type-specifier-style.md
987
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/consistent-type-specifier-style.md
999
988
  */
1000
989
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
1001
990
  /**
1002
991
  * Ensure a default export is present, given a default import.
1003
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/default.md
992
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/default.md
1004
993
  */
1005
994
  'import/default'?: Linter.RuleEntry<[]>
1006
995
  /**
1007
996
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
1008
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/dynamic-import-chunkname.md
997
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/dynamic-import-chunkname.md
1009
998
  */
1010
999
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
1011
1000
  /**
1012
1001
  * Forbid any invalid exports, i.e. re-export of the same name.
1013
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/export.md
1002
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/export.md
1014
1003
  */
1015
1004
  'import/export'?: Linter.RuleEntry<[]>
1016
1005
  /**
1017
1006
  * Ensure all exports appear after other statements.
1018
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/exports-last.md
1007
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/exports-last.md
1019
1008
  */
1020
1009
  'import/exports-last'?: Linter.RuleEntry<[]>
1021
1010
  /**
1022
1011
  * Ensure consistent use of file extension within the import path.
1023
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/extensions.md
1012
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/extensions.md
1024
1013
  */
1025
1014
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
1026
1015
  /**
1027
1016
  * Ensure all imports appear before other statements.
1028
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/first.md
1017
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/first.md
1029
1018
  */
1030
1019
  'import/first'?: Linter.RuleEntry<ImportFirst>
1031
1020
  /**
1032
1021
  * Prefer named exports to be grouped together in a single export declaration.
1033
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/group-exports.md
1022
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/group-exports.md
1034
1023
  */
1035
1024
  'import/group-exports'?: Linter.RuleEntry<[]>
1036
1025
  /**
@@ -1041,182 +1030,182 @@ interface RuleOptions {
1041
1030
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
1042
1031
  /**
1043
1032
  * Enforce the maximum number of dependencies a module can have.
1044
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/max-dependencies.md
1033
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/max-dependencies.md
1045
1034
  */
1046
1035
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
1047
1036
  /**
1048
1037
  * Ensure named imports correspond to a named export in the remote file.
1049
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/named.md
1038
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/named.md
1050
1039
  */
1051
1040
  'import/named'?: Linter.RuleEntry<ImportNamed>
1052
1041
  /**
1053
1042
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
1054
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/namespace.md
1043
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/namespace.md
1055
1044
  */
1056
1045
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
1057
1046
  /**
1058
1047
  * Enforce a newline after import statements.
1059
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/newline-after-import.md
1048
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/newline-after-import.md
1060
1049
  */
1061
1050
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
1062
1051
  /**
1063
1052
  * Forbid import of modules using absolute paths.
1064
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-absolute-path.md
1053
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-absolute-path.md
1065
1054
  */
1066
1055
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
1067
1056
  /**
1068
1057
  * Forbid AMD `require` and `define` calls.
1069
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-amd.md
1058
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-amd.md
1070
1059
  */
1071
1060
  'import/no-amd'?: Linter.RuleEntry<[]>
1072
1061
  /**
1073
1062
  * Forbid anonymous values as default exports.
1074
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-anonymous-default-export.md
1063
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-anonymous-default-export.md
1075
1064
  */
1076
1065
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
1077
1066
  /**
1078
1067
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
1079
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-commonjs.md
1068
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-commonjs.md
1080
1069
  */
1081
1070
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
1082
1071
  /**
1083
1072
  * Forbid a module from importing a module with a dependency path back to itself.
1084
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-cycle.md
1073
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-cycle.md
1085
1074
  */
1086
1075
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
1087
1076
  /**
1088
1077
  * Forbid default exports.
1089
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-default-export.md
1078
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-default-export.md
1090
1079
  */
1091
1080
  'import/no-default-export'?: Linter.RuleEntry<[]>
1092
1081
  /**
1093
1082
  * Forbid imported names marked with `@deprecated` documentation tag.
1094
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-deprecated.md
1083
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-deprecated.md
1095
1084
  */
1096
1085
  'import/no-deprecated'?: Linter.RuleEntry<[]>
1097
1086
  /**
1098
1087
  * Forbid repeated import of the same module in multiple places.
1099
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-duplicates.md
1088
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-duplicates.md
1100
1089
  */
1101
1090
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
1102
1091
  /**
1103
1092
  * Forbid `require()` calls with expressions.
1104
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-dynamic-require.md
1093
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-dynamic-require.md
1105
1094
  */
1106
1095
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
1107
1096
  /**
1108
1097
  * Forbid empty named import blocks.
1109
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-empty-named-blocks.md
1098
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-empty-named-blocks.md
1110
1099
  */
1111
1100
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
1112
1101
  /**
1113
1102
  * Forbid the use of extraneous packages.
1114
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-extraneous-dependencies.md
1103
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-extraneous-dependencies.md
1115
1104
  */
1116
1105
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
1117
1106
  /**
1118
1107
  * Forbid import statements with CommonJS module.exports.
1119
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-import-module-exports.md
1108
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-import-module-exports.md
1120
1109
  */
1121
1110
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
1122
1111
  /**
1123
1112
  * Forbid importing the submodules of other modules.
1124
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-internal-modules.md
1113
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-internal-modules.md
1125
1114
  */
1126
1115
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
1127
1116
  /**
1128
1117
  * Forbid the use of mutable exports with `var` or `let`.
1129
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-mutable-exports.md
1118
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-mutable-exports.md
1130
1119
  */
1131
1120
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
1132
1121
  /**
1133
1122
  * Forbid use of exported name as identifier of default export.
1134
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-named-as-default.md
1123
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-named-as-default.md
1135
1124
  */
1136
1125
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
1137
1126
  /**
1138
1127
  * Forbid use of exported name as property of default export.
1139
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-named-as-default-member.md
1128
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-named-as-default-member.md
1140
1129
  */
1141
1130
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
1142
1131
  /**
1143
1132
  * Forbid named default exports.
1144
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-named-default.md
1133
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-named-default.md
1145
1134
  */
1146
1135
  'import/no-named-default'?: Linter.RuleEntry<[]>
1147
1136
  /**
1148
1137
  * Forbid named exports.
1149
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-named-export.md
1138
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-named-export.md
1150
1139
  */
1151
1140
  'import/no-named-export'?: Linter.RuleEntry<[]>
1152
1141
  /**
1153
1142
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
1154
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-namespace.md
1143
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-namespace.md
1155
1144
  */
1156
1145
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
1157
1146
  /**
1158
1147
  * Forbid Node.js builtin modules.
1159
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-nodejs-modules.md
1148
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-nodejs-modules.md
1160
1149
  */
1161
1150
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
1162
1151
  /**
1163
1152
  * Forbid importing packages through relative paths.
1164
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-relative-packages.md
1153
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-relative-packages.md
1165
1154
  */
1166
1155
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
1167
1156
  /**
1168
1157
  * Forbid importing modules from parent directories.
1169
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-relative-parent-imports.md
1158
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-relative-parent-imports.md
1170
1159
  */
1171
1160
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
1172
1161
  /**
1173
1162
  * Enforce which files can be imported in a given folder.
1174
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-restricted-paths.md
1163
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-restricted-paths.md
1175
1164
  */
1176
1165
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
1177
1166
  /**
1178
1167
  * Forbid a module from importing itself.
1179
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-self-import.md
1168
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-self-import.md
1180
1169
  */
1181
1170
  'import/no-self-import'?: Linter.RuleEntry<[]>
1182
1171
  /**
1183
1172
  * Forbid unassigned imports.
1184
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-unassigned-import.md
1173
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-unassigned-import.md
1185
1174
  */
1186
1175
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
1187
1176
  /**
1188
1177
  * Ensure imports point to a file/module that can be resolved.
1189
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-unresolved.md
1178
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-unresolved.md
1190
1179
  */
1191
1180
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
1192
1181
  /**
1193
1182
  * Forbid modules without exports, or exports without matching import in another module.
1194
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-unused-modules.md
1183
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-unused-modules.md
1195
1184
  */
1196
1185
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
1197
1186
  /**
1198
1187
  * Forbid unnecessary path segments in import and require statements.
1199
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-useless-path-segments.md
1188
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-useless-path-segments.md
1200
1189
  */
1201
1190
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
1202
1191
  /**
1203
1192
  * Forbid webpack loader syntax in imports.
1204
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-webpack-loader-syntax.md
1193
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-webpack-loader-syntax.md
1205
1194
  */
1206
1195
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
1207
1196
  /**
1208
1197
  * Enforce a convention in module import order.
1209
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/order.md
1198
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/order.md
1210
1199
  */
1211
1200
  'import/order'?: Linter.RuleEntry<ImportOrder>
1212
1201
  /**
1213
1202
  * Prefer a default export if module exports a single name or multiple names.
1214
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/prefer-default-export.md
1203
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/prefer-default-export.md
1215
1204
  */
1216
1205
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
1217
1206
  /**
1218
1207
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
1219
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/unambiguous.md
1208
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/unambiguous.md
1220
1209
  */
1221
1210
  'import/unambiguous'?: Linter.RuleEntry<[]>
1222
1211
  /**
@@ -6695,7 +6684,7 @@ type TypescriptEslintRestrictTemplateExpressions = []|[{
6695
6684
  allowNever?: boolean
6696
6685
  }]
6697
6686
  // ----- @typescript-eslint/return-await -----
6698
- type TypescriptEslintReturnAwait = []|[("in-try-catch" | "always" | "never")]
6687
+ type TypescriptEslintReturnAwait = []|[("in-try-catch" | "always" | "never" | "error-handling-correctness-only")]
6699
6688
  // ----- @typescript-eslint/sort-type-constituents -----
6700
6689
  type TypescriptEslintSortTypeConstituents = []|[{
6701
6690
 
@@ -11221,6 +11210,32 @@ type Awaitable<T> = T | Promise<T>
11221
11210
 
11222
11211
  type InteropModuleDefault<T> = T extends { default: infer U } ? U : T
11223
11212
 
11213
+ /**
11214
+ * @file presets
11215
+ */
11216
+
11217
+ /**
11218
+ * Custom framework support
11219
+ */
11220
+ declare function ntnyq(config?: TypedConfigItem | TypedConfigItem[], { vue: enableVue, unocss: enableUnoCSS, prettier: enablePrettier, markdown: enableMarkdown, command: enableCommand, }?: {
11221
+ vue?: boolean | undefined;
11222
+ unocss?: boolean | undefined;
11223
+ prettier?: boolean | undefined;
11224
+ markdown?: boolean | undefined;
11225
+ command?: boolean | undefined;
11226
+ }): TypedConfigItem[];
11227
+
11228
+ declare const hasTypeScript: boolean;
11229
+ declare const hasVue: boolean;
11230
+ declare const hasUnoCSS: boolean;
11231
+
11232
+ /**
11233
+ * Load an ESLint plugin by name.
11234
+ * @param name - The name of the plugin
11235
+ * @returns The plugin module
11236
+ */
11237
+ declare function loadPlugin<T = unknown>(name: string): Promise<T>;
11238
+
11224
11239
  /**
11225
11240
  * Define ESLint config
11226
11241
  */
@@ -11261,42 +11276,6 @@ declare const GLOB_DIST = "**/dist/**";
11261
11276
  declare const GLOB_LOCKFILE: string[];
11262
11277
  declare const GLOB_EXCLUDE: string[];
11263
11278
 
11264
- /**
11265
- * @file presets
11266
- */
11267
-
11268
- /**
11269
- * JavaScript preset
11270
- */
11271
- declare const presetJavaScript: TypedConfigItem[];
11272
- /**
11273
- * JavaScript & TypeScript
11274
- */
11275
- declare const presetBasic: TypedConfigItem[];
11276
- /**
11277
- * JSON and sort json keys
11278
- */
11279
- declare const presetJsonc: TypedConfigItem[];
11280
- /**
11281
- * JSON YAML Markdown
11282
- */
11283
- declare const presetLanguageExtensions: TypedConfigItem[];
11284
- declare const presetCommon: TypedConfigItem[];
11285
- /**
11286
- * All supported framework
11287
- */
11288
- declare const presetAll: TypedConfigItem[];
11289
- /**
11290
- * Custom framework support
11291
- */
11292
- declare function ntnyq(config?: TypedConfigItem | TypedConfigItem[], { vue: enableVue, unocss: enableUnoCSS, prettier: enablePrettier, markdown: enableMarkdown, command: enableCommand, }?: {
11293
- vue?: boolean | undefined;
11294
- unocss?: boolean | undefined;
11295
- prettier?: boolean | undefined;
11296
- markdown?: boolean | undefined;
11297
- command?: boolean | undefined;
11298
- }): TypedConfigItem[];
11299
-
11300
11279
  /**
11301
11280
  * @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
11302
11281
  */
@@ -11342,4 +11321,4 @@ declare const markdown: TypedConfigItem[];
11342
11321
  declare function getVueVersion(): number;
11343
11322
  declare const vue: TypedConfigItem[];
11344
11323
 
11345
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, defineConfig, getVueVersion, hasTypeScript, hasUnoCSS, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, presetAll, presetBasic, presetCommon, presetJavaScript, presetJsonc, presetLanguageExtensions, prettier, regexp, sortPackageJson, sortTsConfig, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vue, yml };
11324
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, defineConfig, getVueVersion, hasTypeScript, hasUnoCSS, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, prettier, regexp, sortPackageJson, sortTsConfig, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vue, yml };
package/dist/index.d.ts CHANGED
@@ -24,17 +24,6 @@ export { vueEslintParser as parserVue };
24
24
  import * as jsoncEslintParser from 'jsonc-eslint-parser';
25
25
  export { jsoncEslintParser as parserJsonc };
26
26
 
27
- declare const hasTypeScript: boolean;
28
- declare const hasVue: boolean;
29
- declare const hasUnoCSS: boolean;
30
-
31
- /**
32
- * Load an ESLint plugin by name.
33
- * @param name - The name of the plugin
34
- * @returns The plugin module
35
- */
36
- declare function loadPlugin<T = unknown>(name: string): Promise<T>;
37
-
38
27
  /* eslint-disable */
39
28
  /* prettier-ignore */
40
29
 
@@ -995,42 +984,42 @@ interface RuleOptions {
995
984
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
996
985
  /**
997
986
  * Enforce or ban the use of inline type-only markers for named imports.
998
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/consistent-type-specifier-style.md
987
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/consistent-type-specifier-style.md
999
988
  */
1000
989
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
1001
990
  /**
1002
991
  * Ensure a default export is present, given a default import.
1003
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/default.md
992
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/default.md
1004
993
  */
1005
994
  'import/default'?: Linter.RuleEntry<[]>
1006
995
  /**
1007
996
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
1008
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/dynamic-import-chunkname.md
997
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/dynamic-import-chunkname.md
1009
998
  */
1010
999
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
1011
1000
  /**
1012
1001
  * Forbid any invalid exports, i.e. re-export of the same name.
1013
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/export.md
1002
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/export.md
1014
1003
  */
1015
1004
  'import/export'?: Linter.RuleEntry<[]>
1016
1005
  /**
1017
1006
  * Ensure all exports appear after other statements.
1018
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/exports-last.md
1007
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/exports-last.md
1019
1008
  */
1020
1009
  'import/exports-last'?: Linter.RuleEntry<[]>
1021
1010
  /**
1022
1011
  * Ensure consistent use of file extension within the import path.
1023
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/extensions.md
1012
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/extensions.md
1024
1013
  */
1025
1014
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
1026
1015
  /**
1027
1016
  * Ensure all imports appear before other statements.
1028
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/first.md
1017
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/first.md
1029
1018
  */
1030
1019
  'import/first'?: Linter.RuleEntry<ImportFirst>
1031
1020
  /**
1032
1021
  * Prefer named exports to be grouped together in a single export declaration.
1033
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/group-exports.md
1022
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/group-exports.md
1034
1023
  */
1035
1024
  'import/group-exports'?: Linter.RuleEntry<[]>
1036
1025
  /**
@@ -1041,182 +1030,182 @@ interface RuleOptions {
1041
1030
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
1042
1031
  /**
1043
1032
  * Enforce the maximum number of dependencies a module can have.
1044
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/max-dependencies.md
1033
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/max-dependencies.md
1045
1034
  */
1046
1035
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
1047
1036
  /**
1048
1037
  * Ensure named imports correspond to a named export in the remote file.
1049
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/named.md
1038
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/named.md
1050
1039
  */
1051
1040
  'import/named'?: Linter.RuleEntry<ImportNamed>
1052
1041
  /**
1053
1042
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
1054
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/namespace.md
1043
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/namespace.md
1055
1044
  */
1056
1045
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
1057
1046
  /**
1058
1047
  * Enforce a newline after import statements.
1059
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/newline-after-import.md
1048
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/newline-after-import.md
1060
1049
  */
1061
1050
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
1062
1051
  /**
1063
1052
  * Forbid import of modules using absolute paths.
1064
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-absolute-path.md
1053
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-absolute-path.md
1065
1054
  */
1066
1055
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
1067
1056
  /**
1068
1057
  * Forbid AMD `require` and `define` calls.
1069
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-amd.md
1058
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-amd.md
1070
1059
  */
1071
1060
  'import/no-amd'?: Linter.RuleEntry<[]>
1072
1061
  /**
1073
1062
  * Forbid anonymous values as default exports.
1074
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-anonymous-default-export.md
1063
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-anonymous-default-export.md
1075
1064
  */
1076
1065
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
1077
1066
  /**
1078
1067
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
1079
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-commonjs.md
1068
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-commonjs.md
1080
1069
  */
1081
1070
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
1082
1071
  /**
1083
1072
  * Forbid a module from importing a module with a dependency path back to itself.
1084
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-cycle.md
1073
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-cycle.md
1085
1074
  */
1086
1075
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
1087
1076
  /**
1088
1077
  * Forbid default exports.
1089
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-default-export.md
1078
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-default-export.md
1090
1079
  */
1091
1080
  'import/no-default-export'?: Linter.RuleEntry<[]>
1092
1081
  /**
1093
1082
  * Forbid imported names marked with `@deprecated` documentation tag.
1094
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-deprecated.md
1083
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-deprecated.md
1095
1084
  */
1096
1085
  'import/no-deprecated'?: Linter.RuleEntry<[]>
1097
1086
  /**
1098
1087
  * Forbid repeated import of the same module in multiple places.
1099
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-duplicates.md
1088
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-duplicates.md
1100
1089
  */
1101
1090
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
1102
1091
  /**
1103
1092
  * Forbid `require()` calls with expressions.
1104
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-dynamic-require.md
1093
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-dynamic-require.md
1105
1094
  */
1106
1095
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
1107
1096
  /**
1108
1097
  * Forbid empty named import blocks.
1109
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-empty-named-blocks.md
1098
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-empty-named-blocks.md
1110
1099
  */
1111
1100
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
1112
1101
  /**
1113
1102
  * Forbid the use of extraneous packages.
1114
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-extraneous-dependencies.md
1103
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-extraneous-dependencies.md
1115
1104
  */
1116
1105
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
1117
1106
  /**
1118
1107
  * Forbid import statements with CommonJS module.exports.
1119
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-import-module-exports.md
1108
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-import-module-exports.md
1120
1109
  */
1121
1110
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
1122
1111
  /**
1123
1112
  * Forbid importing the submodules of other modules.
1124
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-internal-modules.md
1113
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-internal-modules.md
1125
1114
  */
1126
1115
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
1127
1116
  /**
1128
1117
  * Forbid the use of mutable exports with `var` or `let`.
1129
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-mutable-exports.md
1118
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-mutable-exports.md
1130
1119
  */
1131
1120
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
1132
1121
  /**
1133
1122
  * Forbid use of exported name as identifier of default export.
1134
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-named-as-default.md
1123
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-named-as-default.md
1135
1124
  */
1136
1125
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
1137
1126
  /**
1138
1127
  * Forbid use of exported name as property of default export.
1139
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-named-as-default-member.md
1128
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-named-as-default-member.md
1140
1129
  */
1141
1130
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
1142
1131
  /**
1143
1132
  * Forbid named default exports.
1144
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-named-default.md
1133
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-named-default.md
1145
1134
  */
1146
1135
  'import/no-named-default'?: Linter.RuleEntry<[]>
1147
1136
  /**
1148
1137
  * Forbid named exports.
1149
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-named-export.md
1138
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-named-export.md
1150
1139
  */
1151
1140
  'import/no-named-export'?: Linter.RuleEntry<[]>
1152
1141
  /**
1153
1142
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
1154
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-namespace.md
1143
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-namespace.md
1155
1144
  */
1156
1145
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
1157
1146
  /**
1158
1147
  * Forbid Node.js builtin modules.
1159
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-nodejs-modules.md
1148
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-nodejs-modules.md
1160
1149
  */
1161
1150
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
1162
1151
  /**
1163
1152
  * Forbid importing packages through relative paths.
1164
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-relative-packages.md
1153
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-relative-packages.md
1165
1154
  */
1166
1155
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
1167
1156
  /**
1168
1157
  * Forbid importing modules from parent directories.
1169
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-relative-parent-imports.md
1158
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-relative-parent-imports.md
1170
1159
  */
1171
1160
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
1172
1161
  /**
1173
1162
  * Enforce which files can be imported in a given folder.
1174
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-restricted-paths.md
1163
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-restricted-paths.md
1175
1164
  */
1176
1165
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
1177
1166
  /**
1178
1167
  * Forbid a module from importing itself.
1179
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-self-import.md
1168
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-self-import.md
1180
1169
  */
1181
1170
  'import/no-self-import'?: Linter.RuleEntry<[]>
1182
1171
  /**
1183
1172
  * Forbid unassigned imports.
1184
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-unassigned-import.md
1173
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-unassigned-import.md
1185
1174
  */
1186
1175
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
1187
1176
  /**
1188
1177
  * Ensure imports point to a file/module that can be resolved.
1189
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-unresolved.md
1178
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-unresolved.md
1190
1179
  */
1191
1180
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
1192
1181
  /**
1193
1182
  * Forbid modules without exports, or exports without matching import in another module.
1194
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-unused-modules.md
1183
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-unused-modules.md
1195
1184
  */
1196
1185
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
1197
1186
  /**
1198
1187
  * Forbid unnecessary path segments in import and require statements.
1199
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-useless-path-segments.md
1188
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-useless-path-segments.md
1200
1189
  */
1201
1190
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
1202
1191
  /**
1203
1192
  * Forbid webpack loader syntax in imports.
1204
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/no-webpack-loader-syntax.md
1193
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/no-webpack-loader-syntax.md
1205
1194
  */
1206
1195
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
1207
1196
  /**
1208
1197
  * Enforce a convention in module import order.
1209
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/order.md
1198
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/order.md
1210
1199
  */
1211
1200
  'import/order'?: Linter.RuleEntry<ImportOrder>
1212
1201
  /**
1213
1202
  * Prefer a default export if module exports a single name or multiple names.
1214
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/prefer-default-export.md
1203
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/prefer-default-export.md
1215
1204
  */
1216
1205
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
1217
1206
  /**
1218
1207
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
1219
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.0.1/docs/rules/unambiguous.md
1208
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v3.1.0/docs/rules/unambiguous.md
1220
1209
  */
1221
1210
  'import/unambiguous'?: Linter.RuleEntry<[]>
1222
1211
  /**
@@ -6695,7 +6684,7 @@ type TypescriptEslintRestrictTemplateExpressions = []|[{
6695
6684
  allowNever?: boolean
6696
6685
  }]
6697
6686
  // ----- @typescript-eslint/return-await -----
6698
- type TypescriptEslintReturnAwait = []|[("in-try-catch" | "always" | "never")]
6687
+ type TypescriptEslintReturnAwait = []|[("in-try-catch" | "always" | "never" | "error-handling-correctness-only")]
6699
6688
  // ----- @typescript-eslint/sort-type-constituents -----
6700
6689
  type TypescriptEslintSortTypeConstituents = []|[{
6701
6690
 
@@ -11221,6 +11210,32 @@ type Awaitable<T> = T | Promise<T>
11221
11210
 
11222
11211
  type InteropModuleDefault<T> = T extends { default: infer U } ? U : T
11223
11212
 
11213
+ /**
11214
+ * @file presets
11215
+ */
11216
+
11217
+ /**
11218
+ * Custom framework support
11219
+ */
11220
+ declare function ntnyq(config?: TypedConfigItem | TypedConfigItem[], { vue: enableVue, unocss: enableUnoCSS, prettier: enablePrettier, markdown: enableMarkdown, command: enableCommand, }?: {
11221
+ vue?: boolean | undefined;
11222
+ unocss?: boolean | undefined;
11223
+ prettier?: boolean | undefined;
11224
+ markdown?: boolean | undefined;
11225
+ command?: boolean | undefined;
11226
+ }): TypedConfigItem[];
11227
+
11228
+ declare const hasTypeScript: boolean;
11229
+ declare const hasVue: boolean;
11230
+ declare const hasUnoCSS: boolean;
11231
+
11232
+ /**
11233
+ * Load an ESLint plugin by name.
11234
+ * @param name - The name of the plugin
11235
+ * @returns The plugin module
11236
+ */
11237
+ declare function loadPlugin<T = unknown>(name: string): Promise<T>;
11238
+
11224
11239
  /**
11225
11240
  * Define ESLint config
11226
11241
  */
@@ -11261,42 +11276,6 @@ declare const GLOB_DIST = "**/dist/**";
11261
11276
  declare const GLOB_LOCKFILE: string[];
11262
11277
  declare const GLOB_EXCLUDE: string[];
11263
11278
 
11264
- /**
11265
- * @file presets
11266
- */
11267
-
11268
- /**
11269
- * JavaScript preset
11270
- */
11271
- declare const presetJavaScript: TypedConfigItem[];
11272
- /**
11273
- * JavaScript & TypeScript
11274
- */
11275
- declare const presetBasic: TypedConfigItem[];
11276
- /**
11277
- * JSON and sort json keys
11278
- */
11279
- declare const presetJsonc: TypedConfigItem[];
11280
- /**
11281
- * JSON YAML Markdown
11282
- */
11283
- declare const presetLanguageExtensions: TypedConfigItem[];
11284
- declare const presetCommon: TypedConfigItem[];
11285
- /**
11286
- * All supported framework
11287
- */
11288
- declare const presetAll: TypedConfigItem[];
11289
- /**
11290
- * Custom framework support
11291
- */
11292
- declare function ntnyq(config?: TypedConfigItem | TypedConfigItem[], { vue: enableVue, unocss: enableUnoCSS, prettier: enablePrettier, markdown: enableMarkdown, command: enableCommand, }?: {
11293
- vue?: boolean | undefined;
11294
- unocss?: boolean | undefined;
11295
- prettier?: boolean | undefined;
11296
- markdown?: boolean | undefined;
11297
- command?: boolean | undefined;
11298
- }): TypedConfigItem[];
11299
-
11300
11279
  /**
11301
11280
  * @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
11302
11281
  */
@@ -11342,4 +11321,4 @@ declare const markdown: TypedConfigItem[];
11342
11321
  declare function getVueVersion(): number;
11343
11322
  declare const vue: TypedConfigItem[];
11344
11323
 
11345
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, defineConfig, getVueVersion, hasTypeScript, hasUnoCSS, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, presetAll, presetBasic, presetCommon, presetJavaScript, presetJsonc, presetLanguageExtensions, prettier, regexp, sortPackageJson, sortTsConfig, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vue, yml };
11324
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, defineConfig, getVueVersion, hasTypeScript, hasUnoCSS, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, prettier, regexp, sortPackageJson, sortTsConfig, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vue, yml };
package/dist/index.js CHANGED
@@ -65,7 +65,8 @@ var GLOB_LOCKFILE = [
65
65
  "**/package-lock.json",
66
66
  "**/yarn.lock",
67
67
  "**/pnpm-lock.yaml",
68
- "**/bun.lockb"
68
+ "**/bun.lockb",
69
+ "**/deno.lock"
69
70
  ];
70
71
  var GLOB_EXCLUDE = [
71
72
  GLOB_NODE_MODULES,
@@ -86,12 +87,14 @@ var GLOB_EXCLUDE = [
86
87
  "**/components.d.ts",
87
88
  // unplugin-vue-router
88
89
  "**/typed-router.d.ts",
90
+ // vite-plugin-uni-pages
91
+ "**/uni-pages.d.ts",
89
92
  "**/coverage",
90
93
  "**/fixtures",
91
94
  "**/output",
92
95
  "**/public",
93
96
  "**/static",
94
- // VitePress VuePress
97
+ // VitePress and VuePress
95
98
  "**/?(.)temp",
96
99
  "**/?(.)cache",
97
100
  "**/.eslintcache",
@@ -320,6 +323,19 @@ var prettier = defineConfig([
320
323
  ...default11.configs.recommended.rules,
321
324
  "prettier/prettier": "warn"
322
325
  }
326
+ },
327
+ /**
328
+ * Languages that prettier currently does not support
329
+ */
330
+ {
331
+ name: "ntnyq/prettier/ignore",
332
+ files: [GLOB_TOML],
333
+ plugins: {
334
+ prettier: default11
335
+ },
336
+ rules: {
337
+ "prettier/prettier": "off"
338
+ }
323
339
  }
324
340
  ]);
325
341
 
@@ -901,8 +917,6 @@ var toml = defineConfig([
901
917
  toml: default5
902
918
  },
903
919
  rules: {
904
- // Prettier do not have official support for TOML currently
905
- "prettier/prettier": "off",
906
920
  // Avoid conflicts with js comment
907
921
  "spaced-comment": "off",
908
922
  "toml/comma-style": "error",
@@ -1149,7 +1163,7 @@ var sortTsConfig = defineConfig([
1149
1163
  var jsonc = defineConfig([
1150
1164
  {
1151
1165
  name: "ntnyq/jsonc",
1152
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
1166
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1153
1167
  plugins: {
1154
1168
  jsonc: default6
1155
1169
  },
@@ -1483,23 +1497,7 @@ var vue = defineConfig([
1483
1497
  }
1484
1498
  ]);
1485
1499
 
1486
- // src/presets.ts
1487
- var presetJavaScript = [
1488
- ...ignores,
1489
- ...jsdoc,
1490
- ...jsx,
1491
- ...node,
1492
- ...imports,
1493
- ...unicorn,
1494
- ...comments,
1495
- ...javascript,
1496
- ...regexp
1497
- ];
1498
- var presetBasic = [...presetJavaScript, ...typescript];
1499
- var presetJsonc = [...jsonc, ...sortPackageJson, ...sortTsConfig];
1500
- var presetLanguageExtensions = [...presetJsonc, ...yml, ...toml, ...markdown];
1501
- var presetCommon = [...presetBasic, ...presetLanguageExtensions, ...prettier];
1502
- var presetAll = [...presetCommon, ...vue, ...unocss];
1500
+ // src/core.ts
1503
1501
  function ntnyq(config = [], {
1504
1502
  vue: enableVue = hasVue,
1505
1503
  unocss: enableUnoCSS = hasUnoCSS,
@@ -1507,22 +1505,44 @@ function ntnyq(config = [], {
1507
1505
  markdown: enableMarkdown = true,
1508
1506
  command: enableCommand = true
1509
1507
  } = {}) {
1510
- const configs = defineConfig([...presetBasic, ...yml, ...toml, ...presetJsonc]);
1508
+ const configs = defineConfig([
1509
+ /**
1510
+ * Basic
1511
+ */
1512
+ ...ignores,
1513
+ ...jsdoc,
1514
+ ...jsx,
1515
+ ...node,
1516
+ ...imports,
1517
+ ...unicorn,
1518
+ ...comments,
1519
+ ...javascript,
1520
+ ...regexp,
1521
+ ...typescript,
1522
+ /**
1523
+ * Language extensions
1524
+ */
1525
+ ...yml,
1526
+ ...toml,
1527
+ ...jsonc,
1528
+ ...sortPackageJson,
1529
+ ...sortTsConfig
1530
+ ]);
1511
1531
  if (enableVue) {
1512
1532
  configs.push(...vue);
1513
1533
  }
1514
1534
  if (enableUnoCSS) {
1515
1535
  configs.push(...unocss);
1516
1536
  }
1517
- if (enablePrettier) {
1518
- configs.push(...prettier);
1519
- }
1520
1537
  if (enableMarkdown) {
1521
1538
  configs.push(...markdown);
1522
1539
  }
1523
1540
  if (enableCommand) {
1524
1541
  configs.push(...command);
1525
1542
  }
1543
+ if (enablePrettier) {
1544
+ configs.push(...prettier);
1545
+ }
1526
1546
  if (Object.keys(config).length > 0) {
1527
1547
  configs.push(...Array.isArray(config) ? config : [config]);
1528
1548
  }
@@ -1589,12 +1609,6 @@ export {
1589
1609
  default13 as pluginUnusedImports,
1590
1610
  default3 as pluginVue,
1591
1611
  default4 as pluginYaml,
1592
- presetAll,
1593
- presetBasic,
1594
- presetCommon,
1595
- presetJavaScript,
1596
- presetJsonc,
1597
- presetLanguageExtensions,
1598
1612
  prettier,
1599
1613
  regexp,
1600
1614
  sortPackageJson,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "2.6.3",
5
- "packageManager": "pnpm@9.5.0",
4
+ "version": "2.7.1",
5
+ "packageManager": "pnpm@9.6.0",
6
6
  "description": "ESLint flat config of ntnyq",
7
7
  "keywords": [
8
8
  "eslint",
@@ -58,12 +58,12 @@
58
58
  "@antfu/eslint-plugin-unused-imports": "^4.0.0",
59
59
  "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
60
60
  "@eslint/js": "^9.7.0",
61
- "@types/eslint": "^8.56.10",
61
+ "@types/eslint": "^9.6.0",
62
62
  "@unocss/eslint-plugin": "^0.61.5",
63
63
  "eslint-config-prettier": "^9.1.0",
64
64
  "eslint-flat-config-utils": "^0.2.5",
65
65
  "eslint-plugin-command": "^0.2.3",
66
- "eslint-plugin-import-x": "^3.0.1",
66
+ "eslint-plugin-import-x": "^3.1.0",
67
67
  "eslint-plugin-jsdoc": "^48.8.3",
68
68
  "eslint-plugin-jsonc": "^2.16.0",
69
69
  "eslint-plugin-markdown": "^5.1.0",
@@ -79,13 +79,13 @@
79
79
  "local-pkg": "^0.5.0",
80
80
  "prettier": "^3.3.3",
81
81
  "toml-eslint-parser": "^0.10.0",
82
- "typescript-eslint": "^8.0.0-alpha.47",
82
+ "typescript-eslint": "^8.0.0-alpha.49",
83
83
  "vue-eslint-parser": "^9.4.3",
84
84
  "yaml-eslint-parser": "^1.2.3"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@ntnyq/prettier-config": "^1.21.2",
88
- "@types/node": "^20.14.11",
88
+ "@types/node": "^20.14.12",
89
89
  "bumpp": "^9.4.1",
90
90
  "eslint": "^9.7.0",
91
91
  "eslint-typegen": "^0.2.4",
@@ -93,9 +93,9 @@
93
93
  "nano-staged": "^0.8.0",
94
94
  "npm-run-all2": "^6.2.2",
95
95
  "rimraf": "^6.0.1",
96
- "tsup": "^8.2.1",
96
+ "tsup": "^8.2.3",
97
97
  "tsx": "^4.16.2",
98
- "typescript": "^5.5.3",
98
+ "typescript": "^5.5.4",
99
99
  "zx": "^8.1.4"
100
100
  },
101
101
  "engines": {