@ntnyq/eslint-config 2.6.3 → 2.7.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
@@ -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,
@@ -434,6 +428,19 @@ var prettier = defineConfig([
434
428
  ...import_eslint_plugin_prettier.default.configs.recommended.rules,
435
429
  "prettier/prettier": "warn"
436
430
  }
431
+ },
432
+ /**
433
+ * Languages that prettier currently does not support
434
+ */
435
+ {
436
+ name: "ntnyq/prettier/ignore",
437
+ files: [GLOB_TOML],
438
+ plugins: {
439
+ prettier: import_eslint_plugin_prettier.default
440
+ },
441
+ rules: {
442
+ "prettier/prettier": "off"
443
+ }
437
444
  }
438
445
  ]);
439
446
 
@@ -1015,8 +1022,6 @@ var toml = defineConfig([
1015
1022
  toml: import_eslint_plugin_toml.default
1016
1023
  },
1017
1024
  rules: {
1018
- // Prettier do not have official support for TOML currently
1019
- "prettier/prettier": "off",
1020
1025
  // Avoid conflicts with js comment
1021
1026
  "spaced-comment": "off",
1022
1027
  "toml/comma-style": "error",
@@ -1597,23 +1602,7 @@ var vue = defineConfig([
1597
1602
  }
1598
1603
  ]);
1599
1604
 
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];
1605
+ // src/core.ts
1617
1606
  function ntnyq(config = [], {
1618
1607
  vue: enableVue = hasVue,
1619
1608
  unocss: enableUnoCSS = hasUnoCSS,
@@ -1621,22 +1610,44 @@ function ntnyq(config = [], {
1621
1610
  markdown: enableMarkdown = true,
1622
1611
  command: enableCommand = true
1623
1612
  } = {}) {
1624
- const configs = defineConfig([...presetBasic, ...yml, ...toml, ...presetJsonc]);
1613
+ const configs = defineConfig([
1614
+ /**
1615
+ * Basic
1616
+ */
1617
+ ...ignores,
1618
+ ...jsdoc,
1619
+ ...jsx,
1620
+ ...node,
1621
+ ...imports,
1622
+ ...unicorn,
1623
+ ...comments,
1624
+ ...javascript,
1625
+ ...regexp,
1626
+ ...typescript,
1627
+ /**
1628
+ * Language extensions
1629
+ */
1630
+ ...yml,
1631
+ ...toml,
1632
+ ...jsonc,
1633
+ ...sortPackageJson,
1634
+ ...sortTsConfig
1635
+ ]);
1625
1636
  if (enableVue) {
1626
1637
  configs.push(...vue);
1627
1638
  }
1628
1639
  if (enableUnoCSS) {
1629
1640
  configs.push(...unocss);
1630
1641
  }
1631
- if (enablePrettier) {
1632
- configs.push(...prettier);
1633
- }
1634
1642
  if (enableMarkdown) {
1635
1643
  configs.push(...markdown);
1636
1644
  }
1637
1645
  if (enableCommand) {
1638
1646
  configs.push(...command);
1639
1647
  }
1648
+ if (enablePrettier) {
1649
+ configs.push(...prettier);
1650
+ }
1640
1651
  if (Object.keys(config).length > 0) {
1641
1652
  configs.push(...Array.isArray(config) ? config : [config]);
1642
1653
  }
@@ -1704,12 +1715,6 @@ function ntnyq(config = [], {
1704
1715
  pluginUnusedImports,
1705
1716
  pluginVue,
1706
1717
  pluginYaml,
1707
- presetAll,
1708
- presetBasic,
1709
- presetCommon,
1710
- presetJavaScript,
1711
- presetJsonc,
1712
- presetLanguageExtensions,
1713
1718
  prettier,
1714
1719
  regexp,
1715
1720
  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
 
@@ -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
 
@@ -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
@@ -320,6 +320,19 @@ var prettier = defineConfig([
320
320
  ...default11.configs.recommended.rules,
321
321
  "prettier/prettier": "warn"
322
322
  }
323
+ },
324
+ /**
325
+ * Languages that prettier currently does not support
326
+ */
327
+ {
328
+ name: "ntnyq/prettier/ignore",
329
+ files: [GLOB_TOML],
330
+ plugins: {
331
+ prettier: default11
332
+ },
333
+ rules: {
334
+ "prettier/prettier": "off"
335
+ }
323
336
  }
324
337
  ]);
325
338
 
@@ -901,8 +914,6 @@ var toml = defineConfig([
901
914
  toml: default5
902
915
  },
903
916
  rules: {
904
- // Prettier do not have official support for TOML currently
905
- "prettier/prettier": "off",
906
917
  // Avoid conflicts with js comment
907
918
  "spaced-comment": "off",
908
919
  "toml/comma-style": "error",
@@ -1483,23 +1494,7 @@ var vue = defineConfig([
1483
1494
  }
1484
1495
  ]);
1485
1496
 
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];
1497
+ // src/core.ts
1503
1498
  function ntnyq(config = [], {
1504
1499
  vue: enableVue = hasVue,
1505
1500
  unocss: enableUnoCSS = hasUnoCSS,
@@ -1507,22 +1502,44 @@ function ntnyq(config = [], {
1507
1502
  markdown: enableMarkdown = true,
1508
1503
  command: enableCommand = true
1509
1504
  } = {}) {
1510
- const configs = defineConfig([...presetBasic, ...yml, ...toml, ...presetJsonc]);
1505
+ const configs = defineConfig([
1506
+ /**
1507
+ * Basic
1508
+ */
1509
+ ...ignores,
1510
+ ...jsdoc,
1511
+ ...jsx,
1512
+ ...node,
1513
+ ...imports,
1514
+ ...unicorn,
1515
+ ...comments,
1516
+ ...javascript,
1517
+ ...regexp,
1518
+ ...typescript,
1519
+ /**
1520
+ * Language extensions
1521
+ */
1522
+ ...yml,
1523
+ ...toml,
1524
+ ...jsonc,
1525
+ ...sortPackageJson,
1526
+ ...sortTsConfig
1527
+ ]);
1511
1528
  if (enableVue) {
1512
1529
  configs.push(...vue);
1513
1530
  }
1514
1531
  if (enableUnoCSS) {
1515
1532
  configs.push(...unocss);
1516
1533
  }
1517
- if (enablePrettier) {
1518
- configs.push(...prettier);
1519
- }
1520
1534
  if (enableMarkdown) {
1521
1535
  configs.push(...markdown);
1522
1536
  }
1523
1537
  if (enableCommand) {
1524
1538
  configs.push(...command);
1525
1539
  }
1540
+ if (enablePrettier) {
1541
+ configs.push(...prettier);
1542
+ }
1526
1543
  if (Object.keys(config).length > 0) {
1527
1544
  configs.push(...Array.isArray(config) ? config : [config]);
1528
1545
  }
@@ -1589,12 +1606,6 @@ export {
1589
1606
  default13 as pluginUnusedImports,
1590
1607
  default3 as pluginVue,
1591
1608
  default4 as pluginYaml,
1592
- presetAll,
1593
- presetBasic,
1594
- presetCommon,
1595
- presetJavaScript,
1596
- presetJsonc,
1597
- presetLanguageExtensions,
1598
1609
  prettier,
1599
1610
  regexp,
1600
1611
  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.0",
5
+ "packageManager": "pnpm@9.6.0",
6
6
  "description": "ESLint flat config of ntnyq",
7
7
  "keywords": [
8
8
  "eslint",
@@ -79,7 +79,7 @@
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
  },