@liwo/eslint-config 0.0.3 → 0.0.5
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/README.md +8 -0
- package/dist/index.d.ts +16 -14
- package/dist/index.js +4 -3
- package/package.json +45 -61
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
# @liwo/eslint-config
|
|
2
2
|
|
|
3
3
|
Hard-forked from `@antfu/eslint-config`. It adopts a more opinionated and aggressive approach, making it generally unsuitable for the majority of users.
|
|
4
|
+
|
|
5
|
+
## Acknowledgements
|
|
6
|
+
|
|
7
|
+
Thanks to the community and developers for their contributions!
|
|
8
|
+
|
|
9
|
+
This project is deployed on GitHub Pages and Netlify.
|
|
10
|
+
|
|
11
|
+
[](https://www.netlify.com/?source=liwo)
|
package/dist/index.d.ts
CHANGED
|
@@ -1081,7 +1081,7 @@ interface RuleOptions {
|
|
|
1081
1081
|
* Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row
|
|
1082
1082
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/table-column-count.md
|
|
1083
1083
|
*/
|
|
1084
|
-
'markdown/table-column-count'?: Linter.RuleEntry<
|
|
1084
|
+
'markdown/table-column-count'?: Linter.RuleEntry<MarkdownTableColumnCount>;
|
|
1085
1085
|
/**
|
|
1086
1086
|
* Enforce a maximum number of classes per file
|
|
1087
1087
|
* @see https://eslint.org/docs/latest/rules/max-classes-per-file
|
|
@@ -7226,6 +7226,7 @@ type AccessorPairs = [] | [{
|
|
|
7226
7226
|
getWithoutSet?: boolean;
|
|
7227
7227
|
setWithoutGet?: boolean;
|
|
7228
7228
|
enforceForClassMembers?: boolean;
|
|
7229
|
+
enforceForTSTypes?: boolean;
|
|
7229
7230
|
}];
|
|
7230
7231
|
// ----- antfu/consistent-chaining -----
|
|
7231
7232
|
type AntfuConsistentChaining = [] | [{
|
|
@@ -7474,7 +7475,9 @@ type GetterReturn = [] | [{
|
|
|
7474
7475
|
allowImplicit?: boolean;
|
|
7475
7476
|
}];
|
|
7476
7477
|
// ----- grouped-accessor-pairs -----
|
|
7477
|
-
type GroupedAccessorPairs = [] | [("anyOrder" | "getBeforeSet" | "setBeforeGet")]
|
|
7478
|
+
type GroupedAccessorPairs = [] | [("anyOrder" | "getBeforeSet" | "setBeforeGet")] | [("anyOrder" | "getBeforeSet" | "setBeforeGet"), {
|
|
7479
|
+
enforceForTSTypes?: boolean;
|
|
7480
|
+
}];
|
|
7478
7481
|
// ----- handle-callback-err -----
|
|
7479
7482
|
type HandleCallbackErr = [] | [string];
|
|
7480
7483
|
// ----- id-blacklist -----
|
|
@@ -8725,6 +8728,10 @@ type MarkdownNoUnusedDefinitions = [] | [{
|
|
|
8725
8728
|
allowDefinitions?: string[];
|
|
8726
8729
|
allowFootnoteDefinitions?: string[];
|
|
8727
8730
|
}];
|
|
8731
|
+
// ----- markdown/table-column-count -----
|
|
8732
|
+
type MarkdownTableColumnCount = [] | [{
|
|
8733
|
+
checkMissingCells?: boolean;
|
|
8734
|
+
}];
|
|
8728
8735
|
// ----- max-classes-per-file -----
|
|
8729
8736
|
type MaxClassesPerFile = [] | [(number | {
|
|
8730
8737
|
ignoreExpressions?: boolean;
|
|
@@ -9202,6 +9209,7 @@ type NoUnusedVars = [] | [(("all" | "local") | {
|
|
|
9202
9209
|
caughtErrorsIgnorePattern?: string;
|
|
9203
9210
|
destructuredArrayIgnorePattern?: string;
|
|
9204
9211
|
ignoreClassWithStaticInitBlock?: boolean;
|
|
9212
|
+
ignoreUsingDeclarations?: boolean;
|
|
9205
9213
|
reportUsedIgnorePattern?: boolean;
|
|
9206
9214
|
})];
|
|
9207
9215
|
// ----- no-use-before-define -----
|
|
@@ -12679,11 +12687,12 @@ type StylePaddedBlocks = [] | [(("always" | "never" | "start" | "end") | {
|
|
|
12679
12687
|
}];
|
|
12680
12688
|
// ----- style/padding-line-between-statements -----
|
|
12681
12689
|
type _StylePaddingLineBetweenStatementsPaddingType = ("any" | "never" | "always");
|
|
12682
|
-
type
|
|
12690
|
+
type _StylePaddingLineBetweenStatementsStatementOption = (_StylePaddingLineBetweenStatementsStatementType | [_StylePaddingLineBetweenStatementsStatementType, ...(_StylePaddingLineBetweenStatementsStatementType)[]]);
|
|
12691
|
+
type _StylePaddingLineBetweenStatementsStatementType = ("*" | "exports" | "require" | "directive" | "iife" | "block" | "empty" | "function" | "ts-method" | "break" | "case" | "class" | "continue" | "debugger" | "default" | "do" | "for" | "if" | "import" | "return" | "switch" | "throw" | "try" | "while" | "with" | "cjs-export" | "cjs-import" | "enum" | "interface" | "type" | "function-overload" | "block-like" | "singleline-block-like" | "multiline-block-like" | "expression" | "singleline-expression" | "multiline-expression" | "export" | "singleline-export" | "multiline-export" | "var" | "singleline-var" | "multiline-var" | "let" | "singleline-let" | "multiline-let" | "const" | "singleline-const" | "multiline-const" | "using" | "singleline-using" | "multiline-using");
|
|
12683
12692
|
type StylePaddingLineBetweenStatements = {
|
|
12684
12693
|
blankLine: _StylePaddingLineBetweenStatementsPaddingType;
|
|
12685
|
-
prev:
|
|
12686
|
-
next:
|
|
12694
|
+
prev: _StylePaddingLineBetweenStatementsStatementOption;
|
|
12695
|
+
next: _StylePaddingLineBetweenStatementsStatementOption;
|
|
12687
12696
|
}[];
|
|
12688
12697
|
// ----- style/quote-props -----
|
|
12689
12698
|
type StyleQuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
|
|
@@ -13814,7 +13823,6 @@ type TsPreferDestructuring = [] | [({
|
|
|
13814
13823
|
}), {
|
|
13815
13824
|
enforceForDeclarationWithTypeAnnotation?: boolean;
|
|
13816
13825
|
enforceForRenamedProperties?: boolean;
|
|
13817
|
-
[k: string]: unknown | undefined;
|
|
13818
13826
|
}];
|
|
13819
13827
|
// ----- ts/prefer-literal-enum-member -----
|
|
13820
13828
|
type TsPreferLiteralEnumMember = [] | [{
|
|
@@ -13832,7 +13840,6 @@ type TsPreferNullishCoalescing = [] | [{
|
|
|
13832
13840
|
boolean?: boolean;
|
|
13833
13841
|
number?: boolean;
|
|
13834
13842
|
string?: boolean;
|
|
13835
|
-
[k: string]: unknown | undefined;
|
|
13836
13843
|
} | true);
|
|
13837
13844
|
ignoreTernaryTests?: boolean;
|
|
13838
13845
|
}];
|
|
@@ -16047,12 +16054,7 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
16047
16054
|
/**
|
|
16048
16055
|
* Enable react rules.
|
|
16049
16056
|
*
|
|
16050
|
-
*
|
|
16051
|
-
* - `@eslint-react/eslint-plugin`
|
|
16052
|
-
* - `eslint-plugin-react-hooks`
|
|
16053
|
-
* - `eslint-plugin-react-refresh`
|
|
16054
|
-
*
|
|
16055
|
-
* @default false
|
|
16057
|
+
* @default auto-detect based on the dependencies
|
|
16056
16058
|
*/
|
|
16057
16059
|
react?: boolean | OptionsOverrides;
|
|
16058
16060
|
/**
|
|
@@ -16083,7 +16085,7 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
16083
16085
|
*
|
|
16084
16086
|
* When set to `true`, it will enable all formatters.
|
|
16085
16087
|
*
|
|
16086
|
-
* @default
|
|
16088
|
+
* @default true
|
|
16087
16089
|
*/
|
|
16088
16090
|
formatters?: boolean | OptionsFormatters;
|
|
16089
16091
|
/**
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ async function comments() {
|
|
|
31
31
|
rules: {
|
|
32
32
|
"eslint-comments/no-aggregating-enable": "error",
|
|
33
33
|
"eslint-comments/no-duplicate-disable": "error",
|
|
34
|
-
"eslint-comments/no-unlimited-disable": "
|
|
34
|
+
"eslint-comments/no-unlimited-disable": "off",
|
|
35
35
|
"eslint-comments/no-unused-enable": "error"
|
|
36
36
|
}
|
|
37
37
|
}];
|
|
@@ -316,6 +316,7 @@ async function stylistic(options = {}) {
|
|
|
316
316
|
after: true,
|
|
317
317
|
before: false
|
|
318
318
|
}],
|
|
319
|
+
"style/max-statements-per-line": "off",
|
|
319
320
|
"style/yield-star-spacing": ["error", {
|
|
320
321
|
after: true,
|
|
321
322
|
before: false
|
|
@@ -1977,7 +1978,7 @@ const defaultPluginRenaming = {
|
|
|
1977
1978
|
* The merged ESLint configurations.
|
|
1978
1979
|
*/
|
|
1979
1980
|
function eslintConfig(options = {}, ...userConfigs) {
|
|
1980
|
-
const { autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact =
|
|
1981
|
+
const { autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact = isPackageExists("react"), regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1981
1982
|
let isInEditor = options.isInEditor;
|
|
1982
1983
|
if (isInEditor == null) {
|
|
1983
1984
|
isInEditor = isInEditorEnv();
|
|
@@ -2055,7 +2056,7 @@ function eslintConfig(options = {}, ...userConfigs) {
|
|
|
2055
2056
|
componentExts,
|
|
2056
2057
|
overrides: getOverrides(options, "markdown")
|
|
2057
2058
|
}));
|
|
2058
|
-
if (options.formatters) configs$1.push(formatters(options.formatters, typeof stylisticOptions === "boolean" ? {} : stylisticOptions));
|
|
2059
|
+
if (options.formatters || options.formatters === void 0) configs$1.push(formatters(options.formatters, typeof stylisticOptions === "boolean" ? {} : stylisticOptions));
|
|
2059
2060
|
configs$1.push(disables());
|
|
2060
2061
|
if ("files" in options) throw new Error("[@liwo/eslint-config] The first argument should not contain the \"files\" property as the options are supposed to be global. Place it in the second or later config instead.");
|
|
2061
2062
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liwo/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"description": "ESLint config by Liwo",
|
|
6
6
|
"author": "Aoang <aoang@x2oe.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,35 +25,18 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
29
28
|
"@prettier/plugin-xml": "^3.4.2",
|
|
30
29
|
"@unocss/eslint-plugin": "^66.3.3",
|
|
31
|
-
"eslint": "^9.31.0",
|
|
32
|
-
"eslint-plugin-format": "^1.0.1",
|
|
33
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
34
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
35
30
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
36
31
|
"prettier-plugin-slidev": "^1.0.5"
|
|
37
32
|
},
|
|
38
33
|
"peerDependenciesMeta": {
|
|
39
|
-
"@eslint-react/eslint-plugin": {
|
|
40
|
-
"optional": true
|
|
41
|
-
},
|
|
42
34
|
"@prettier/plugin-xml": {
|
|
43
35
|
"optional": true
|
|
44
36
|
},
|
|
45
37
|
"@unocss/eslint-plugin": {
|
|
46
38
|
"optional": true
|
|
47
39
|
},
|
|
48
|
-
"eslint-plugin-format": {
|
|
49
|
-
"optional": true
|
|
50
|
-
},
|
|
51
|
-
"eslint-plugin-react-hooks": {
|
|
52
|
-
"optional": true
|
|
53
|
-
},
|
|
54
|
-
"eslint-plugin-react-refresh": {
|
|
55
|
-
"optional": true
|
|
56
|
-
},
|
|
57
40
|
"eslint-plugin-vuejs-accessibility": {
|
|
58
41
|
"optional": true
|
|
59
42
|
},
|
|
@@ -62,65 +45,66 @@
|
|
|
62
45
|
}
|
|
63
46
|
},
|
|
64
47
|
"dependencies": {
|
|
65
|
-
"@antfu/install-pkg": "
|
|
66
|
-
"@clack/prompts": "
|
|
67
|
-
"@eslint-community/eslint-plugin-eslint-comments": "
|
|
68
|
-
"@eslint/
|
|
69
|
-
"@
|
|
70
|
-
"@
|
|
71
|
-
"@typescript-eslint/
|
|
72
|
-
"@
|
|
73
|
-
"eslint-
|
|
74
|
-
"eslint
|
|
75
|
-
"eslint-
|
|
76
|
-
"eslint-
|
|
77
|
-
"eslint-
|
|
78
|
-
"eslint-plugin-
|
|
79
|
-
"eslint-plugin-
|
|
80
|
-
"eslint-plugin-
|
|
81
|
-
"eslint-plugin-
|
|
82
|
-
"eslint-plugin-
|
|
83
|
-
"eslint-plugin-
|
|
84
|
-
"eslint-plugin-
|
|
85
|
-
"eslint-plugin-
|
|
86
|
-
"eslint-plugin-
|
|
87
|
-
"eslint-plugin-
|
|
88
|
-
"eslint-plugin-
|
|
89
|
-
"eslint-plugin-
|
|
90
|
-
"eslint-plugin-
|
|
91
|
-
"eslint-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
48
|
+
"@antfu/install-pkg": "1.1.0",
|
|
49
|
+
"@clack/prompts": "0.11.0",
|
|
50
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
51
|
+
"@eslint-react/eslint-plugin": "1.52.3",
|
|
52
|
+
"@eslint/markdown": "7.1.0",
|
|
53
|
+
"@stylistic/eslint-plugin": "5.2.2",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "8.38.0",
|
|
55
|
+
"@typescript-eslint/parser": "8.38.0",
|
|
56
|
+
"@vitest/eslint-plugin": "1.3.4",
|
|
57
|
+
"eslint": "9.32.0",
|
|
58
|
+
"eslint-config-flat-gitignore": "2.1.0",
|
|
59
|
+
"eslint-flat-config-utils": "2.1.1",
|
|
60
|
+
"eslint-merge-processors": "2.0.0",
|
|
61
|
+
"eslint-plugin-antfu": "3.1.1",
|
|
62
|
+
"eslint-plugin-command": "3.3.1",
|
|
63
|
+
"eslint-plugin-format": "1.0.1",
|
|
64
|
+
"eslint-plugin-import-lite": "0.3.0",
|
|
65
|
+
"eslint-plugin-jsdoc": "52.0.0",
|
|
66
|
+
"eslint-plugin-jsonc": "2.20.1",
|
|
67
|
+
"eslint-plugin-n": "17.21.3",
|
|
68
|
+
"eslint-plugin-no-only-tests": "3.3.0",
|
|
69
|
+
"eslint-plugin-perfectionist": "4.15.0",
|
|
70
|
+
"eslint-plugin-pnpm": "1.1.0",
|
|
71
|
+
"eslint-plugin-react-hooks": "5.2.0",
|
|
72
|
+
"eslint-plugin-react-refresh": "0.4.20",
|
|
73
|
+
"eslint-plugin-regexp": "2.9.0",
|
|
74
|
+
"eslint-plugin-toml": "0.12.0",
|
|
75
|
+
"eslint-plugin-unicorn": "60.0.0",
|
|
76
|
+
"eslint-plugin-unused-imports": "4.1.4",
|
|
77
|
+
"eslint-plugin-vue": "10.3.0",
|
|
78
|
+
"eslint-plugin-yml": "1.18.0",
|
|
79
|
+
"eslint-processor-vue-blocks": "2.0.0",
|
|
80
|
+
"globals": "16.3.0",
|
|
81
|
+
"jsonc-eslint-parser": "2.4.0",
|
|
82
|
+
"local-pkg": "1.1.1",
|
|
83
|
+
"parse-gitignore": "2.0.0",
|
|
84
|
+
"toml-eslint-parser": "0.10.0",
|
|
85
|
+
"vue-eslint-parser": "10.2.0",
|
|
86
|
+
"yaml-eslint-parser": "1.3.0"
|
|
99
87
|
},
|
|
100
88
|
"devDependencies": {
|
|
101
|
-
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
102
89
|
"@eslint/config-inspector": "^1.1.0",
|
|
103
90
|
"@prettier/plugin-xml": "^3.4.2",
|
|
104
|
-
"@types/node": "24.0
|
|
91
|
+
"@types/node": "24.1.0",
|
|
105
92
|
"@unocss/eslint-plugin": "^66.3.3",
|
|
106
|
-
"eslint": "9.31.0",
|
|
107
|
-
"eslint-plugin-format": "1.0.1",
|
|
108
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
109
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
110
93
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
111
94
|
"eslint-typegen": "^2.2.1",
|
|
112
95
|
"execa": "^9.6.0",
|
|
113
96
|
"lint-staged": "^16.1.2",
|
|
114
97
|
"pnpm-workspace-yaml": "^1.0.0",
|
|
115
98
|
"prettier-plugin-slidev": "^1.0.5",
|
|
99
|
+
"react": "^19.1.0",
|
|
116
100
|
"simple-git-hooks": "^2.13.0",
|
|
117
101
|
"tinyglobby": "^0.2.14",
|
|
118
|
-
"tsdown": "^0.
|
|
102
|
+
"tsdown": "^0.13.0",
|
|
119
103
|
"tsx": "^4.20.3",
|
|
120
104
|
"typescript": "^5.8.3",
|
|
121
105
|
"vitest": "^3.2.4",
|
|
122
106
|
"vue": "^3.5.17",
|
|
123
|
-
"@liwo/eslint-config": "0.0.
|
|
107
|
+
"@liwo/eslint-config": "0.0.5"
|
|
124
108
|
},
|
|
125
109
|
"simple-git-hooks": {
|
|
126
110
|
"pre-commit": "npx lint-staged"
|
|
@@ -135,7 +119,7 @@
|
|
|
135
119
|
"build": "pnpm run gen && tsdown --clean --dts",
|
|
136
120
|
"stub": "tsdown",
|
|
137
121
|
"dev": "npx @eslint/config-inspector --config eslint.config.ts",
|
|
138
|
-
"build:inspector": "pnpm build && npx @eslint/config-inspector build
|
|
122
|
+
"build:inspector": "pnpm build && npx @eslint/config-inspector build && tsx scripts/fixed-netlify.ts",
|
|
139
123
|
"watch": "tsdown --watch",
|
|
140
124
|
"lint": "eslint",
|
|
141
125
|
"gen": "tsx scripts/typegen.ts",
|