-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
136 lines (132 loc) · 4.46 KB
/
.eslintrc.cjs
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/* eslint-disable no-useless-escape */
/* eslint-disable @typescript-eslint/no-var-requires */
module.exports = {
env: {
browser: true,
es2021: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
overrides: [
{
files: [
'src/**/*.ts',
'src/**/*.tsx',
'src/**/*.js',
'src/**/*.jsx',
'src/**/*.cjs',
'src/**/*.mjs'
],
rules: {
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'default', format: [ 'camelCase' ] },
{ selector: 'variableLike', format: [ 'camelCase' ] },
{ selector: 'variable', format: [ 'camelCase', 'UPPER_CASE' ] },
{ selector: 'parameter', format: [ 'camelCase' ], leadingUnderscore: 'allow' },
{ selector: 'memberLike', format: [ 'camelCase' ] },
{ selector: 'memberLike', modifiers: [ 'private' ], format: [ 'camelCase' ], leadingUnderscore: 'require' },
{ selector: 'typeLike', format: [ 'PascalCase' ] },
{ selector: 'typeParameter', format: [ 'PascalCase' ], prefix: [ 'T' ] },
{ selector: 'interface', format: [ 'PascalCase' ], custom: { regex: '^I[A-Z]', match: true } }
],
'simple-import-sort/imports': [
'error',
{
groups: [
// 1. built-in node.js modules
[ `^(${ require('module').builtinModules.join('|') })(/|$)` ],
// 2.1. package that start without @
// 2.2. package that start with @
[ '^\\w', '^@\\w' ],
// 3. @nestjs packages
[ '^@nestjs\/' ],
// 4. @kibibit packages
[ '^@kibibit\/' ],
// 5. Internal kibibit packages (inside this project)
[ '^@kb-' ],
// 6. Parent imports. Put `..` last.
[ '^\\.\\.(?!/?$)', '^\\.\\./?$', '^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$' ],
// 7. Side effect imports.
[ '^\\u0000' ]
]
}
],
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'unused-imports/no-unused-imports': 'error'
}
},
{
files: [
'*.ts',
'*.tsx',
'*.js',
'*.jsx',
'*.cjs',
'*.mjs'
],
rules: {
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/no-explicit-any': 0,
'@stylistic/js/semi': [ 'error', 'always' ],
'@stylistic/js/quotes': [ 'error', 'single', { 'avoidEscape': true } ],
'@stylistic/js/comma-dangle': [ 'error', 'never' ],
'@stylistic/js/object-curly-spacing': [ 'error', 'always' ],
'@stylistic/js/no-multi-spaces': 'error',
'@stylistic/js/no-multiple-empty-lines': 'error',
'@stylistic/js/array-bracket-spacing': [ 'error', 'always' ],
'@stylistic/js/arrow-spacing': 'error',
'@stylistic/js/block-spacing': 'error',
'@stylistic/js/semi-spacing': 'error',
'@stylistic/js/indent': [ 'error', 2 ],
'@stylistic/js/template-curly-spacing': [ 'error', 'always' ],
'@stylistic/js/max-len': [
'error', {
'code': 80,
'ignoreStrings': true,
'ignoreTemplateLiterals': true
}
]
}
},
{
files: [ '*.html' ],
parser: '@html-eslint/parser',
extends: [ 'plugin:@html-eslint/recommended' ],
rules: {
'@html-eslint/attrs-newline': 'error',
'@html-eslint/no-duplicate-attrs': 'error',
'@html-eslint/indent': [ 'error', 2 ],
'@html-eslint/lowercase': 'error',
'@html-eslint/sort-attrs': [ 'error', {
'priority': [ 'id', 'name', 'content', 'type', 'class' ]
} ],
'@html-eslint/require-button-type': 'error',
'@html-eslint/no-obsolete-tags': 'error',
'@html-eslint/no-duplicate-id': 'error',
'@html-eslint/no-positive-tabindex': 'error',
'@html-eslint/require-open-graph-protocol': 'error'
}
}
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'@typescript-eslint',
'@stylistic/js',
'unused-imports',
'simple-import-sort',
'import',
'@html-eslint'
]
};