@lincy/eslint-config 5.1.0 → 5.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.
- package/README.md +29 -0
- package/dist/index.cjs +43 -25
- package/dist/index.d.cts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +43 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -261,6 +261,27 @@ export default lincy({
|
|
|
261
261
|
unocss: {
|
|
262
262
|
// unocss 规则
|
|
263
263
|
},
|
|
264
|
+
comments: {
|
|
265
|
+
// comments 规则
|
|
266
|
+
},
|
|
267
|
+
imports: {
|
|
268
|
+
// imports 规则
|
|
269
|
+
},
|
|
270
|
+
jsdoc: {
|
|
271
|
+
// jsdoc 规则
|
|
272
|
+
},
|
|
273
|
+
node: {
|
|
274
|
+
// node 规则
|
|
275
|
+
},
|
|
276
|
+
perfectionist: {
|
|
277
|
+
// perfectionist 规则
|
|
278
|
+
},
|
|
279
|
+
sort: {
|
|
280
|
+
// sort 规则
|
|
281
|
+
},
|
|
282
|
+
unicorn: {
|
|
283
|
+
// unicorn 规则
|
|
284
|
+
},
|
|
264
285
|
regexp: {
|
|
265
286
|
// regexp 规则
|
|
266
287
|
}
|
|
@@ -325,11 +346,14 @@ export default lincy(
|
|
|
325
346
|
import {
|
|
326
347
|
combine,
|
|
327
348
|
comments,
|
|
349
|
+
disables,
|
|
350
|
+
formatters,
|
|
328
351
|
ignores,
|
|
329
352
|
imports,
|
|
330
353
|
javascript,
|
|
331
354
|
jsdoc,
|
|
332
355
|
jsonc,
|
|
356
|
+
jsx,
|
|
333
357
|
markdown,
|
|
334
358
|
node,
|
|
335
359
|
perfectionist,
|
|
@@ -338,6 +362,7 @@ import {
|
|
|
338
362
|
sortPackageJson,
|
|
339
363
|
sortTsconfig,
|
|
340
364
|
stylistic,
|
|
365
|
+
test,
|
|
341
366
|
toml,
|
|
342
367
|
typescript,
|
|
343
368
|
unicorn,
|
|
@@ -350,6 +375,8 @@ export default combine(
|
|
|
350
375
|
ignores(),
|
|
351
376
|
javascript(/* Options */),
|
|
352
377
|
comments(),
|
|
378
|
+
disables(),
|
|
379
|
+
formatters(),
|
|
353
380
|
node(),
|
|
354
381
|
jsdoc(),
|
|
355
382
|
imports(),
|
|
@@ -361,8 +388,10 @@ export default combine(
|
|
|
361
388
|
react(/* Options */),
|
|
362
389
|
unocss(/* Options */),
|
|
363
390
|
jsonc(),
|
|
391
|
+
jsx(),
|
|
364
392
|
yaml(),
|
|
365
393
|
toml(),
|
|
394
|
+
test(),
|
|
366
395
|
markdown(),
|
|
367
396
|
regexp(),
|
|
368
397
|
)
|
package/dist/index.cjs
CHANGED
|
@@ -117,7 +117,10 @@ var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
|
117
117
|
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
118
118
|
|
|
119
119
|
// src/configs/comments.ts
|
|
120
|
-
async function comments() {
|
|
120
|
+
async function comments(options = {}) {
|
|
121
|
+
const {
|
|
122
|
+
overrides = {}
|
|
123
|
+
} = options;
|
|
121
124
|
return [
|
|
122
125
|
{
|
|
123
126
|
name: "eslint/comments/rules",
|
|
@@ -128,7 +131,8 @@ async function comments() {
|
|
|
128
131
|
"eslint-comments/no-aggregating-enable": "error",
|
|
129
132
|
"eslint-comments/no-duplicate-disable": "error",
|
|
130
133
|
"eslint-comments/no-unlimited-disable": "error",
|
|
131
|
-
"eslint-comments/no-unused-enable": "error"
|
|
134
|
+
"eslint-comments/no-unused-enable": "error",
|
|
135
|
+
...overrides
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
138
|
];
|
|
@@ -628,6 +632,7 @@ async function ignores(options = {}) {
|
|
|
628
632
|
// src/configs/imports.ts
|
|
629
633
|
async function imports(options = {}) {
|
|
630
634
|
const {
|
|
635
|
+
overrides = {},
|
|
631
636
|
stylistic: stylistic2 = true
|
|
632
637
|
} = options;
|
|
633
638
|
return [
|
|
@@ -649,7 +654,8 @@ async function imports(options = {}) {
|
|
|
649
654
|
"import/no-webpack-loader-syntax": "error",
|
|
650
655
|
...stylistic2 ? {
|
|
651
656
|
"import/newline-after-import": ["error", { considerComments: true, count: 1 }]
|
|
652
|
-
} : {}
|
|
657
|
+
} : {},
|
|
658
|
+
...overrides
|
|
653
659
|
}
|
|
654
660
|
}
|
|
655
661
|
];
|
|
@@ -838,16 +844,6 @@ async function javascript(options = {}) {
|
|
|
838
844
|
"prefer-rest-params": "error",
|
|
839
845
|
"prefer-spread": "error",
|
|
840
846
|
"prefer-template": "error",
|
|
841
|
-
"sort-imports": [
|
|
842
|
-
"error",
|
|
843
|
-
{
|
|
844
|
-
allowSeparatedGroups: false,
|
|
845
|
-
ignoreCase: false,
|
|
846
|
-
ignoreDeclarationSort: true,
|
|
847
|
-
ignoreMemberSort: false,
|
|
848
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
849
|
-
}
|
|
850
|
-
],
|
|
851
847
|
"symbol-description": "error",
|
|
852
848
|
"unicode-bom": ["error", "never"],
|
|
853
849
|
"unused-imports/no-unused-imports": isInEditor ? "off" : "error",
|
|
@@ -874,6 +870,7 @@ async function javascript(options = {}) {
|
|
|
874
870
|
// src/configs/jsdoc.ts
|
|
875
871
|
async function jsdoc(options = {}) {
|
|
876
872
|
const {
|
|
873
|
+
overrides = {},
|
|
877
874
|
stylistic: stylistic2 = true
|
|
878
875
|
} = options;
|
|
879
876
|
return [
|
|
@@ -901,7 +898,8 @@ async function jsdoc(options = {}) {
|
|
|
901
898
|
...stylistic2 ? {
|
|
902
899
|
"jsdoc/check-alignment": "warn",
|
|
903
900
|
"jsdoc/multiline-blocks": "warn"
|
|
904
|
-
} : {}
|
|
901
|
+
} : {},
|
|
902
|
+
...overrides
|
|
905
903
|
}
|
|
906
904
|
}
|
|
907
905
|
];
|
|
@@ -1091,7 +1089,10 @@ async function markdown(options = {}) {
|
|
|
1091
1089
|
}
|
|
1092
1090
|
|
|
1093
1091
|
// src/configs/node.ts
|
|
1094
|
-
async function node() {
|
|
1092
|
+
async function node(options = {}) {
|
|
1093
|
+
const {
|
|
1094
|
+
overrides = {}
|
|
1095
|
+
} = options;
|
|
1095
1096
|
return [
|
|
1096
1097
|
{
|
|
1097
1098
|
name: "eslint/node/rules",
|
|
@@ -1106,14 +1107,18 @@ async function node() {
|
|
|
1106
1107
|
"node/no-path-concat": "error",
|
|
1107
1108
|
"node/prefer-global/buffer": ["error", "never"],
|
|
1108
1109
|
"node/prefer-global/process": ["error", "never"],
|
|
1109
|
-
"node/process-exit-as-throw": "error"
|
|
1110
|
+
"node/process-exit-as-throw": "error",
|
|
1111
|
+
...overrides
|
|
1110
1112
|
}
|
|
1111
1113
|
}
|
|
1112
1114
|
];
|
|
1113
1115
|
}
|
|
1114
1116
|
|
|
1115
1117
|
// src/configs/perfectionist.ts
|
|
1116
|
-
async function perfectionist() {
|
|
1118
|
+
async function perfectionist(options = {}) {
|
|
1119
|
+
const {
|
|
1120
|
+
overrides = {}
|
|
1121
|
+
} = options;
|
|
1117
1122
|
return [
|
|
1118
1123
|
{
|
|
1119
1124
|
name: "eslint/perfectionist/setup",
|
|
@@ -1125,10 +1130,10 @@ async function perfectionist() {
|
|
|
1125
1130
|
"perfectionist/sort-imports": ["error", {
|
|
1126
1131
|
groups: [
|
|
1127
1132
|
"type",
|
|
1128
|
-
["parent-type", "sibling-type", "index-type"],
|
|
1133
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
1129
1134
|
"builtin",
|
|
1130
1135
|
"external",
|
|
1131
|
-
["internal"
|
|
1136
|
+
["internal"],
|
|
1132
1137
|
["parent", "sibling", "index"],
|
|
1133
1138
|
"side-effect",
|
|
1134
1139
|
"object",
|
|
@@ -1139,7 +1144,8 @@ async function perfectionist() {
|
|
|
1139
1144
|
type: "natural"
|
|
1140
1145
|
}],
|
|
1141
1146
|
"perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
|
|
1142
|
-
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
|
|
1147
|
+
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }],
|
|
1148
|
+
...overrides
|
|
1143
1149
|
}
|
|
1144
1150
|
}
|
|
1145
1151
|
];
|
|
@@ -1811,7 +1817,8 @@ async function unicorn(options = {}) {
|
|
|
1811
1817
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1812
1818
|
"unicorn/prefer-type-error": "error",
|
|
1813
1819
|
"unicorn/throw-new-error": "error"
|
|
1814
|
-
}
|
|
1820
|
+
},
|
|
1821
|
+
...options.overrides
|
|
1815
1822
|
}
|
|
1816
1823
|
}
|
|
1817
1824
|
];
|
|
@@ -2166,19 +2173,30 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2166
2173
|
isInEditor,
|
|
2167
2174
|
overrides: overrides.javascript
|
|
2168
2175
|
}),
|
|
2169
|
-
comments(
|
|
2170
|
-
|
|
2176
|
+
comments({
|
|
2177
|
+
overrides: overrides.comments
|
|
2178
|
+
}),
|
|
2179
|
+
node({
|
|
2180
|
+
overrides: overrides.node
|
|
2181
|
+
}),
|
|
2171
2182
|
jsdoc({
|
|
2183
|
+
overrides: overrides.jsdoc,
|
|
2172
2184
|
stylistic: stylisticOptions
|
|
2173
2185
|
}),
|
|
2174
2186
|
imports({
|
|
2187
|
+
overrides: overrides.imports,
|
|
2175
2188
|
stylistic: stylisticOptions
|
|
2176
2189
|
}),
|
|
2177
2190
|
// Optional plugins (installed but not enabled by default)
|
|
2178
|
-
perfectionist(
|
|
2191
|
+
perfectionist({
|
|
2192
|
+
overrides: overrides.perfectionist
|
|
2193
|
+
})
|
|
2179
2194
|
);
|
|
2180
2195
|
if (enableUnicorn) {
|
|
2181
|
-
configs2.push(unicorn(
|
|
2196
|
+
configs2.push(unicorn({
|
|
2197
|
+
...enableUnicorn === true ? {} : enableUnicorn,
|
|
2198
|
+
overrides: overrides.unicorn
|
|
2199
|
+
}));
|
|
2182
2200
|
}
|
|
2183
2201
|
if (enableVue) {
|
|
2184
2202
|
componentExts.push("vue");
|
package/dist/index.d.cts
CHANGED
|
@@ -14665,6 +14665,12 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
14665
14665
|
yaml?: TypedFlatConfigItem['rules'];
|
|
14666
14666
|
toml?: TypedFlatConfigItem['rules'];
|
|
14667
14667
|
unocss?: TypedFlatConfigItem['rules'];
|
|
14668
|
+
perfectionist?: TypedFlatConfigItem['rules'];
|
|
14669
|
+
unicorn?: TypedFlatConfigItem['rules'];
|
|
14670
|
+
comments?: TypedFlatConfigItem['rules'];
|
|
14671
|
+
node?: TypedFlatConfigItem['rules'];
|
|
14672
|
+
imports?: TypedFlatConfigItem['rules'];
|
|
14673
|
+
jsdoc?: TypedFlatConfigItem['rules'];
|
|
14668
14674
|
ignores?: string[];
|
|
14669
14675
|
};
|
|
14670
14676
|
}
|
|
@@ -14686,7 +14692,7 @@ declare const defaultPluginRenaming: {
|
|
|
14686
14692
|
*/
|
|
14687
14693
|
declare function lincy(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[]>[]): FlatConfigComposer<TypedFlatConfigItem>;
|
|
14688
14694
|
|
|
14689
|
-
declare function comments(): Promise<TypedFlatConfigItem[]>;
|
|
14695
|
+
declare function comments(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14690
14696
|
|
|
14691
14697
|
declare function disables(): Promise<TypedFlatConfigItem[]>;
|
|
14692
14698
|
|
|
@@ -14694,11 +14700,11 @@ declare function formatters(options?: OptionsFormatters | true, stylistic?: Styl
|
|
|
14694
14700
|
|
|
14695
14701
|
declare function ignores(options?: OptionsIgnores): Promise<TypedFlatConfigItem[]>;
|
|
14696
14702
|
|
|
14697
|
-
declare function imports(options?: OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
14703
|
+
declare function imports(options?: OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14698
14704
|
|
|
14699
14705
|
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14700
14706
|
|
|
14701
|
-
declare function jsdoc(options?: OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
14707
|
+
declare function jsdoc(options?: OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14702
14708
|
|
|
14703
14709
|
declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14704
14710
|
|
|
@@ -14706,14 +14712,14 @@ declare function jsx(): Promise<TypedFlatConfigItem[]>;
|
|
|
14706
14712
|
|
|
14707
14713
|
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14708
14714
|
|
|
14709
|
-
declare function node(): Promise<TypedFlatConfigItem[]>;
|
|
14715
|
+
declare function node(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14710
14716
|
|
|
14711
14717
|
/**
|
|
14712
14718
|
* Optional perfectionist plugin for props and items sorting.
|
|
14713
14719
|
*
|
|
14714
14720
|
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
14715
14721
|
*/
|
|
14716
|
-
declare function perfectionist(): Promise<TypedFlatConfigItem[]>;
|
|
14722
|
+
declare function perfectionist(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14717
14723
|
|
|
14718
14724
|
declare function react(options?: OptionsFiles & OptionsReact & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14719
14725
|
|
|
@@ -14741,7 +14747,7 @@ declare function toml(options?: OptionsOverrides & OptionsStylistic & OptionsFil
|
|
|
14741
14747
|
|
|
14742
14748
|
declare function typescript(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsProjectType): Promise<TypedFlatConfigItem[]>;
|
|
14743
14749
|
|
|
14744
|
-
declare function unicorn(options?: OptionsUnicorn): Promise<TypedFlatConfigItem[]>;
|
|
14750
|
+
declare function unicorn(options?: OptionsUnicorn & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14745
14751
|
|
|
14746
14752
|
declare function unocss(options?: OptionsUnoCSS & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14747
14753
|
|
package/dist/index.d.ts
CHANGED
|
@@ -14665,6 +14665,12 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
14665
14665
|
yaml?: TypedFlatConfigItem['rules'];
|
|
14666
14666
|
toml?: TypedFlatConfigItem['rules'];
|
|
14667
14667
|
unocss?: TypedFlatConfigItem['rules'];
|
|
14668
|
+
perfectionist?: TypedFlatConfigItem['rules'];
|
|
14669
|
+
unicorn?: TypedFlatConfigItem['rules'];
|
|
14670
|
+
comments?: TypedFlatConfigItem['rules'];
|
|
14671
|
+
node?: TypedFlatConfigItem['rules'];
|
|
14672
|
+
imports?: TypedFlatConfigItem['rules'];
|
|
14673
|
+
jsdoc?: TypedFlatConfigItem['rules'];
|
|
14668
14674
|
ignores?: string[];
|
|
14669
14675
|
};
|
|
14670
14676
|
}
|
|
@@ -14686,7 +14692,7 @@ declare const defaultPluginRenaming: {
|
|
|
14686
14692
|
*/
|
|
14687
14693
|
declare function lincy(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[]>[]): FlatConfigComposer<TypedFlatConfigItem>;
|
|
14688
14694
|
|
|
14689
|
-
declare function comments(): Promise<TypedFlatConfigItem[]>;
|
|
14695
|
+
declare function comments(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14690
14696
|
|
|
14691
14697
|
declare function disables(): Promise<TypedFlatConfigItem[]>;
|
|
14692
14698
|
|
|
@@ -14694,11 +14700,11 @@ declare function formatters(options?: OptionsFormatters | true, stylistic?: Styl
|
|
|
14694
14700
|
|
|
14695
14701
|
declare function ignores(options?: OptionsIgnores): Promise<TypedFlatConfigItem[]>;
|
|
14696
14702
|
|
|
14697
|
-
declare function imports(options?: OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
14703
|
+
declare function imports(options?: OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14698
14704
|
|
|
14699
14705
|
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14700
14706
|
|
|
14701
|
-
declare function jsdoc(options?: OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
14707
|
+
declare function jsdoc(options?: OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14702
14708
|
|
|
14703
14709
|
declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14704
14710
|
|
|
@@ -14706,14 +14712,14 @@ declare function jsx(): Promise<TypedFlatConfigItem[]>;
|
|
|
14706
14712
|
|
|
14707
14713
|
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14708
14714
|
|
|
14709
|
-
declare function node(): Promise<TypedFlatConfigItem[]>;
|
|
14715
|
+
declare function node(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14710
14716
|
|
|
14711
14717
|
/**
|
|
14712
14718
|
* Optional perfectionist plugin for props and items sorting.
|
|
14713
14719
|
*
|
|
14714
14720
|
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
14715
14721
|
*/
|
|
14716
|
-
declare function perfectionist(): Promise<TypedFlatConfigItem[]>;
|
|
14722
|
+
declare function perfectionist(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14717
14723
|
|
|
14718
14724
|
declare function react(options?: OptionsFiles & OptionsReact & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14719
14725
|
|
|
@@ -14741,7 +14747,7 @@ declare function toml(options?: OptionsOverrides & OptionsStylistic & OptionsFil
|
|
|
14741
14747
|
|
|
14742
14748
|
declare function typescript(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsProjectType): Promise<TypedFlatConfigItem[]>;
|
|
14743
14749
|
|
|
14744
|
-
declare function unicorn(options?: OptionsUnicorn): Promise<TypedFlatConfigItem[]>;
|
|
14750
|
+
declare function unicorn(options?: OptionsUnicorn & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14745
14751
|
|
|
14746
14752
|
declare function unocss(options?: OptionsUnoCSS & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
14747
14753
|
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,10 @@ import { default as default6 } from "eslint-plugin-unicorn";
|
|
|
12
12
|
import { default as default7 } from "eslint-plugin-unused-imports";
|
|
13
13
|
|
|
14
14
|
// src/configs/comments.ts
|
|
15
|
-
async function comments() {
|
|
15
|
+
async function comments(options = {}) {
|
|
16
|
+
const {
|
|
17
|
+
overrides = {}
|
|
18
|
+
} = options;
|
|
16
19
|
return [
|
|
17
20
|
{
|
|
18
21
|
name: "eslint/comments/rules",
|
|
@@ -23,7 +26,8 @@ async function comments() {
|
|
|
23
26
|
"eslint-comments/no-aggregating-enable": "error",
|
|
24
27
|
"eslint-comments/no-duplicate-disable": "error",
|
|
25
28
|
"eslint-comments/no-unlimited-disable": "error",
|
|
26
|
-
"eslint-comments/no-unused-enable": "error"
|
|
29
|
+
"eslint-comments/no-unused-enable": "error",
|
|
30
|
+
...overrides
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
];
|
|
@@ -523,6 +527,7 @@ async function ignores(options = {}) {
|
|
|
523
527
|
// src/configs/imports.ts
|
|
524
528
|
async function imports(options = {}) {
|
|
525
529
|
const {
|
|
530
|
+
overrides = {},
|
|
526
531
|
stylistic: stylistic2 = true
|
|
527
532
|
} = options;
|
|
528
533
|
return [
|
|
@@ -544,7 +549,8 @@ async function imports(options = {}) {
|
|
|
544
549
|
"import/no-webpack-loader-syntax": "error",
|
|
545
550
|
...stylistic2 ? {
|
|
546
551
|
"import/newline-after-import": ["error", { considerComments: true, count: 1 }]
|
|
547
|
-
} : {}
|
|
552
|
+
} : {},
|
|
553
|
+
...overrides
|
|
548
554
|
}
|
|
549
555
|
}
|
|
550
556
|
];
|
|
@@ -733,16 +739,6 @@ async function javascript(options = {}) {
|
|
|
733
739
|
"prefer-rest-params": "error",
|
|
734
740
|
"prefer-spread": "error",
|
|
735
741
|
"prefer-template": "error",
|
|
736
|
-
"sort-imports": [
|
|
737
|
-
"error",
|
|
738
|
-
{
|
|
739
|
-
allowSeparatedGroups: false,
|
|
740
|
-
ignoreCase: false,
|
|
741
|
-
ignoreDeclarationSort: true,
|
|
742
|
-
ignoreMemberSort: false,
|
|
743
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
744
|
-
}
|
|
745
|
-
],
|
|
746
742
|
"symbol-description": "error",
|
|
747
743
|
"unicode-bom": ["error", "never"],
|
|
748
744
|
"unused-imports/no-unused-imports": isInEditor ? "off" : "error",
|
|
@@ -769,6 +765,7 @@ async function javascript(options = {}) {
|
|
|
769
765
|
// src/configs/jsdoc.ts
|
|
770
766
|
async function jsdoc(options = {}) {
|
|
771
767
|
const {
|
|
768
|
+
overrides = {},
|
|
772
769
|
stylistic: stylistic2 = true
|
|
773
770
|
} = options;
|
|
774
771
|
return [
|
|
@@ -796,7 +793,8 @@ async function jsdoc(options = {}) {
|
|
|
796
793
|
...stylistic2 ? {
|
|
797
794
|
"jsdoc/check-alignment": "warn",
|
|
798
795
|
"jsdoc/multiline-blocks": "warn"
|
|
799
|
-
} : {}
|
|
796
|
+
} : {},
|
|
797
|
+
...overrides
|
|
800
798
|
}
|
|
801
799
|
}
|
|
802
800
|
];
|
|
@@ -986,7 +984,10 @@ async function markdown(options = {}) {
|
|
|
986
984
|
}
|
|
987
985
|
|
|
988
986
|
// src/configs/node.ts
|
|
989
|
-
async function node() {
|
|
987
|
+
async function node(options = {}) {
|
|
988
|
+
const {
|
|
989
|
+
overrides = {}
|
|
990
|
+
} = options;
|
|
990
991
|
return [
|
|
991
992
|
{
|
|
992
993
|
name: "eslint/node/rules",
|
|
@@ -1001,14 +1002,18 @@ async function node() {
|
|
|
1001
1002
|
"node/no-path-concat": "error",
|
|
1002
1003
|
"node/prefer-global/buffer": ["error", "never"],
|
|
1003
1004
|
"node/prefer-global/process": ["error", "never"],
|
|
1004
|
-
"node/process-exit-as-throw": "error"
|
|
1005
|
+
"node/process-exit-as-throw": "error",
|
|
1006
|
+
...overrides
|
|
1005
1007
|
}
|
|
1006
1008
|
}
|
|
1007
1009
|
];
|
|
1008
1010
|
}
|
|
1009
1011
|
|
|
1010
1012
|
// src/configs/perfectionist.ts
|
|
1011
|
-
async function perfectionist() {
|
|
1013
|
+
async function perfectionist(options = {}) {
|
|
1014
|
+
const {
|
|
1015
|
+
overrides = {}
|
|
1016
|
+
} = options;
|
|
1012
1017
|
return [
|
|
1013
1018
|
{
|
|
1014
1019
|
name: "eslint/perfectionist/setup",
|
|
@@ -1020,10 +1025,10 @@ async function perfectionist() {
|
|
|
1020
1025
|
"perfectionist/sort-imports": ["error", {
|
|
1021
1026
|
groups: [
|
|
1022
1027
|
"type",
|
|
1023
|
-
["parent-type", "sibling-type", "index-type"],
|
|
1028
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
1024
1029
|
"builtin",
|
|
1025
1030
|
"external",
|
|
1026
|
-
["internal"
|
|
1031
|
+
["internal"],
|
|
1027
1032
|
["parent", "sibling", "index"],
|
|
1028
1033
|
"side-effect",
|
|
1029
1034
|
"object",
|
|
@@ -1034,7 +1039,8 @@ async function perfectionist() {
|
|
|
1034
1039
|
type: "natural"
|
|
1035
1040
|
}],
|
|
1036
1041
|
"perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
|
|
1037
|
-
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
|
|
1042
|
+
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }],
|
|
1043
|
+
...overrides
|
|
1038
1044
|
}
|
|
1039
1045
|
}
|
|
1040
1046
|
];
|
|
@@ -1706,7 +1712,8 @@ async function unicorn(options = {}) {
|
|
|
1706
1712
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1707
1713
|
"unicorn/prefer-type-error": "error",
|
|
1708
1714
|
"unicorn/throw-new-error": "error"
|
|
1709
|
-
}
|
|
1715
|
+
},
|
|
1716
|
+
...options.overrides
|
|
1710
1717
|
}
|
|
1711
1718
|
}
|
|
1712
1719
|
];
|
|
@@ -2061,19 +2068,30 @@ function lincy(options = {}, ...userConfigs) {
|
|
|
2061
2068
|
isInEditor,
|
|
2062
2069
|
overrides: overrides.javascript
|
|
2063
2070
|
}),
|
|
2064
|
-
comments(
|
|
2065
|
-
|
|
2071
|
+
comments({
|
|
2072
|
+
overrides: overrides.comments
|
|
2073
|
+
}),
|
|
2074
|
+
node({
|
|
2075
|
+
overrides: overrides.node
|
|
2076
|
+
}),
|
|
2066
2077
|
jsdoc({
|
|
2078
|
+
overrides: overrides.jsdoc,
|
|
2067
2079
|
stylistic: stylisticOptions
|
|
2068
2080
|
}),
|
|
2069
2081
|
imports({
|
|
2082
|
+
overrides: overrides.imports,
|
|
2070
2083
|
stylistic: stylisticOptions
|
|
2071
2084
|
}),
|
|
2072
2085
|
// Optional plugins (installed but not enabled by default)
|
|
2073
|
-
perfectionist(
|
|
2086
|
+
perfectionist({
|
|
2087
|
+
overrides: overrides.perfectionist
|
|
2088
|
+
})
|
|
2074
2089
|
);
|
|
2075
2090
|
if (enableUnicorn) {
|
|
2076
|
-
configs2.push(unicorn(
|
|
2091
|
+
configs2.push(unicorn({
|
|
2092
|
+
...enableUnicorn === true ? {} : enableUnicorn,
|
|
2093
|
+
overrides: overrides.unicorn
|
|
2094
|
+
}));
|
|
2077
2095
|
}
|
|
2078
2096
|
if (enableVue) {
|
|
2079
2097
|
componentExts.push("vue");
|
package/package.json
CHANGED