1+ /**
2+ * Opinionated 'default' settings for eslint-plugin-perfectionist.
3+ * @see https://perfectionist.dev/guide/getting-started#settings
4+ */
5+ const PERFECTIONIST_SETTINGS = {
6+ ignoreCase : true , // Ignore case when sorting
7+ type : 'natural' ,
8+ } ;
9+
110/**
211 * While the sorting of imports is done by `eslint-plugin-perfectionist/sort-imports`,
312 * the order and grouping of imports is still taken from the previous configuration of `eslint-plugin-import/order`,
413 * as it feels more natural.
514 * The following group names are available for configuration: https://eslint-plugin-perfectionist.azat.io/rules/sort-imports#groups
615 */
716const SORT_IMPORTS_GROUPS = [
8- [ 'builtin' , 'builtin-type' ] ,
9- [ 'external' , 'external-type' ] ,
10- [ 'internal' , 'internal-type' ] ,
11- [ 'parent' , 'parent-type' , 'sibling' , 'sibling-type' , 'index' , 'index-type' ] ,
12- 'style' ,
13- [ 'side-effect-style' , 'side-effect' ] ,
14- 'object' ,
17+ [ 'value-builtin' , 'named-type-builtin' ] ,
18+ [ 'value-external' , 'named-type-external' ] ,
19+ [ 'value-internal' , 'named-type-internal' ] ,
20+ [ 'value-parent' , 'named-type-parent' ] ,
21+ [ 'value-sibling' , 'named-type-sibling' ] ,
22+ [ 'value-index' , 'named-type-index' ] ,
23+ 'value-style' ,
24+ [ 'value-side-effect-style' , 'value-side-effect' ] ,
25+ 'value-ts-equals-import' ,
1526 'unknown' ,
1627] ;
1728
1829/**
19- * This is the the groups configuration of all the recommended configs by eslint-plugin-perfectionist.
30+ * This is the the default groups configuration of all the recommended configs by eslint-plugin-perfectionist.
2031 * This array can be used to reconfigure some options of the perfectionist/sort-classes rule without
2132 * overwriting the groups configuration of this rule.
2233 * This config can be found here:
@@ -25,19 +36,31 @@ const SORT_IMPORTS_GROUPS = [
2536 */
2637const SORT_CLASSES_GROUPS = [
2738 'index-signature' ,
28- 'static-property' ,
29- 'private-property' ,
30- 'property' ,
31- 'constructor' ,
32- 'static-method' ,
33- 'private-method' ,
34- 'method' ,
39+ [ 'static-property' , 'static-accessor-property' ] ,
40+ [ 'static-get-method' , 'static-set-method' ] ,
41+ [ 'protected-static-property' , 'protected-static-accessor-property' ] ,
42+ [ 'protected-static-get-method' , 'protected-static-set-method' ] ,
43+ [ 'private-static-property' , 'private-static-accessor-property' ] ,
44+ [ 'private-static-get-method' , 'private-static-set-method' ] ,
45+ 'static-block' ,
46+ [ 'property' , 'accessor-property' ] ,
3547 [ 'get-method' , 'set-method' ] ,
48+ [ 'protected-property' , 'protected-accessor-property' ] ,
49+ [ 'protected-get-method' , 'protected-set-method' ] ,
50+ [ 'private-property' , 'private-accessor-property' ] ,
51+ [ 'private-get-method' , 'private-set-method' ] ,
52+ 'constructor' ,
53+ [ 'static-method' , 'static-function-property' ] ,
54+ [ 'protected-static-method' , 'protected-static-function-property' ] ,
55+ [ 'private-static-method' , 'private-static-function-property' ] ,
56+ [ 'method' , 'function-property' ] ,
57+ [ 'protected-method' , 'protected-function-property' ] ,
58+ [ 'private-method' , 'private-function-property' ] ,
3659 'unknown' ,
3760] ;
3861
3962/**
40- * This array can be used to configure the perfectionist/sort-intersection-types rule.
63+ * Customized configuration to configure the perfectionist/sort-intersection-types rule.
4164 * The following group names are available for configuration: https://perfectionist.dev/rules/sort-intersection-types#groups
4265 */
4366const SORT_INTERSECTION_TYPES_GROUPS = [
@@ -57,6 +80,7 @@ const SORT_INTERSECTION_TYPES_GROUPS = [
5780] ;
5881
5982module . exports = {
83+ PERFECTIONIST_SETTINGS ,
6084 SORT_CLASSES_GROUPS ,
6185 SORT_IMPORTS_GROUPS ,
6286 SORT_INTERSECTION_TYPES_GROUPS ,
0 commit comments