@ntnyq/eslint-config 4.0.4 → 4.2.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.
Files changed (3) hide show
  1. package/dist/index.d.mts +458 -280
  2. package/dist/index.mjs +66 -32
  3. package/package.json +27 -27
package/dist/index.mjs CHANGED
@@ -1619,9 +1619,11 @@ const configPinia = (options = {}) => {
1619
1619
  ];
1620
1620
  };
1621
1621
 
1622
+ const ALLOWED_DEPENDENCIES = ["eslint-plugin-unicorn"];
1622
1623
  const configDepend = (options = {}) => {
1623
1624
  const {
1624
1625
  files = [GLOB_SRC],
1626
+ allowed = [],
1625
1627
  // check package.json file
1626
1628
  packageJson: enableCheckPackageJson = true
1627
1629
  } = options;
@@ -1633,7 +1635,12 @@ const configDepend = (options = {}) => {
1633
1635
  depend: pluginDepend
1634
1636
  },
1635
1637
  rules: {
1636
- "depend/ban-dependencies": "error",
1638
+ "depend/ban-dependencies": [
1639
+ "error",
1640
+ {
1641
+ allowed: [...allowed, ...ALLOWED_DEPENDENCIES]
1642
+ }
1643
+ ],
1637
1644
  // Overrides rules
1638
1645
  ...options.overrides
1639
1646
  }
@@ -1650,7 +1657,12 @@ const configDepend = (options = {}) => {
1650
1657
  parser: parserJsonc
1651
1658
  },
1652
1659
  rules: {
1653
- "depend/ban-dependencies": "error",
1660
+ "depend/ban-dependencies": [
1661
+ "error",
1662
+ {
1663
+ allowed: [...allowed, ...ALLOWED_DEPENDENCIES]
1664
+ }
1665
+ ],
1654
1666
  // Overrides rules
1655
1667
  ...options.overrides
1656
1668
  }
@@ -1770,38 +1782,55 @@ const PERFECTIONIST_SORT_IMPORTS_GROUPS = [
1770
1782
  // Side effect style imports (e.g. 'normalize.css')
1771
1783
  "side-effect-style",
1772
1784
  // Styles (e.g. *.{css,scss,less})
1773
- "style",
1785
+ "value-style",
1774
1786
  // Node.js built-in modules. (e.g. fs, path)
1775
- "builtin",
1787
+ "value-builtin",
1776
1788
  // External modules installed in the project (e.g. vue, lodash)
1777
- "external",
1789
+ "value-external",
1790
+ // Node.js subpath imports (e.g. fs/promises)
1791
+ "value-subpath",
1778
1792
  // Internal modules (e.g. @/utils, @/components)
1779
- "internal",
1793
+ "value-internal",
1780
1794
  // Modules from parent directory (e.g. ../utils)
1781
- "parent",
1795
+ "value-parent",
1782
1796
  // Modules from the same directory (e.g. ./utils)
1783
- "sibling",
1797
+ "value-sibling",
1784
1798
  // Main file from the current directory (e.g. ./index)
1785
- "index",
1786
- // TypeScript object-imports (e.g. import log = console.log)
1787
- "object",
1799
+ "value-index",
1800
+ // TypeScript import-equals imports (e.g. import log = console.log)
1801
+ "ts-equals-import",
1788
1802
  // Side effect imports (e.g. import 'babel-polyfill')
1789
1803
  "side-effect",
1790
1804
  /**
1791
1805
  * Type import at the end
1792
1806
  */
1793
- "builtin-type",
1794
- "external-type",
1795
- "internal-type",
1796
- "parent-type",
1797
- "sibling-type",
1798
- "index-type",
1799
- "type",
1807
+ "type-builtin",
1808
+ "type-external",
1809
+ "type-subpath",
1810
+ "type-internal",
1811
+ "type-parent",
1812
+ "type-sibling",
1813
+ "type-index",
1800
1814
  /**
1801
1815
  * Imports that don’t fit into any other group
1802
1816
  */
1803
1817
  "unknown"
1804
1818
  ];
1819
+ const PERFECTIONIST_SORT_EXPORTS_GROUPS = [
1820
+ "value-export",
1821
+ "type-export",
1822
+ "unknown"
1823
+ ];
1824
+ const PERFECTIONIST_SORT_NAMED_EXPORTS_GROUPS = [
1825
+ "value-export",
1826
+ "type-export",
1827
+ "unknown"
1828
+ ];
1829
+ const PERFECTIONIST_SORT_NAMED_IMPORTS_GROUPS = [
1830
+ "value-import",
1831
+ "type-import",
1832
+ "unknown"
1833
+ ];
1805
1834
  const PERFECTIONIST_SORT_CLASSES_GROUPS = ["unknown"];
1806
1835
 
1807
1836
  const configFormat = async (options = {}) => {
@@ -2068,6 +2097,10 @@ const disabledRules = {
2068
2097
  * @see https://caniuse.com/?search=globalThis
2069
2098
  */
2070
2099
  "unicorn/prefer-global-this": "off",
2100
+ /**
2101
+ * Required node v20.11
2102
+ */
2103
+ "unicorn/prefer-import-meta-properties": "off",
2071
2104
  "unicorn/prefer-top-level-await": "off"
2072
2105
  };
2073
2106
  const configUnicorn = (options = {}) => [
@@ -2154,12 +2187,15 @@ const configUnicorn = (options = {}) => [
2154
2187
  * @pg Array
2155
2188
  */
2156
2189
  "unicorn/no-array-method-this-argument": "error",
2157
- "unicorn/no-array-push-push": "error",
2158
2190
  "unicorn/no-new-array": "error",
2191
+ "unicorn/no-unnecessary-array-flat-depth": "error",
2192
+ "unicorn/no-unnecessary-array-splice-count": "error",
2193
+ "unicorn/no-unnecessary-slice-end": "error",
2159
2194
  "unicorn/prefer-array-find": "error",
2160
2195
  "unicorn/prefer-array-flat-map": "error",
2161
2196
  "unicorn/prefer-array-index-of": "error",
2162
2197
  "unicorn/prefer-array-some": "error",
2198
+ "unicorn/prefer-single-call": "error",
2163
2199
  "unicorn/require-array-join-separator": "error",
2164
2200
  /**
2165
2201
  * @pg Set
@@ -2937,11 +2973,7 @@ const configESLintPlugin = async (options = {}) => {
2937
2973
  };
2938
2974
 
2939
2975
  const configGitHubAction = (options = {}) => {
2940
- const {
2941
- //
2942
- files = [GLOB_GITHUB_ACTION],
2943
- overrides: overridesRules = {}
2944
- } = options;
2976
+ const { files = [GLOB_GITHUB_ACTION] } = options;
2945
2977
  return [
2946
2978
  {
2947
2979
  name: "ntnyq/github-action",
@@ -2956,7 +2988,9 @@ const configGitHubAction = (options = {}) => {
2956
2988
  "github-action/no-invalid-key": "error",
2957
2989
  "github-action/prefer-file-extension": "error",
2958
2990
  "github-action/require-action-name": "error",
2959
- ...overridesRules
2991
+ "github-action/valid-timeout-minutes": "error",
2992
+ "github-action/valid-trigger-events": "error",
2993
+ ...options.overrides
2960
2994
  }
2961
2995
  }
2962
2996
  ];
@@ -2988,8 +3022,8 @@ const configPerfectionist = (options = {}) => {
2988
3022
  "perfectionist/sort-exports": [
2989
3023
  "error",
2990
3024
  {
2991
- ...commonRuleOptionsWithPartitionByComment,
2992
- groupKind: "values-first",
3025
+ ...commonRuleOptionsWithBoth,
3026
+ groups: PERFECTIONIST_SORT_EXPORTS_GROUPS,
2993
3027
  type: "line-length"
2994
3028
  }
2995
3029
  ],
@@ -3004,16 +3038,16 @@ const configPerfectionist = (options = {}) => {
3004
3038
  "perfectionist/sort-named-exports": [
3005
3039
  "error",
3006
3040
  {
3007
- ...commonRuleOptionsWithPartitionByComment,
3008
- groupKind: "values-first",
3041
+ ...commonRuleOptionsWithBoth,
3042
+ groups: PERFECTIONIST_SORT_NAMED_EXPORTS_GROUPS,
3009
3043
  ignoreAlias: false
3010
3044
  }
3011
3045
  ],
3012
3046
  "perfectionist/sort-named-imports": [
3013
3047
  "error",
3014
3048
  {
3015
- ...commonRuleOptionsWithPartitionByComment,
3016
- groupKind: "values-first",
3049
+ ...commonRuleOptionsWithBoth,
3050
+ groups: PERFECTIONIST_SORT_NAMED_IMPORTS_GROUPS,
3017
3051
  ignoreAlias: false
3018
3052
  }
3019
3053
  ]
@@ -3490,4 +3524,4 @@ function defineESLintConfig(options = {}, ...userConfigs) {
3490
3524
  return composer;
3491
3525
  }
3492
3526
 
3493
- export { 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_JSON_SCHEMA, GLOB_JSX, GLOB_JSX_ONLY, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_PNPM_WORKSPACE_YAML, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG_JSON, GLOB_TSX, GLOB_TSX_ONLY, GLOB_TYPES, GLOB_TYPE_TEST, GLOB_VUE, GLOB_YAML, PERFECTIONIST_COMMON_RULE_OPTIONS, PERFECTIONIST_EXTRA_RULE_OPTIONS, PERFECTIONIST_SORT_CLASSES_GROUPS, PERFECTIONIST_SORT_IMPORTS_GROUPS, PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS, PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS, PERFECTIONIST_SORT_OBJECTS_GROUPS, PRETTIER_DEFAULT_OPTIONS, combineConfigs, configAntfu, configCommand, configDeMorgan, configDepend, configESLintComments, configESLintPlugin, configFormat, configGitHubAction, configGitIgnore, configIgnores, configImportX, configJSX, configJavaScript, configJsdoc, configJsonc, configMarkdown, configNode, configNtnyq, configPerfectionist, configPinia, configPnpm, configPrettier, configRegexp, configSVGO, configSort, configSpecials, configTest, configToml, configTypeScript, configUnicorn, configUnoCSS, configUnusedImports, configVue, configYml, defineESLintConfig, ensurePackages, getOverrides, hasPinia, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, interopDefault, isInGitHooksOrRunBySpecifyPackages, mergePrettierOptions, parserPlain, resolveSubOptions };
3527
+ export { 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_JSON_SCHEMA, GLOB_JSX, GLOB_JSX_ONLY, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_PNPM_WORKSPACE_YAML, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG_JSON, GLOB_TSX, GLOB_TSX_ONLY, GLOB_TYPES, GLOB_TYPE_TEST, GLOB_VUE, GLOB_YAML, PERFECTIONIST_COMMON_RULE_OPTIONS, PERFECTIONIST_EXTRA_RULE_OPTIONS, PERFECTIONIST_SORT_CLASSES_GROUPS, PERFECTIONIST_SORT_EXPORTS_GROUPS, PERFECTIONIST_SORT_IMPORTS_GROUPS, PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS, PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS, PERFECTIONIST_SORT_NAMED_EXPORTS_GROUPS, PERFECTIONIST_SORT_NAMED_IMPORTS_GROUPS, PERFECTIONIST_SORT_OBJECTS_GROUPS, PRETTIER_DEFAULT_OPTIONS, combineConfigs, configAntfu, configCommand, configDeMorgan, configDepend, configESLintComments, configESLintPlugin, configFormat, configGitHubAction, configGitIgnore, configIgnores, configImportX, configJSX, configJavaScript, configJsdoc, configJsonc, configMarkdown, configNode, configNtnyq, configPerfectionist, configPinia, configPnpm, configPrettier, configRegexp, configSVGO, configSort, configSpecials, configTest, configToml, configTypeScript, configUnicorn, configUnoCSS, configUnusedImports, configVue, configYml, defineESLintConfig, ensurePackages, getOverrides, hasPinia, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, interopDefault, isInGitHooksOrRunBySpecifyPackages, mergePrettierOptions, parserPlain, resolveSubOptions };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "4.0.4",
5
- "packageManager": "pnpm@10.8.1",
4
+ "version": "4.2.0",
5
+ "packageManager": "pnpm@10.10.0",
6
6
  "description": "An opinionated ESLint config preset of ntnyq",
7
7
  "keywords": [
8
8
  "eslint",
@@ -73,66 +73,66 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@antfu/install-pkg": "^1.0.0",
76
+ "@antfu/install-pkg": "^1.1.0",
77
77
  "@clack/prompts": "^0.10.1",
78
78
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
79
- "@eslint/js": "^9.24.0",
80
- "@eslint/markdown": "^6.3.0",
81
- "@unocss/eslint-plugin": "^66.1.0-beta.11",
82
- "@vitest/eslint-plugin": "^1.1.42",
79
+ "@eslint/js": "^9.26.0",
80
+ "@eslint/markdown": "^6.4.0",
81
+ "@unocss/eslint-plugin": "^66.1.0",
82
+ "@vitest/eslint-plugin": "^1.1.44",
83
83
  "eslint-config-flat-gitignore": "^2.1.0",
84
84
  "eslint-flat-config-utils": "^2.0.1",
85
- "eslint-import-resolver-typescript": "^4.3.2",
85
+ "eslint-import-resolver-typescript": "^4.3.4",
86
86
  "eslint-merge-processors": "^2.0.0",
87
87
  "eslint-plugin-antfu": "^3.1.1",
88
88
  "eslint-plugin-command": "^3.2.0",
89
89
  "eslint-plugin-de-morgan": "^1.2.1",
90
- "eslint-plugin-depend": "^1.0.0",
91
- "eslint-plugin-github-action": "^0.0.15",
92
- "eslint-plugin-import-x": "^4.10.3",
93
- "eslint-plugin-jsdoc": "^50.6.9",
90
+ "eslint-plugin-depend": "^1.1.0",
91
+ "eslint-plugin-github-action": "^0.0.16",
92
+ "eslint-plugin-import-x": "^4.11.0",
93
+ "eslint-plugin-jsdoc": "^50.6.11",
94
94
  "eslint-plugin-jsonc": "^2.20.0",
95
95
  "eslint-plugin-n": "^17.17.0",
96
96
  "eslint-plugin-no-only-tests": "^3.3.0",
97
97
  "eslint-plugin-ntnyq": "^0.11.0",
98
- "eslint-plugin-perfectionist": "^4.11.0",
98
+ "eslint-plugin-perfectionist": "^4.12.3",
99
99
  "eslint-plugin-pinia": "^0.4.1",
100
100
  "eslint-plugin-pnpm": "^0.3.1",
101
- "eslint-plugin-prettier": "^5.2.6",
101
+ "eslint-plugin-prettier": "^5.4.0",
102
102
  "eslint-plugin-regexp": "^2.7.0",
103
- "eslint-plugin-svgo": "^0.7.1",
103
+ "eslint-plugin-svgo": "^0.7.2",
104
104
  "eslint-plugin-toml": "^0.12.0",
105
- "eslint-plugin-unicorn": "^58.0.0",
106
- "eslint-plugin-vue": "^10.0.0",
107
- "eslint-plugin-yml": "^1.17.0",
105
+ "eslint-plugin-unicorn": "^59.0.1",
106
+ "eslint-plugin-vue": "^10.1.0",
107
+ "eslint-plugin-yml": "^1.18.0",
108
108
  "eslint-processor-vue-blocks": "^2.0.0",
109
- "globals": "^16.0.0",
109
+ "globals": "^16.1.0",
110
110
  "jsonc-eslint-parser": "^2.4.0",
111
111
  "local-pkg": "^1.1.1",
112
112
  "prettier": "^3.5.3",
113
113
  "toml-eslint-parser": "^0.10.0",
114
- "typescript-eslint": "^8.30.1",
114
+ "typescript-eslint": "^8.32.0",
115
115
  "vue-eslint-parser": "^10.1.3",
116
116
  "yaml-eslint-parser": "^1.3.0"
117
117
  },
118
118
  "devDependencies": {
119
119
  "@ntnyq/prettier-config": "^2.0.0",
120
- "@types/node": "^22.14.1",
120
+ "@types/node": "^22.15.14",
121
121
  "bumpp": "^10.1.0",
122
- "eslint": "^9.24.0",
122
+ "eslint": "^9.26.0",
123
123
  "eslint-parser-plain": "^0.1.1",
124
124
  "eslint-plugin-eslint-plugin": "^6.4.0",
125
125
  "eslint-typegen": "^2.1.0",
126
126
  "husky": "^9.1.7",
127
127
  "jiti": "^2.4.2",
128
128
  "nano-staged": "^0.8.0",
129
- "npm-run-all2": "^7.0.2",
130
- "tinyglobby": "^0.2.12",
131
- "tsx": "^4.19.3",
129
+ "npm-run-all2": "^8.0.1",
130
+ "tinyglobby": "^0.2.13",
131
+ "tsx": "^4.19.4",
132
132
  "typescript": "^5.8.3",
133
133
  "unbuild": "^3.5.0",
134
- "uncase": "^0.0.4",
135
- "vitest": "^3.1.1"
134
+ "uncase": "^0.1.0",
135
+ "vitest": "^3.1.3"
136
136
  },
137
137
  "engines": {
138
138
  "node": ">=18.18.0"