forked from AccessibleForAll/AccessibleWebDev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
77 lines (77 loc) · 1.89 KB
/
.eslintrc.json
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
{
"extends": [
"next/core-web-vitals",
"prettier",
"plugin:storybook/recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"comma-spacing": ["error", { "before": false, "after": true }],
"react/no-unescaped-entities": 0,
"react/prop-types": "off",
// suppress errors for missing 'import React' in files
"react/react-in-jsx-scope": "off",
// allow jsx syntax in js files (for next.js project)
"react/jsx-filename-extension": [
1,
{ "extensions": [".js", ".jsx", ".ts", ".tsx"] }
] //should add ".ts" if typescript project
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"react/prop-types": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["strictCamelCase"],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
},
{
"selector": "objectLiteralProperty",
"modifiers": ["requiresQuotes"],
"format": null
},
{
"selector": "objectLiteralProperty",
"format": ["strictCamelCase", "StrictPascalCase"]
},
{
"selector": "typeLike",
"format": ["StrictPascalCase"]
},
{
"selector": "interface",
"format": ["PascalCase"]
},
{
"selector": "function",
// Exception for FunctionComponents
"format": ["strictCamelCase", "StrictPascalCase"]
},
{
"selector": "parameter",
"format": ["strictCamelCase", "StrictPascalCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
{
"selector": "variable",
"modifiers": ["exported"],
// Exception for components wrapped in HOC's and for React's Context
"format": ["strictCamelCase", "StrictPascalCase", "UPPER_CASE"]
},
{
"selector": "enumMember",
"format": ["StrictPascalCase"]
}
]
}
}
]
}