-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
94 lines (91 loc) · 2.7 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
const stylistic = require('@stylistic/eslint-plugin');
const simpleImportSort = require('eslint-plugin-simple-import-sort');
const tsEslint = require('typescript-eslint');
module.exports = [
{
files: ['**/*.{js,jsx,ts,tsx,mjs}'],
ignores: ['node_modules/**/*', 'dist/**/*'],
plugins: {
'@stylistic': stylistic,
'simple-import-sort': simpleImportSort,
'@ts': tsEslint.plugin,
},
languageOptions: {
parser: tsEslint.parser,
},
rules: {
'simple-import-sort/imports': [
'error',
{
groups: [
[''],
['.*/(infra|infrastructure).*'],
['.*/app'],
['.*/domain.*'],
['.*.module.css$'],
['.*.css$'],
],
},
],
'no-dupe-keys': 'error',
'@stylistic/key-spacing': ['error', { beforeColon: false }],
'@stylistic/block-spacing': 'error',
'@stylistic/arrow-spacing': 'error',
'@stylistic/one-var-declaration-per-line': ['error', 'always'],
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/brace-style': ['error', '1tbs'],
'@stylistic/jsx-quotes': ['error', 'prefer-double'],
'no-nested-ternary': 'error',
'@stylistic/comma-dangle': ['error', 'always-multiline'],
'@stylistic/comma-spacing': [
'error',
{
before: false,
after: true,
},
],
'@stylistic/keyword-spacing': 'error',
'@stylistic/space-before-blocks': 'error',
'@stylistic/no-multiple-empty-lines': [
'error',
{
max: 1,
maxEOF: 1,
},
],
'@stylistic/lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],
'@stylistic/padded-blocks': ['error', 'never'],
'@stylistic/arrow-parens': ['error', 'always'],
'@stylistic/space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
},
],
'@stylistic/quotes': ['error', 'single'],
'@stylistic/semi': 'error',
'@stylistic/no-multi-spaces': ['error'],
'@stylistic/no-trailing-spaces': ['error'],
'@stylistic/space-infix-ops': ['error'],
'@stylistic/indent': ['error', 2],
'@stylistic/jsx-indent': ['error', 2],
'@stylistic/member-delimiter-style': ['error'],
'@stylistic/type-annotation-spacing': ['error'],
'@ts/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
},
},
];