@repodog/eslint-config 1.2.3 → 9.0.1
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 +10 -17
- package/index.mjs +293 -0
- package/package.json +35 -15
- package/index.cjs +0 -244
package/README.md
CHANGED
|
@@ -5,29 +5,22 @@ The Repodog ESlint config.
|
|
|
5
5
|
[](https://badge.fury.io/js/%40repodog%2Feslint-config)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
## Install package
|
|
8
|
+
## Install package and peer dependencies
|
|
9
9
|
|
|
10
10
|
```shell
|
|
11
11
|
# terminal
|
|
12
|
-
npm install @repodog/eslint-config --save-dev
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Install dependencies
|
|
16
|
-
|
|
17
|
-
```shell
|
|
18
|
-
# terminal
|
|
19
|
-
npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint-plugin-sort-class-members eslint-plugin-sort-destructure-keys eslint-plugin-sort-keys-fix eslint-plugin-typescript-sort-keys eslint-plugin-unicorn --save-dev
|
|
12
|
+
npm install @repodog/eslint-config eslint prettier typescript --save-dev
|
|
20
13
|
```
|
|
21
14
|
|
|
22
15
|
## Use package
|
|
23
16
|
|
|
24
17
|
```javascript
|
|
25
|
-
// .
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
// eslint.config.mjs
|
|
19
|
+
import config from '@repodog/eslint-config';
|
|
20
|
+
|
|
21
|
+
// eslint convention is to export default
|
|
22
|
+
// eslint-disable-next-line import/no-default-export
|
|
23
|
+
export default [
|
|
24
|
+
...config,
|
|
25
|
+
];
|
|
33
26
|
```
|
package/index.mjs
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { fixupPluginRules } from '@eslint/compat';
|
|
2
|
+
import eslint from '@eslint/js';
|
|
3
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
4
|
+
import importX from 'eslint-plugin-import-x';
|
|
5
|
+
import preferArrow from 'eslint-plugin-prefer-arrow';
|
|
6
|
+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
7
|
+
import sortClassMembers from 'eslint-plugin-sort-class-members';
|
|
8
|
+
import sortDestructureKeys from 'eslint-plugin-sort-destructure-keys';
|
|
9
|
+
import sortKeysFix from 'eslint-plugin-sort-keys-fix';
|
|
10
|
+
import typescriptSortKeys from 'eslint-plugin-typescript-sort-keys';
|
|
11
|
+
import unicorn from 'eslint-plugin-unicorn';
|
|
12
|
+
import globals from 'globals';
|
|
13
|
+
// eslint is randomly not resolving module
|
|
14
|
+
// eslint-disable-next-line import-x/no-unresolved
|
|
15
|
+
import tsEslint from 'typescript-eslint';
|
|
16
|
+
|
|
17
|
+
const cwd = process.cwd();
|
|
18
|
+
const project = './tsconfig.json';
|
|
19
|
+
|
|
20
|
+
// eslint convention is to export default
|
|
21
|
+
// eslint-disable-next-line import-x/no-default-export
|
|
22
|
+
export default tsEslint.config(
|
|
23
|
+
{
|
|
24
|
+
ignores: [
|
|
25
|
+
'!.*',
|
|
26
|
+
'.github/*',
|
|
27
|
+
'.husky/*',
|
|
28
|
+
'.vscode/*',
|
|
29
|
+
'coverage/*',
|
|
30
|
+
'dist/*',
|
|
31
|
+
'lib/*',
|
|
32
|
+
'node_modules/*',
|
|
33
|
+
'**/dist/*',
|
|
34
|
+
'**/lib/*',
|
|
35
|
+
'**/node_modules/*',
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
extends: [eslint.configs.recommended, importX.flatConfigs.recommended, unicorn.configs['flat/recommended']],
|
|
40
|
+
files: ['**/*.{mjs,cjs,js,jsx,ts,tsx}'],
|
|
41
|
+
languageOptions: {
|
|
42
|
+
ecmaVersion: 'latest',
|
|
43
|
+
globals: {
|
|
44
|
+
...globals.browser,
|
|
45
|
+
...globals.node,
|
|
46
|
+
},
|
|
47
|
+
parserOptions: {
|
|
48
|
+
ecmaVersion: 'latest',
|
|
49
|
+
},
|
|
50
|
+
sourceType: 'module',
|
|
51
|
+
},
|
|
52
|
+
plugins: {
|
|
53
|
+
'@stylistic': stylistic,
|
|
54
|
+
'prefer-arrow': fixupPluginRules(preferArrow),
|
|
55
|
+
'sort-class-members': fixupPluginRules(sortClassMembers),
|
|
56
|
+
'sort-destructure-keys': fixupPluginRules(sortDestructureKeys),
|
|
57
|
+
'sort-keys-fix': fixupPluginRules(sortKeysFix),
|
|
58
|
+
},
|
|
59
|
+
rules: {
|
|
60
|
+
'@stylistic/max-len': [
|
|
61
|
+
2,
|
|
62
|
+
{
|
|
63
|
+
code: 120,
|
|
64
|
+
comments: 100,
|
|
65
|
+
ignoreRegExpLiterals: true,
|
|
66
|
+
ignoreStrings: true,
|
|
67
|
+
ignoreTemplateLiterals: true,
|
|
68
|
+
ignoreUrls: true,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
'@stylistic/one-var-declaration-per-line': [2, 'initializations'],
|
|
72
|
+
'@stylistic/padding-line-between-statements': [
|
|
73
|
+
2,
|
|
74
|
+
{ blankLine: 'any', next: '*', prev: '*' },
|
|
75
|
+
{ blankLine: 'always', next: '*', prev: 'multiline-block-like' },
|
|
76
|
+
{ blankLine: 'always', next: 'multiline-block-like', prev: '*' },
|
|
77
|
+
{ blankLine: 'always', next: '*', prev: 'multiline-expression' },
|
|
78
|
+
{ blankLine: 'always', next: 'multiline-expression', prev: '*' },
|
|
79
|
+
{ blankLine: 'always', next: '*', prev: 'directive' },
|
|
80
|
+
{ blankLine: 'always', next: 'directive', prev: '*' },
|
|
81
|
+
{ blankLine: 'never', next: 'singleline-const', prev: 'singleline-const' },
|
|
82
|
+
{ blankLine: 'never', next: 'singleline-const', prev: 'singleline-let' },
|
|
83
|
+
{ blankLine: 'never', next: 'singleline-let', prev: 'singleline-let' },
|
|
84
|
+
{ blankLine: 'never', next: 'singleline-let', prev: 'singleline-const' },
|
|
85
|
+
{ blankLine: 'always', next: 'singleline-const', prev: 'cjs-import' },
|
|
86
|
+
{ blankLine: 'always', next: 'singleline-let', prev: 'cjs-import' },
|
|
87
|
+
{ blankLine: 'always', next: '*', prev: 'multiline-const' },
|
|
88
|
+
{ blankLine: 'always', next: 'multiline-const', prev: '*' },
|
|
89
|
+
{ blankLine: 'always', next: '*', prev: 'multiline-let' },
|
|
90
|
+
{ blankLine: 'always', next: 'multiline-let', prev: '*' },
|
|
91
|
+
{ blankLine: 'never', next: 'cjs-export', prev: 'cjs-export' },
|
|
92
|
+
{ blankLine: 'never', next: 'cjs-import', prev: 'cjs-import' },
|
|
93
|
+
{ blankLine: 'always', next: 'case', prev: '*' },
|
|
94
|
+
{ blankLine: 'always', next: 'default', prev: '*' },
|
|
95
|
+
{ blankLine: 'always', next: '*', prev: 'break' },
|
|
96
|
+
],
|
|
97
|
+
'import-x/extensions': [2, 'ignorePackages'],
|
|
98
|
+
'import-x/namespace': 0,
|
|
99
|
+
'import-x/no-default-export': 2,
|
|
100
|
+
'import-x/no-extraneous-dependencies': [
|
|
101
|
+
2,
|
|
102
|
+
{
|
|
103
|
+
devDependencies: [
|
|
104
|
+
'**/.*',
|
|
105
|
+
'**/*.config.*',
|
|
106
|
+
'**/*.setup.*',
|
|
107
|
+
'**/*.test.*',
|
|
108
|
+
'**/*.stories.*',
|
|
109
|
+
'**/__testUtils__/**',
|
|
110
|
+
'**/__tests__/**',
|
|
111
|
+
'**/__mocks__/**',
|
|
112
|
+
'**/.storybook/**',
|
|
113
|
+
],
|
|
114
|
+
peerDependencies: false,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
'import-x/order': [
|
|
118
|
+
2,
|
|
119
|
+
{
|
|
120
|
+
alphabetize: { caseInsensitive: false, order: 'asc' },
|
|
121
|
+
groups: [['builtin', 'external'], 'parent', 'sibling', 'index'],
|
|
122
|
+
'newlines-between': 'never',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
'no-unused-vars': [2, { args: 'all', argsIgnorePattern: '^_', ignoreRestSiblings: false, vars: 'all' }],
|
|
126
|
+
'no-use-before-define': [2, { functions: false }],
|
|
127
|
+
'one-var': [2, { initialized: 'never' }],
|
|
128
|
+
'prefer-arrow/prefer-arrow-functions': [
|
|
129
|
+
2,
|
|
130
|
+
{
|
|
131
|
+
allowStandaloneDeclarations: false,
|
|
132
|
+
classPropertiesAllowed: false,
|
|
133
|
+
disallowPrototype: true,
|
|
134
|
+
singleReturnOnly: false,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
'sort-class-members/sort-class-members': [
|
|
138
|
+
2,
|
|
139
|
+
{
|
|
140
|
+
accessorPairPositioning: 'getThenSet',
|
|
141
|
+
groups: {
|
|
142
|
+
'arrow-function-properties': [
|
|
143
|
+
{ propertyType: 'ArrowFunctionExpression', sort: 'alphabetical', type: 'property' },
|
|
144
|
+
],
|
|
145
|
+
methods: [{ sort: 'alphabetical', type: 'method' }],
|
|
146
|
+
'private-arrow-function-properties': [
|
|
147
|
+
{ name: '/_.+/', propertyType: 'ArrowFunctionExpression', type: 'property' },
|
|
148
|
+
],
|
|
149
|
+
'private-methods': [{ name: '/_.+/', sort: 'alphabetical', type: 'method' }],
|
|
150
|
+
'private-properties': [{ name: '/_.+/', sort: 'alphabetical', type: 'property' }],
|
|
151
|
+
properties: [{ sort: 'alphabetical', type: 'property' }],
|
|
152
|
+
'static-methods': [{ sort: 'alphabetical', static: true, type: 'method' }],
|
|
153
|
+
'static-private-methods': [{ name: '/_.+/', sort: 'alphabetical', static: true, type: 'method' }],
|
|
154
|
+
'static-private-properties': [{ name: '/_.+/', sort: 'alphabetical', static: true, type: 'property' }],
|
|
155
|
+
'static-properties': [{ sort: 'alphabetical', static: true, type: 'property' }],
|
|
156
|
+
},
|
|
157
|
+
order: [
|
|
158
|
+
'[static-properties]',
|
|
159
|
+
'[static-private-properties]',
|
|
160
|
+
'[static-methods]',
|
|
161
|
+
'[static-private-methods]',
|
|
162
|
+
'[arrow-function-properties]',
|
|
163
|
+
'[properties]',
|
|
164
|
+
'[private-arrow-function-properties]',
|
|
165
|
+
'[private-properties]',
|
|
166
|
+
'constructor',
|
|
167
|
+
'getters',
|
|
168
|
+
'setters',
|
|
169
|
+
'[methods]',
|
|
170
|
+
'[private-methods]',
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
'sort-destructure-keys/sort-destructure-keys': [2, { caseSensitive: true }],
|
|
175
|
+
'sort-imports': [
|
|
176
|
+
2,
|
|
177
|
+
{
|
|
178
|
+
ignoreDeclarationSort: true,
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
'sort-keys': 0,
|
|
182
|
+
'sort-keys-fix/sort-keys-fix': [2, 'asc', { caseSensitive: true, natural: true }],
|
|
183
|
+
'sort-vars': [2, { ignoreCase: false }],
|
|
184
|
+
'unicorn/consistent-function-scoping': [2, { checkArrowFunctions: false }],
|
|
185
|
+
'unicorn/filename-case': [
|
|
186
|
+
2,
|
|
187
|
+
{
|
|
188
|
+
cases: {
|
|
189
|
+
camelCase: true,
|
|
190
|
+
pascalCase: true,
|
|
191
|
+
},
|
|
192
|
+
ignore: ['^module-defs.d.ts$', '^next-env.d.ts$'],
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
'unicorn/import-style': 0,
|
|
196
|
+
'unicorn/no-array-reduce': 0,
|
|
197
|
+
'unicorn/prevent-abbreviations': 0,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
extends: [
|
|
202
|
+
...tsEslint.configs.recommendedTypeChecked,
|
|
203
|
+
...tsEslint.configs.strictTypeChecked,
|
|
204
|
+
...tsEslint.configs.stylisticTypeChecked,
|
|
205
|
+
importX.flatConfigs.typescript,
|
|
206
|
+
],
|
|
207
|
+
files: ['**/*.{ts,tsx}'],
|
|
208
|
+
languageOptions: {
|
|
209
|
+
parserOptions: {
|
|
210
|
+
project,
|
|
211
|
+
tsconfigRootDir: cwd,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
plugins: {
|
|
215
|
+
'typescript-sort-keys': fixupPluginRules(typescriptSortKeys),
|
|
216
|
+
},
|
|
217
|
+
rules: {
|
|
218
|
+
'@typescript-eslint/consistent-type-definitions': 0,
|
|
219
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
220
|
+
2,
|
|
221
|
+
{
|
|
222
|
+
disallowTypeAnnotations: false,
|
|
223
|
+
fixStyle: 'inline-type-imports',
|
|
224
|
+
prefer: 'type-imports',
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
'@typescript-eslint/naming-convention': [
|
|
228
|
+
2,
|
|
229
|
+
{
|
|
230
|
+
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
231
|
+
leadingUnderscore: 'allow',
|
|
232
|
+
selector: 'variable',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
format: ['camelCase', 'PascalCase'],
|
|
236
|
+
selector: 'function',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
format: ['PascalCase'],
|
|
240
|
+
selector: 'typeLike',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
custom: {
|
|
244
|
+
match: false,
|
|
245
|
+
regex: '^I[A-Z]',
|
|
246
|
+
},
|
|
247
|
+
format: ['PascalCase'],
|
|
248
|
+
selector: 'interface',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
custom: {
|
|
252
|
+
match: false,
|
|
253
|
+
regex: '^T[A-Z]',
|
|
254
|
+
},
|
|
255
|
+
format: ['PascalCase'],
|
|
256
|
+
selector: 'typeLike',
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
'@typescript-eslint/no-non-null-assertion': 0,
|
|
260
|
+
'@typescript-eslint/no-shadow': 2,
|
|
261
|
+
'@typescript-eslint/no-unnecessary-type-parameters': 0,
|
|
262
|
+
'@typescript-eslint/no-unused-vars': [
|
|
263
|
+
2,
|
|
264
|
+
{ args: 'all', argsIgnorePattern: '^_', ignoreRestSiblings: false, vars: 'all' },
|
|
265
|
+
],
|
|
266
|
+
'@typescript-eslint/no-use-before-define': 0,
|
|
267
|
+
'import-x/consistent-type-specifier-style': [2, 'prefer-inline'],
|
|
268
|
+
'import-x/no-named-as-default': 0,
|
|
269
|
+
'import-x/no-named-as-default-member': 0,
|
|
270
|
+
'no-use-before-define': 0,
|
|
271
|
+
'typescript-sort-keys/interface': [2, 'asc', { caseSensitive: true, natural: true, requiredFirst: false }],
|
|
272
|
+
'typescript-sort-keys/string-enum': 2,
|
|
273
|
+
},
|
|
274
|
+
settings: {
|
|
275
|
+
'import-x/resolver': {
|
|
276
|
+
typescript: {
|
|
277
|
+
alwaysTryTypes: true,
|
|
278
|
+
project,
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
files: ['**/*.{mjs,cjs,js,jsx}'],
|
|
285
|
+
rules: {
|
|
286
|
+
'no-shadow': 2,
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
extends: [prettierRecommended],
|
|
291
|
+
files: ['**/*.{mjs,cjs,js,jsx,ts,tsx}'],
|
|
292
|
+
},
|
|
293
|
+
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repodog/eslint-config",
|
|
3
3
|
"description": "The Repodog ESLint config module.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "9.0.1",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/repodog",
|
|
@@ -11,23 +11,43 @@
|
|
|
11
11
|
"url": "https://github.com/badbatch/repodog/configs/eslint-config"
|
|
12
12
|
},
|
|
13
13
|
"bugs": "https://github.com/badbatch/repodog/issues",
|
|
14
|
-
"
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./index.mjs",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"default": "./index.mjs"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
15
21
|
"publishConfig": {
|
|
16
22
|
"access": "public"
|
|
17
23
|
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@eslint/compat": "^1.1.1",
|
|
26
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
27
|
+
"@eslint/js": "^9.9.1",
|
|
28
|
+
"@stylistic/eslint-plugin": "^2.6.4",
|
|
29
|
+
"eslint-config-prettier": "^9.1.0",
|
|
30
|
+
"eslint-import-resolver-typescript": "^3.6.3",
|
|
31
|
+
"eslint-plugin-import-x": "^4.1.1",
|
|
32
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
33
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
34
|
+
"eslint-plugin-sort-class-members": "^1.20.0",
|
|
35
|
+
"eslint-plugin-sort-destructure-keys": "^2.0.0",
|
|
36
|
+
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
37
|
+
"eslint-plugin-typescript-sort-keys": "^3.2.0",
|
|
38
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
39
|
+
"globals": "^15.9.0",
|
|
40
|
+
"typescript-eslint": "^8.2.0"
|
|
41
|
+
},
|
|
18
42
|
"peerDependencies": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"eslint
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"eslint-plugin-sort-destructure-keys": "<2",
|
|
29
|
-
"eslint-plugin-sort-keys-fix": "<2",
|
|
30
|
-
"eslint-plugin-typescript-sort-keys": "<3",
|
|
31
|
-
"eslint-plugin-unicorn": "<47"
|
|
43
|
+
"eslint": "<10",
|
|
44
|
+
"prettier": "<4",
|
|
45
|
+
"typescript": "<6"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/eslint__js": "^8.42.3",
|
|
49
|
+
"eslint": "^9.9.1",
|
|
50
|
+
"prettier": "^3.3.3",
|
|
51
|
+
"typescript": "^5.5.4"
|
|
32
52
|
}
|
|
33
53
|
}
|
package/index.cjs
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
node: true,
|
|
5
|
-
},
|
|
6
|
-
extends: ['eslint:recommended', 'plugin:import/recommended', 'plugin:unicorn/recommended', 'prettier'],
|
|
7
|
-
overrides: [
|
|
8
|
-
{
|
|
9
|
-
extends: [
|
|
10
|
-
'plugin:@typescript-eslint/eslint-recommended',
|
|
11
|
-
'plugin:@typescript-eslint/recommended',
|
|
12
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
13
|
-
'plugin:@typescript-eslint/strict',
|
|
14
|
-
'plugin:import/typescript',
|
|
15
|
-
],
|
|
16
|
-
files: ['**/*.{ts,tsx}'],
|
|
17
|
-
parser: '@typescript-eslint/parser',
|
|
18
|
-
parserOptions: {
|
|
19
|
-
project: ['./tsconfig.json'],
|
|
20
|
-
},
|
|
21
|
-
plugins: ['@typescript-eslint', 'typescript-sort-keys'],
|
|
22
|
-
rules: {
|
|
23
|
-
'@typescript-eslint/consistent-type-definitions': 0,
|
|
24
|
-
'@typescript-eslint/consistent-type-imports': [
|
|
25
|
-
2,
|
|
26
|
-
{
|
|
27
|
-
disallowTypeAnnotations: false,
|
|
28
|
-
fixStyle: 'inline-type-imports',
|
|
29
|
-
prefer: 'type-imports',
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
'@typescript-eslint/naming-convention': [
|
|
33
|
-
2,
|
|
34
|
-
{
|
|
35
|
-
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
36
|
-
leadingUnderscore: 'allow',
|
|
37
|
-
selector: 'variable',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
format: ['camelCase', 'PascalCase'],
|
|
41
|
-
selector: 'function',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
format: ['PascalCase'],
|
|
45
|
-
selector: 'typeLike',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
custom: {
|
|
49
|
-
match: false,
|
|
50
|
-
regex: '^I[A-Z]',
|
|
51
|
-
},
|
|
52
|
-
format: ['PascalCase'],
|
|
53
|
-
selector: 'interface',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
custom: {
|
|
57
|
-
match: false,
|
|
58
|
-
regex: '^T[A-Z]',
|
|
59
|
-
},
|
|
60
|
-
format: ['PascalCase'],
|
|
61
|
-
selector: 'typeLike',
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
'@typescript-eslint/no-non-null-assertion': 0,
|
|
65
|
-
'@typescript-eslint/no-shadow': 2,
|
|
66
|
-
'@typescript-eslint/no-unused-vars': [
|
|
67
|
-
2,
|
|
68
|
-
{ args: 'all', argsIgnorePattern: '^_', ignoreRestSiblings: false, vars: 'all' },
|
|
69
|
-
],
|
|
70
|
-
'@typescript-eslint/no-use-before-define': 0,
|
|
71
|
-
'import/consistent-type-specifier-style': [2, 'prefer-inline'],
|
|
72
|
-
'import/no-named-as-default': 0,
|
|
73
|
-
'import/no-named-as-default-member': 0,
|
|
74
|
-
'no-use-before-define': 0,
|
|
75
|
-
'typescript-sort-keys/interface': [2, 'asc', { caseSensitive: true, natural: true, requiredFirst: false }],
|
|
76
|
-
'typescript-sort-keys/string-enum': 2,
|
|
77
|
-
},
|
|
78
|
-
settings: {
|
|
79
|
-
'import/resolver': {
|
|
80
|
-
typescript: {
|
|
81
|
-
alwaysTryTypes: true,
|
|
82
|
-
project: '<root>/tsconfig.json',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
files: ['**/*.{mjs,cjs,js,jsx}'],
|
|
89
|
-
rules: {
|
|
90
|
-
'no-shadow': 2,
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
plugins: [
|
|
95
|
-
'import',
|
|
96
|
-
'prefer-arrow',
|
|
97
|
-
'sort-class-members',
|
|
98
|
-
'sort-destructure-keys',
|
|
99
|
-
'sort-keys-fix',
|
|
100
|
-
'unicorn',
|
|
101
|
-
'prettier',
|
|
102
|
-
],
|
|
103
|
-
rules: {
|
|
104
|
-
'import/extensions': [2, 'ignorePackages'],
|
|
105
|
-
'import/namespace': 0,
|
|
106
|
-
'import/no-default-export': 2,
|
|
107
|
-
// Outstanding bug impacting this rule: https://github.com/import-js/eslint-plugin-import/issues/2168
|
|
108
|
-
'import/no-extraneous-dependencies': [
|
|
109
|
-
2,
|
|
110
|
-
{
|
|
111
|
-
devDependencies: [
|
|
112
|
-
'**/.*',
|
|
113
|
-
'**/*.config.*',
|
|
114
|
-
'**/*.setup.*',
|
|
115
|
-
'**/*.test.*',
|
|
116
|
-
'**/*.stories.*',
|
|
117
|
-
'**/__testUtils__/**',
|
|
118
|
-
'**/__tests__/**',
|
|
119
|
-
'**/__mocks__/**',
|
|
120
|
-
'**/.storybook/**',
|
|
121
|
-
],
|
|
122
|
-
peerDependencies: false,
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
'import/order': [
|
|
126
|
-
2,
|
|
127
|
-
{
|
|
128
|
-
alphabetize: { caseInsensitive: false, order: 'asc' },
|
|
129
|
-
groups: [['builtin', 'external'], 'parent', 'sibling', 'index'],
|
|
130
|
-
'newlines-between': 'never',
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
'max-len': [
|
|
134
|
-
2,
|
|
135
|
-
{
|
|
136
|
-
code: 120,
|
|
137
|
-
comments: 100,
|
|
138
|
-
ignoreRegExpLiterals: true,
|
|
139
|
-
ignoreStrings: true,
|
|
140
|
-
ignoreTemplateLiterals: true,
|
|
141
|
-
ignoreUrls: true,
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
'no-unused-vars': [2, { args: 'all', argsIgnorePattern: '^_', ignoreRestSiblings: false, vars: 'all' }],
|
|
145
|
-
'no-use-before-define': [2, { functions: false }],
|
|
146
|
-
'one-var': [2, { initialized: 'never' }],
|
|
147
|
-
'one-var-declaration-per-line': [2, 'initializations'],
|
|
148
|
-
'padding-line-between-statements': [
|
|
149
|
-
2,
|
|
150
|
-
{ blankLine: 'any', next: '*', prev: '*' },
|
|
151
|
-
{ blankLine: 'always', next: '*', prev: 'multiline-block-like' },
|
|
152
|
-
{ blankLine: 'always', next: 'multiline-block-like', prev: '*' },
|
|
153
|
-
{ blankLine: 'always', next: '*', prev: 'multiline-expression' },
|
|
154
|
-
{ blankLine: 'always', next: 'multiline-expression', prev: '*' },
|
|
155
|
-
{ blankLine: 'always', next: '*', prev: 'directive' },
|
|
156
|
-
{ blankLine: 'always', next: 'directive', prev: '*' },
|
|
157
|
-
{ blankLine: 'never', next: 'singleline-const', prev: 'singleline-const' },
|
|
158
|
-
{ blankLine: 'never', next: 'singleline-const', prev: 'singleline-let' },
|
|
159
|
-
{ blankLine: 'never', next: 'singleline-let', prev: 'singleline-let' },
|
|
160
|
-
{ blankLine: 'never', next: 'singleline-let', prev: 'singleline-const' },
|
|
161
|
-
{ blankLine: 'always', next: 'singleline-const', prev: 'cjs-import' },
|
|
162
|
-
{ blankLine: 'always', next: 'singleline-let', prev: 'cjs-import' },
|
|
163
|
-
{ blankLine: 'always', next: '*', prev: 'multiline-const' },
|
|
164
|
-
{ blankLine: 'always', next: 'multiline-const', prev: '*' },
|
|
165
|
-
{ blankLine: 'always', next: '*', prev: 'multiline-let' },
|
|
166
|
-
{ blankLine: 'always', next: 'multiline-let', prev: '*' },
|
|
167
|
-
{ blankLine: 'never', next: 'cjs-export', prev: 'cjs-export' },
|
|
168
|
-
{ blankLine: 'never', next: 'cjs-import', prev: 'cjs-import' },
|
|
169
|
-
{ blankLine: 'always', next: 'case', prev: '*' },
|
|
170
|
-
{ blankLine: 'always', next: 'default', prev: '*' },
|
|
171
|
-
{ blankLine: 'always', next: '*', prev: 'break' },
|
|
172
|
-
],
|
|
173
|
-
'prefer-arrow/prefer-arrow-functions': [
|
|
174
|
-
2,
|
|
175
|
-
{
|
|
176
|
-
allowStandaloneDeclarations: false,
|
|
177
|
-
classPropertiesAllowed: false,
|
|
178
|
-
disallowPrototype: true,
|
|
179
|
-
singleReturnOnly: false,
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
'prettier/prettier': 2,
|
|
183
|
-
'sort-class-members/sort-class-members': [
|
|
184
|
-
2,
|
|
185
|
-
{
|
|
186
|
-
accessorPairPositioning: 'getThenSet',
|
|
187
|
-
groups: {
|
|
188
|
-
'arrow-function-properties': [
|
|
189
|
-
{ propertyType: 'ArrowFunctionExpression', sort: 'alphabetical', type: 'property' },
|
|
190
|
-
],
|
|
191
|
-
methods: [{ sort: 'alphabetical', type: 'method' }],
|
|
192
|
-
'private-arrow-function-properties': [
|
|
193
|
-
{ name: '/_.+/', propertyType: 'ArrowFunctionExpression', type: 'property' },
|
|
194
|
-
],
|
|
195
|
-
'private-methods': [{ name: '/_.+/', sort: 'alphabetical', type: 'method' }],
|
|
196
|
-
'private-properties': [{ name: '/_.+/', sort: 'alphabetical', type: 'property' }],
|
|
197
|
-
properties: [{ sort: 'alphabetical', type: 'property' }],
|
|
198
|
-
'static-methods': [{ sort: 'alphabetical', static: true, type: 'method' }],
|
|
199
|
-
'static-private-methods': [{ name: '/_.+/', sort: 'alphabetical', static: true, type: 'method' }],
|
|
200
|
-
'static-private-properties': [{ name: '/_.+/', sort: 'alphabetical', static: true, type: 'property' }],
|
|
201
|
-
'static-properties': [{ sort: 'alphabetical', static: true, type: 'property' }],
|
|
202
|
-
},
|
|
203
|
-
order: [
|
|
204
|
-
'[static-properties]',
|
|
205
|
-
'[static-private-properties]',
|
|
206
|
-
'[static-methods]',
|
|
207
|
-
'[static-private-methods]',
|
|
208
|
-
'[arrow-function-properties]',
|
|
209
|
-
'[properties]',
|
|
210
|
-
'[private-arrow-function-properties]',
|
|
211
|
-
'[private-properties]',
|
|
212
|
-
'constructor',
|
|
213
|
-
'getters',
|
|
214
|
-
'setters',
|
|
215
|
-
'[methods]',
|
|
216
|
-
'[private-methods]',
|
|
217
|
-
],
|
|
218
|
-
},
|
|
219
|
-
],
|
|
220
|
-
'sort-destructure-keys/sort-destructure-keys': [2, { caseSensitive: true }],
|
|
221
|
-
'sort-imports': [
|
|
222
|
-
2,
|
|
223
|
-
{
|
|
224
|
-
ignoreDeclarationSort: true,
|
|
225
|
-
},
|
|
226
|
-
],
|
|
227
|
-
'sort-keys': 0,
|
|
228
|
-
'sort-keys-fix/sort-keys-fix': [2, 'asc', { caseSensitive: true, natural: true }],
|
|
229
|
-
'sort-vars': [2, { ignoreCase: false }],
|
|
230
|
-
'unicorn/consistent-function-scoping': [2, { checkArrowFunctions: false }],
|
|
231
|
-
'unicorn/filename-case': [
|
|
232
|
-
2,
|
|
233
|
-
{
|
|
234
|
-
cases: {
|
|
235
|
-
camelCase: true,
|
|
236
|
-
pascalCase: true,
|
|
237
|
-
},
|
|
238
|
-
ignore: ['^module-defs.d.ts$', '^next-env.d.ts$'],
|
|
239
|
-
},
|
|
240
|
-
],
|
|
241
|
-
'unicorn/no-array-reduce': 0,
|
|
242
|
-
'unicorn/prevent-abbreviations': 0,
|
|
243
|
-
},
|
|
244
|
-
};
|