@ntnyq/eslint-config 3.10.0 → 3.10.2
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 +56 -37
- package/dist/index.d.cts +157 -125
- package/dist/index.d.ts +157 -125
- package/dist/index.js +50 -34
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -63,6 +63,10 @@ import { default as default24 } from "@eslint-community/eslint-plugin-eslint-com
|
|
|
63
63
|
// src/eslint/configs.ts
|
|
64
64
|
import { configs } from "typescript-eslint";
|
|
65
65
|
|
|
66
|
+
// src/eslint/resolvers.ts
|
|
67
|
+
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
|
68
|
+
var createNodeResolver = default18.createNodeResolver;
|
|
69
|
+
|
|
66
70
|
// src/eslint/processors.ts
|
|
67
71
|
import { mergeProcessors } from "eslint-merge-processors";
|
|
68
72
|
import { processorPassThrough } from "eslint-merge-processors";
|
|
@@ -92,6 +96,7 @@ var GLOB_JSON = "**/*.json";
|
|
|
92
96
|
var GLOB_JSON5 = "**/*.json5";
|
|
93
97
|
var GLOB_JSONC = "**/*.jsonc";
|
|
94
98
|
var GLOB_PACKAGE_JSON = "**/package.json";
|
|
99
|
+
var GLOB_SVG = "**/*.svg";
|
|
95
100
|
var GLOB_VUE = "**/*.vue";
|
|
96
101
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
97
102
|
var GLOB_TOML = "**/*.toml";
|
|
@@ -990,8 +995,6 @@ var vitest = (options = {}) => [
|
|
|
990
995
|
// src/configs/svgo.ts
|
|
991
996
|
import { config as createSVGOConfig } from "eslint-plugin-svgo";
|
|
992
997
|
var svgo = (options = {}) => [
|
|
993
|
-
// TODO: remove after fix type
|
|
994
|
-
// @ts-expect-error type
|
|
995
998
|
{
|
|
996
999
|
...createSVGOConfig(options),
|
|
997
1000
|
name: "ntnyq/svgo"
|
|
@@ -1696,38 +1699,46 @@ var ignores = (customIgnores = []) => [
|
|
|
1696
1699
|
];
|
|
1697
1700
|
|
|
1698
1701
|
// src/configs/importX.ts
|
|
1699
|
-
var
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
"import-x
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1702
|
+
var importX = (options = {}) => {
|
|
1703
|
+
const {
|
|
1704
|
+
typescript: enableTypeScript,
|
|
1705
|
+
// use typescript resolve if possible
|
|
1706
|
+
preferTypeScriptResolver = true
|
|
1707
|
+
} = options;
|
|
1708
|
+
return [
|
|
1709
|
+
{
|
|
1710
|
+
name: "ntnyq/import-x",
|
|
1711
|
+
plugins: {
|
|
1712
|
+
"import-x": default18
|
|
1713
|
+
},
|
|
1714
|
+
settings: {
|
|
1715
|
+
"import-x/resolver-next": [
|
|
1716
|
+
enableTypeScript && preferTypeScriptResolver ? createTypeScriptImportResolver({
|
|
1717
|
+
extensions: [".ts", ".tsx", ".d.ts", ".js", ".jsx", ".json", ".node"]
|
|
1718
|
+
}) : createNodeResolver({
|
|
1719
|
+
extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts", ".json"]
|
|
1720
|
+
})
|
|
1721
|
+
]
|
|
1722
|
+
},
|
|
1723
|
+
rules: {
|
|
1724
|
+
"import-x/no-unresolved": "off",
|
|
1725
|
+
"import-x/no-absolute-path": "off",
|
|
1726
|
+
"import-x/no-named-as-default-member": "off",
|
|
1727
|
+
"import-x/no-named-default": "off",
|
|
1728
|
+
// disabled in favor or `perfectionist/sort-imports`
|
|
1729
|
+
"import-x/order": "off",
|
|
1730
|
+
"import-x/first": "error",
|
|
1731
|
+
"import-x/export": "error",
|
|
1732
|
+
"import-x/no-self-import": "error",
|
|
1733
|
+
"import-x/no-duplicates": "error",
|
|
1734
|
+
"import-x/no-mutable-exports": "error",
|
|
1735
|
+
"import-x/newline-after-import": "error",
|
|
1736
|
+
// Overrides rules
|
|
1737
|
+
...options.overrides
|
|
1738
|
+
}
|
|
1728
1739
|
}
|
|
1729
|
-
|
|
1730
|
-
|
|
1740
|
+
];
|
|
1741
|
+
};
|
|
1731
1742
|
|
|
1732
1743
|
// src/configs/unicorn.ts
|
|
1733
1744
|
var disabledRules2 = {
|
|
@@ -1977,7 +1988,7 @@ var markdown = (options = {}) => {
|
|
|
1977
1988
|
// src/configs/prettier.ts
|
|
1978
1989
|
var prettier = (options = {}) => {
|
|
1979
1990
|
const {
|
|
1980
|
-
disabledFiles = [GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
|
|
1991
|
+
disabledFiles = [GLOB_SVG, GLOB_TOML, GLOB_ASTRO, GLOB_SVELTE],
|
|
1981
1992
|
// User defined disabled files
|
|
1982
1993
|
userDisabledFiles = []
|
|
1983
1994
|
} = options;
|
|
@@ -2922,6 +2933,8 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
2922
2933
|
...resolveSubOptions(options, "command")
|
|
2923
2934
|
}),
|
|
2924
2935
|
...importX({
|
|
2936
|
+
...resolveSubOptions(options, "importX"),
|
|
2937
|
+
typescript: !!enableTypeScript,
|
|
2925
2938
|
overrides: getOverrides(options, "importX")
|
|
2926
2939
|
}),
|
|
2927
2940
|
...jsdoc({
|
|
@@ -3119,6 +3132,7 @@ export {
|
|
|
3119
3132
|
GLOB_SRC_EXT,
|
|
3120
3133
|
GLOB_STYLE,
|
|
3121
3134
|
GLOB_SVELTE,
|
|
3135
|
+
GLOB_SVG,
|
|
3122
3136
|
GLOB_TEST,
|
|
3123
3137
|
GLOB_TOML,
|
|
3124
3138
|
GLOB_TS,
|
|
@@ -3129,6 +3143,8 @@ export {
|
|
|
3129
3143
|
antfu,
|
|
3130
3144
|
command,
|
|
3131
3145
|
comments,
|
|
3146
|
+
createNodeResolver,
|
|
3147
|
+
createTypeScriptImportResolver,
|
|
3132
3148
|
defineESLintConfig,
|
|
3133
3149
|
depend,
|
|
3134
3150
|
esX,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.10.
|
|
4
|
+
"version": "3.10.2",
|
|
5
5
|
"packageManager": "pnpm@9.15.1",
|
|
6
6
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"@vitest/eslint-plugin": "^1.1.20",
|
|
64
64
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
65
65
|
"eslint-flat-config-utils": "^0.4.0",
|
|
66
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
66
67
|
"eslint-merge-processors": "^0.1.0",
|
|
67
68
|
"eslint-plugin-antfu": "^2.7.0",
|
|
68
69
|
"eslint-plugin-command": "^0.2.7",
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
"eslint-plugin-pinia": "^0.4.1",
|
|
80
81
|
"eslint-plugin-prettier": "^5.2.1",
|
|
81
82
|
"eslint-plugin-regexp": "^2.7.0",
|
|
82
|
-
"eslint-plugin-svgo": "^0.
|
|
83
|
+
"eslint-plugin-svgo": "^0.2.0",
|
|
83
84
|
"eslint-plugin-toml": "^0.12.0",
|
|
84
85
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
85
86
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
"devDependencies": {
|
|
99
100
|
"@ntnyq/prettier-config": "^1.22.0",
|
|
100
101
|
"@types/node": "^22.10.2",
|
|
101
|
-
"bumpp": "^9.9.
|
|
102
|
+
"bumpp": "^9.9.2",
|
|
102
103
|
"eslint": "^9.17.0",
|
|
103
104
|
"eslint-typegen": "^0.3.2",
|
|
104
105
|
"husky": "^9.1.7",
|