@jpp-toolkit/eslint-config 0.0.11
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/LICENSE.md +21 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.mjs +654 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +73 -0
- package/src/configs/eslint-config.ts +1305 -0
- package/src/configs/ignore-config.ts +17 -0
- package/src/configs/import-x-config.ts +344 -0
- package/src/configs/jsx-a11y-config.ts +278 -0
- package/src/configs/perfectionist-config.ts +180 -0
- package/src/configs/prettier-config.ts +11 -0
- package/src/configs/react-config.ts +706 -0
- package/src/configs/react-hooks-config.ts +11 -0
- package/src/configs/stylistic-config.ts +746 -0
- package/src/configs/typescript-config.ts +1211 -0
- package/src/configs/unicorn-config.ts +1212 -0
- package/src/configs/vitest-config.ts +536 -0
- package/src/index.ts +73 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import perfectionist from 'eslint-plugin-perfectionist';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Perfectionist configuration.
|
|
6
|
+
* @see {@link https://perfectionist.dev/rules}
|
|
7
|
+
*/
|
|
8
|
+
export const perfectionistConfig = defineConfig({
|
|
9
|
+
name: 'perfectionist-config',
|
|
10
|
+
plugins: { perfectionist },
|
|
11
|
+
rules: {
|
|
12
|
+
/**
|
|
13
|
+
* Enforce sorted arrays before include method.
|
|
14
|
+
* @fixable
|
|
15
|
+
* @see {@link https://perfectionist.dev/rules/sort-array-includes}
|
|
16
|
+
*/
|
|
17
|
+
'perfectionist/sort-array-includes': 'error',
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Enforce sorted classes.
|
|
21
|
+
* @fixable
|
|
22
|
+
* @see {@link https://perfectionist.dev/rules/sort-classes}
|
|
23
|
+
*/
|
|
24
|
+
// 'perfectionist/sort-classes': 'error',
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Enforce sorted decorators.
|
|
28
|
+
* @fixable
|
|
29
|
+
* @see {@link https://perfectionist.dev/rules/sort-decorators}
|
|
30
|
+
*/
|
|
31
|
+
'perfectionist/sort-decorators': 'error',
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Enforce sorted TypeScript enums.
|
|
35
|
+
* @fixable
|
|
36
|
+
* @see {@link https://perfectionist.dev/rules/sort-enums}
|
|
37
|
+
*/
|
|
38
|
+
// 'perfectionist/sort-enums': 'error',
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Enforce sorted exports.
|
|
42
|
+
* @fixable
|
|
43
|
+
* @see {@link https://perfectionist.dev/rules/sort-exports}
|
|
44
|
+
*/
|
|
45
|
+
'perfectionist/sort-exports': [
|
|
46
|
+
'error',
|
|
47
|
+
{
|
|
48
|
+
type: 'natural',
|
|
49
|
+
order: 'asc',
|
|
50
|
+
groupKind: 'types-first',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Enforce sorted heritage clauses.
|
|
56
|
+
* @fixable
|
|
57
|
+
* @see {@link https://perfectionist.dev/rules/sort-heritage-clauses}
|
|
58
|
+
*/
|
|
59
|
+
'perfectionist/sort-heritage-clauses': 'error',
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Enforce sorted imports.
|
|
63
|
+
* @fixable
|
|
64
|
+
* @see {@link https://perfectionist.dev/rules/sort-imports}
|
|
65
|
+
*/
|
|
66
|
+
'sort-imports': 'off',
|
|
67
|
+
'perfectionist/sort-imports': [
|
|
68
|
+
'error',
|
|
69
|
+
{
|
|
70
|
+
type: 'natural',
|
|
71
|
+
order: 'asc',
|
|
72
|
+
internalPattern: ['^~.*'],
|
|
73
|
+
newlinesBetween: 'always',
|
|
74
|
+
groups: [
|
|
75
|
+
['side-effect', 'side-effect-style'],
|
|
76
|
+
['builtin-type', 'builtin'],
|
|
77
|
+
['external-type', 'external'],
|
|
78
|
+
['internal-type', 'internal'],
|
|
79
|
+
['parent-type', 'parent'],
|
|
80
|
+
['sibling-type', 'sibling'],
|
|
81
|
+
['index-type', 'index'],
|
|
82
|
+
['object'],
|
|
83
|
+
['style'],
|
|
84
|
+
['unknown'],
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Enforce sorted interface properties.
|
|
91
|
+
* @fixable
|
|
92
|
+
* @see {@link https://perfectionist.dev/rules/sort-interfaces}
|
|
93
|
+
*/
|
|
94
|
+
// 'perfectionist/sort-interfaces': 'error',
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Enforce sorted intersection types.
|
|
98
|
+
* @fixable
|
|
99
|
+
* @see {@link https://perfectionist.dev/rules/sort-intersection-types}
|
|
100
|
+
*/
|
|
101
|
+
// 'perfectionist/sort-intersection-types': 'error',
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Enforce sorted JSX props.
|
|
105
|
+
* @fixable
|
|
106
|
+
* @see {@link https://perfectionist.dev/rules/sort-jsx-props}
|
|
107
|
+
*/
|
|
108
|
+
// 'perfectionist/sort-jsx-props': 'error',
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Enforce sorted Map elements.
|
|
112
|
+
* @fixable
|
|
113
|
+
* @see {@link https://perfectionist.dev/rules/sort-maps}
|
|
114
|
+
*/
|
|
115
|
+
// 'perfectionist/sort-maps': 'error',
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Enforce sorted modules.
|
|
119
|
+
* @fixable
|
|
120
|
+
* @see {@link https://perfectionist.dev/rules/sort-modules}
|
|
121
|
+
*/
|
|
122
|
+
// 'perfectionist/sort-modules': 'error',
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Enforce sorted named exports.
|
|
126
|
+
* @fixable
|
|
127
|
+
* @see {@link https://perfectionist.dev/rules/sort-named-exports}
|
|
128
|
+
*/
|
|
129
|
+
// 'perfectionist/sort-named-exports': 'error',
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Enforce sorted named imports.
|
|
133
|
+
* @fixable
|
|
134
|
+
* @see {@link https://perfectionist.dev/rules/sort-named-imports}
|
|
135
|
+
*/
|
|
136
|
+
// 'perfectionist/sort-named-imports': 'error',
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Enforce sorted object types.
|
|
140
|
+
* @fixable
|
|
141
|
+
* @see {@link https://perfectionist.dev/rules/sort-object-types}
|
|
142
|
+
*/
|
|
143
|
+
// 'perfectionist/sort-object-types': 'error',
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Enforce sorted objects.
|
|
147
|
+
* @fixable
|
|
148
|
+
* @see {@link https://perfectionist.dev/rules/sort-objects}
|
|
149
|
+
*/
|
|
150
|
+
// 'perfectionist/sort-objects': 'error',
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Enforce sorted Set elements.
|
|
154
|
+
* @fixable
|
|
155
|
+
* @see {@link https://perfectionist.dev/rules/sort-sets}
|
|
156
|
+
*/
|
|
157
|
+
// 'perfectionist/sort-sets': 'error',
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Enforce sorted switch case statements.
|
|
161
|
+
* @fixable
|
|
162
|
+
* @see {@link https://perfectionist.dev/rules/sort-switch-case}
|
|
163
|
+
*/
|
|
164
|
+
// 'perfectionist/sort-switch-case': 'error',
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Enforce sorted union types.
|
|
168
|
+
* @fixable
|
|
169
|
+
* @see {@link https://perfectionist.dev/rules/sort-union-types}
|
|
170
|
+
*/
|
|
171
|
+
// 'perfectionist/sort-union-types': 'error',
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Enforce sorted variable declarations.
|
|
175
|
+
* @fixable
|
|
176
|
+
* @see {@link https://perfectionist.dev/rules/sort-variable-declarations}
|
|
177
|
+
*/
|
|
178
|
+
// 'perfectionist/sort-variable-declarations': 'error',
|
|
179
|
+
},
|
|
180
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import prettier from 'eslint-plugin-prettier/recommended';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Prettier configuration.
|
|
6
|
+
* @see {@link https://github.com/prettier/eslint-plugin-prettier}
|
|
7
|
+
*/
|
|
8
|
+
export const prettierConfig = defineConfig({
|
|
9
|
+
name: 'prettier-config',
|
|
10
|
+
extends: [prettier],
|
|
11
|
+
});
|