-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrules.cjs
54 lines (53 loc) · 1.34 KB
/
rules.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
const baseConfig = require('eslint-config-airlight-base/legacy');
module.exports = {
...baseConfig.rules,
'@typescript-eslint/naming-convention': [
'error',
{
selector: ['function', 'method'],
format: ['strictCamelCase'],
leadingUnderscore: 'forbid'
},
{
selector: 'property',
format: ['snake_case', 'strictCamelCase'],
leadingUnderscore: 'forbid'
},
{
selector: 'objectLiteralProperty',
format: ['StrictPascalCase'],
leadingUnderscore: 'forbid'
},
{
selector: 'variable',
format: ['strictCamelCase'],
leadingUnderscore: 'forbid'
},
{
selector: 'variable',
types: ['boolean', 'number'],
modifiers: ['const'],
format: ['UPPER_CASE', 'strictCamelCase'],
leadingUnderscore: 'forbid'
},
{
selector: 'typeLike',
format: ['StrictPascalCase'],
leadingUnderscore: 'forbid'
},
{
selector: 'interface',
format: ['PascalCase'],
leadingUnderscore: 'forbid',
custom: {
regex: '^I[A-Z]',
match: true
}
}
],
'react/jsx-pascal-case': ['error'],
'react/jsx-no-useless-fragment': ['error'],
'react/no-deprecated': ['error'],
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
'react-refresh/only-export-components': 'warn'
};