-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
74 lines (64 loc) · 2.29 KB
/
.eslintrc
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
{
"extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"],
"plugins": ["tailwindcss", "prettier", "simple-import-sort"],
"rules": {
"tailwindcss/no-custom-classname": "error",
// Format with prettier before eslint
// https://github.com/prettier/prettier-eslint
"prettier/prettier": "error",
// Enforce sorting of imports and exports
// https://github.com/lydell/eslint-plugin-simple-import-sort
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
// Prevent usage of nested ternarary expressions
// https://eslint.org/docs/rules/no-nested-ternary
"no-nested-ternary": "error",
// https://eslint.org/docs/rules/no-unneeded-ternary
"no-unneeded-ternary": "error",
// https://eslint.org/docs/rules/no-else-return
"no-else-return": ["error", { "allowElseIf": false }],
// Prevent usage of console
// https://eslint.org/docs/rules/no-console
"no-console": "warn",
// Enforce props alphabetical sorting
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
"react/jsx-sort-props": [
"error",
{
"ignoreCase": true,
"callbacksLast": false,
"shorthandFirst": false,
"shorthandLast": false,
"noSortAlphabetically": false,
"reservedFirst": true
}
],
// Enforce defaultProps declarations alphabetical sorting
// https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-sort-default-props.md
"react/jsx-sort-default-props": [
"error",
{
"ignoreCase": true
}
],
// Prevent usage of button elements without an explicit type attribute
// https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/button-has-type.md
"react/button-has-type": [
"error",
{
"button": true,
"submit": true,
"reset": false
}
],
// Prevent usage of extra closing tags for components without children
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true
}
]
}
}