@lincy/eslint-config 5.2.2 → 5.2.4
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 +24 -6
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +23 -5
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -99,7 +99,7 @@ __export(src_exports, {
|
|
|
99
99
|
});
|
|
100
100
|
module.exports = __toCommonJS(src_exports);
|
|
101
101
|
|
|
102
|
-
// node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.
|
|
102
|
+
// node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.47_tsx@4.19.1_typescript@5.6.2_yaml@2.5.1/node_modules/tsup/assets/cjs_shims.js
|
|
103
103
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
104
104
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
105
105
|
|
|
@@ -215,7 +215,7 @@ var GLOB_EXCLUDE = [
|
|
|
215
215
|
async function disables() {
|
|
216
216
|
return [
|
|
217
217
|
{
|
|
218
|
-
files: [
|
|
218
|
+
files: [`**/scripts/${GLOB_SRC}`],
|
|
219
219
|
name: "eslint/disables/scripts",
|
|
220
220
|
rules: {
|
|
221
221
|
"no-console": "off",
|
|
@@ -223,7 +223,7 @@ async function disables() {
|
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
|
-
files: [
|
|
226
|
+
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
227
227
|
name: "eslint/disables/cli",
|
|
228
228
|
rules: {
|
|
229
229
|
"no-console": "off"
|
|
@@ -1055,6 +1055,7 @@ async function markdown(options = {}) {
|
|
|
1055
1055
|
"style/comma-dangle": "off",
|
|
1056
1056
|
"style/eol-last": "off",
|
|
1057
1057
|
"ts/consistent-type-imports": "off",
|
|
1058
|
+
"ts/explicit-function-return-type": "off",
|
|
1058
1059
|
"ts/no-namespace": "off",
|
|
1059
1060
|
"ts/no-redeclare": "off",
|
|
1060
1061
|
"ts/no-require-imports": "off",
|
|
@@ -1765,7 +1766,7 @@ async function typescript(options = {}) {
|
|
|
1765
1766
|
"ts/no-import-type-side-effects": "error",
|
|
1766
1767
|
"ts/no-invalid-void-type": "off",
|
|
1767
1768
|
"ts/no-non-null-assertion": "off",
|
|
1768
|
-
"ts/no-redeclare": "error",
|
|
1769
|
+
"ts/no-redeclare": ["error", { builtinGlobals: false }],
|
|
1769
1770
|
"ts/no-require-imports": "error",
|
|
1770
1771
|
"ts/no-unused-expressions": ["error", {
|
|
1771
1772
|
// allowShortCircuit 设置为 true 将允许你在表达式中使用短路计算(默认值:false)
|
|
@@ -1775,12 +1776,24 @@ async function typescript(options = {}) {
|
|
|
1775
1776
|
// allowTernary 设置为 true 将使你能够在表达式中使用三元运算符,类似于短路计算(默认值:false)
|
|
1776
1777
|
allowTernary: true
|
|
1777
1778
|
}],
|
|
1778
|
-
"ts/no-unused-vars":
|
|
1779
|
+
"ts/no-unused-vars": [
|
|
1780
|
+
"error",
|
|
1781
|
+
{
|
|
1782
|
+
args: "all",
|
|
1783
|
+
argsIgnorePattern: "^_",
|
|
1784
|
+
caughtErrors: "all",
|
|
1785
|
+
caughtErrorsIgnorePattern: "^_",
|
|
1786
|
+
destructuredArrayIgnorePattern: "^_",
|
|
1787
|
+
ignoreRestSiblings: true,
|
|
1788
|
+
varsIgnorePattern: "^_"
|
|
1789
|
+
}
|
|
1790
|
+
],
|
|
1779
1791
|
"ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
1780
1792
|
"ts/no-useless-constructor": "off",
|
|
1781
1793
|
"ts/no-wrapper-object-types": "error",
|
|
1782
1794
|
"ts/triple-slash-reference": "off",
|
|
1783
1795
|
"ts/unified-signatures": "off",
|
|
1796
|
+
"unused-imports/no-unused-vars": "off",
|
|
1784
1797
|
...type === "lib" ? {
|
|
1785
1798
|
"ts/explicit-function-return-type": ["error", {
|
|
1786
1799
|
allowExpressions: true,
|
|
@@ -1958,6 +1971,7 @@ async function vue(options = {}) {
|
|
|
1958
1971
|
...pluginVue.configs.recommended.rules
|
|
1959
1972
|
},
|
|
1960
1973
|
"node/prefer-global/process": "off",
|
|
1974
|
+
"ts/explicit-function-return-type": "off",
|
|
1961
1975
|
"vue/block-order": ["error", {
|
|
1962
1976
|
order: ["template", "script", "style"]
|
|
1963
1977
|
}],
|
|
@@ -2140,6 +2154,7 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2140
2154
|
autoRenamePlugins = true,
|
|
2141
2155
|
componentExts = [],
|
|
2142
2156
|
gitignore: enableGitignore = true,
|
|
2157
|
+
ignores: ignoresList = [],
|
|
2143
2158
|
jsx: enableJsx = true,
|
|
2144
2159
|
overrides = {},
|
|
2145
2160
|
react: enableReact = ReactPackages.some((i) => (0, import_local_pkg4.isPackageExists)(i)),
|
|
@@ -2178,7 +2193,10 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2178
2193
|
}
|
|
2179
2194
|
configs2.push(
|
|
2180
2195
|
ignores({
|
|
2181
|
-
ignores:
|
|
2196
|
+
ignores: [
|
|
2197
|
+
...overrides.ignores || [],
|
|
2198
|
+
...ignoresList
|
|
2199
|
+
]
|
|
2182
2200
|
}),
|
|
2183
2201
|
javascript({
|
|
2184
2202
|
isInEditor,
|
package/dist/index.d.cts
CHANGED
|
@@ -12598,6 +12598,19 @@ type TsRestrictTemplateExpressions = []|[{
|
|
|
12598
12598
|
allowRegExp?: boolean
|
|
12599
12599
|
|
|
12600
12600
|
allowNever?: boolean
|
|
12601
|
+
|
|
12602
|
+
allow?: (string | {
|
|
12603
|
+
from: "file"
|
|
12604
|
+
name: (string | [string, ...(string)[]])
|
|
12605
|
+
path?: string
|
|
12606
|
+
} | {
|
|
12607
|
+
from: "lib"
|
|
12608
|
+
name: (string | [string, ...(string)[]])
|
|
12609
|
+
} | {
|
|
12610
|
+
from: "package"
|
|
12611
|
+
name: (string | [string, ...(string)[]])
|
|
12612
|
+
package: string
|
|
12613
|
+
})[]
|
|
12601
12614
|
}]
|
|
12602
12615
|
// ----- ts/return-await -----
|
|
12603
12616
|
type TsReturnAwait = []|[(("always" | "error-handling-correctness-only" | "in-try-catch" | "never") & string)]
|
package/dist/index.d.ts
CHANGED
|
@@ -12598,6 +12598,19 @@ type TsRestrictTemplateExpressions = []|[{
|
|
|
12598
12598
|
allowRegExp?: boolean
|
|
12599
12599
|
|
|
12600
12600
|
allowNever?: boolean
|
|
12601
|
+
|
|
12602
|
+
allow?: (string | {
|
|
12603
|
+
from: "file"
|
|
12604
|
+
name: (string | [string, ...(string)[]])
|
|
12605
|
+
path?: string
|
|
12606
|
+
} | {
|
|
12607
|
+
from: "lib"
|
|
12608
|
+
name: (string | [string, ...(string)[]])
|
|
12609
|
+
} | {
|
|
12610
|
+
from: "package"
|
|
12611
|
+
name: (string | [string, ...(string)[]])
|
|
12612
|
+
package: string
|
|
12613
|
+
})[]
|
|
12601
12614
|
}]
|
|
12602
12615
|
// ----- ts/return-await -----
|
|
12603
12616
|
type TsReturnAwait = []|[(("always" | "error-handling-correctness-only" | "in-try-catch" | "never") & string)]
|
package/dist/index.js
CHANGED
|
@@ -110,7 +110,7 @@ var GLOB_EXCLUDE = [
|
|
|
110
110
|
async function disables() {
|
|
111
111
|
return [
|
|
112
112
|
{
|
|
113
|
-
files: [
|
|
113
|
+
files: [`**/scripts/${GLOB_SRC}`],
|
|
114
114
|
name: "eslint/disables/scripts",
|
|
115
115
|
rules: {
|
|
116
116
|
"no-console": "off",
|
|
@@ -118,7 +118,7 @@ async function disables() {
|
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
files: [
|
|
121
|
+
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
|
122
122
|
name: "eslint/disables/cli",
|
|
123
123
|
rules: {
|
|
124
124
|
"no-console": "off"
|
|
@@ -950,6 +950,7 @@ async function markdown(options = {}) {
|
|
|
950
950
|
"style/comma-dangle": "off",
|
|
951
951
|
"style/eol-last": "off",
|
|
952
952
|
"ts/consistent-type-imports": "off",
|
|
953
|
+
"ts/explicit-function-return-type": "off",
|
|
953
954
|
"ts/no-namespace": "off",
|
|
954
955
|
"ts/no-redeclare": "off",
|
|
955
956
|
"ts/no-require-imports": "off",
|
|
@@ -1660,7 +1661,7 @@ async function typescript(options = {}) {
|
|
|
1660
1661
|
"ts/no-import-type-side-effects": "error",
|
|
1661
1662
|
"ts/no-invalid-void-type": "off",
|
|
1662
1663
|
"ts/no-non-null-assertion": "off",
|
|
1663
|
-
"ts/no-redeclare": "error",
|
|
1664
|
+
"ts/no-redeclare": ["error", { builtinGlobals: false }],
|
|
1664
1665
|
"ts/no-require-imports": "error",
|
|
1665
1666
|
"ts/no-unused-expressions": ["error", {
|
|
1666
1667
|
// allowShortCircuit 设置为 true 将允许你在表达式中使用短路计算(默认值:false)
|
|
@@ -1670,12 +1671,24 @@ async function typescript(options = {}) {
|
|
|
1670
1671
|
// allowTernary 设置为 true 将使你能够在表达式中使用三元运算符,类似于短路计算(默认值:false)
|
|
1671
1672
|
allowTernary: true
|
|
1672
1673
|
}],
|
|
1673
|
-
"ts/no-unused-vars":
|
|
1674
|
+
"ts/no-unused-vars": [
|
|
1675
|
+
"error",
|
|
1676
|
+
{
|
|
1677
|
+
args: "all",
|
|
1678
|
+
argsIgnorePattern: "^_",
|
|
1679
|
+
caughtErrors: "all",
|
|
1680
|
+
caughtErrorsIgnorePattern: "^_",
|
|
1681
|
+
destructuredArrayIgnorePattern: "^_",
|
|
1682
|
+
ignoreRestSiblings: true,
|
|
1683
|
+
varsIgnorePattern: "^_"
|
|
1684
|
+
}
|
|
1685
|
+
],
|
|
1674
1686
|
"ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
1675
1687
|
"ts/no-useless-constructor": "off",
|
|
1676
1688
|
"ts/no-wrapper-object-types": "error",
|
|
1677
1689
|
"ts/triple-slash-reference": "off",
|
|
1678
1690
|
"ts/unified-signatures": "off",
|
|
1691
|
+
"unused-imports/no-unused-vars": "off",
|
|
1679
1692
|
...type === "lib" ? {
|
|
1680
1693
|
"ts/explicit-function-return-type": ["error", {
|
|
1681
1694
|
allowExpressions: true,
|
|
@@ -1853,6 +1866,7 @@ async function vue(options = {}) {
|
|
|
1853
1866
|
...pluginVue.configs.recommended.rules
|
|
1854
1867
|
},
|
|
1855
1868
|
"node/prefer-global/process": "off",
|
|
1869
|
+
"ts/explicit-function-return-type": "off",
|
|
1856
1870
|
"vue/block-order": ["error", {
|
|
1857
1871
|
order: ["template", "script", "style"]
|
|
1858
1872
|
}],
|
|
@@ -2035,6 +2049,7 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2035
2049
|
autoRenamePlugins = true,
|
|
2036
2050
|
componentExts = [],
|
|
2037
2051
|
gitignore: enableGitignore = true,
|
|
2052
|
+
ignores: ignoresList = [],
|
|
2038
2053
|
jsx: enableJsx = true,
|
|
2039
2054
|
overrides = {},
|
|
2040
2055
|
react: enableReact = ReactPackages.some((i) => isPackageExists3(i)),
|
|
@@ -2073,7 +2088,10 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2073
2088
|
}
|
|
2074
2089
|
configs2.push(
|
|
2075
2090
|
ignores({
|
|
2076
|
-
ignores:
|
|
2091
|
+
ignores: [
|
|
2092
|
+
...overrides.ignores || [],
|
|
2093
|
+
...ignoresList
|
|
2094
|
+
]
|
|
2077
2095
|
}),
|
|
2078
2096
|
javascript({
|
|
2079
2097
|
isInEditor,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.4",
|
|
5
5
|
"packageManager": "pnpm@9.1.0",
|
|
6
6
|
"description": "LinCenYing's ESLint config",
|
|
7
7
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
@@ -72,24 +72,24 @@
|
|
|
72
72
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
73
73
|
"@eslint/markdown": "^6.1.0",
|
|
74
74
|
"@stylistic/eslint-plugin": "2.8.0",
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
76
|
-
"@typescript-eslint/parser": "8.
|
|
77
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "8.6.0",
|
|
76
|
+
"@typescript-eslint/parser": "8.6.0",
|
|
77
|
+
"@vitest/eslint-plugin": "^1.1.4",
|
|
78
78
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
79
79
|
"eslint-flat-config-utils": "^0.4.0",
|
|
80
80
|
"eslint-merge-processors": "^0.1.0",
|
|
81
81
|
"eslint-parser-plain": "^0.1.0",
|
|
82
82
|
"eslint-plugin-antfu": "^2.6.0",
|
|
83
83
|
"eslint-plugin-import-x": "^4.2.1",
|
|
84
|
-
"eslint-plugin-jsdoc": "^50.2.
|
|
84
|
+
"eslint-plugin-jsdoc": "^50.2.3",
|
|
85
85
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
86
86
|
"eslint-plugin-n": "^17.10.2",
|
|
87
87
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
88
|
-
"eslint-plugin-perfectionist": "^3.
|
|
88
|
+
"eslint-plugin-perfectionist": "^3.6.0",
|
|
89
89
|
"eslint-plugin-regexp": "^2.6.0",
|
|
90
90
|
"eslint-plugin-toml": "^0.11.1",
|
|
91
91
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
92
|
-
"eslint-plugin-unused-imports": "^4.1.
|
|
92
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
93
93
|
"eslint-plugin-vue": "^9.28.0",
|
|
94
94
|
"eslint-plugin-yml": "^1.14.0",
|
|
95
95
|
"eslint-processor-vue-blocks": "^0.1.2",
|
|
@@ -111,14 +111,14 @@
|
|
|
111
111
|
"@lincy/eslint-config": "workspace:*",
|
|
112
112
|
"@prettier/plugin-xml": "^3.4.1",
|
|
113
113
|
"@stylistic/eslint-plugin-migrate": "^2.8.0",
|
|
114
|
-
"@types/node": "^22.5.
|
|
114
|
+
"@types/node": "^22.5.5",
|
|
115
115
|
"@types/prompts": "^2.4.9",
|
|
116
|
-
"@unocss/eslint-plugin": "^0.62.
|
|
116
|
+
"@unocss/eslint-plugin": "^0.62.4",
|
|
117
117
|
"bumpp": "^9.5.2",
|
|
118
118
|
"eslint": "^9.10.0",
|
|
119
119
|
"eslint-plugin-format": "^0.1.2",
|
|
120
120
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
121
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
121
|
+
"eslint-plugin-react-refresh": "^0.4.12",
|
|
122
122
|
"eslint-ts-patch": "9.8.0-1",
|
|
123
123
|
"eslint-typegen": "^0.3.2",
|
|
124
124
|
"esno": "^4.7.0",
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
"tsup": "^8.2.4",
|
|
133
133
|
"typescript": "^5.6.2",
|
|
134
134
|
"unbuild": "^2.0.0",
|
|
135
|
-
"vitest": "^2.1.
|
|
136
|
-
"vue": "^3.5.
|
|
135
|
+
"vitest": "^2.1.1",
|
|
136
|
+
"vue": "^3.5.6"
|
|
137
137
|
},
|
|
138
138
|
"pnpm": {
|
|
139
139
|
"peerDependencyRules": {
|