forked from frontity/frontity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
129 lines (129 loc) · 3.77 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
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
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:import/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:jest/recommended",
"plugin:cypress/recommended"
],
"plugins": ["jsdoc", "react-hooks"],
"rules": {
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "error", // Checks effect dependencies
"react/prop-types": "off",
"import/named": "off",
"jsdoc/check-examples": "error",
"jsdoc/check-param-names": "off",
"jsdoc/check-syntax": "error",
"jsdoc/check-types": "error",
"jsdoc/implements-on-classes": "error",
"jsdoc/match-description": "error",
"jsdoc/newline-after-description": "error",
"jsdoc/no-types": "error",
"jsdoc/no-undefined-types": "error",
"jsdoc/require-description": [
"error",
{
"contexts": ["any"]
}
],
"jsdoc/require-description-complete-sentence": "error",
"jsdoc/require-param": [
"error",
{
"checkDestructured": false
}
],
"jsdoc/require-param-description": "error",
"jsdoc/require-param-name": "error",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "error",
"jsdoc/require-returns-check": "error",
"jsdoc/require-returns-description": "error",
"jsdoc/require-returns-type": "off",
"jsdoc/valid-types": "error",
"jsdoc/require-jsdoc": [
"error",
{
"require": {
"ClassDeclaration": true,
"MethodDefinition": true,
"FunctionDeclaration": true,
"ArrowFunctionExpression": false
},
"contexts": [
"TSInterfaceDeclaration",
"TSTypeAliasDeclaration",
"TSEnumDeclaration",
"TSPropertySignature",
"VariableDeclarator > ArrowFunctionExpression"
]
}
]
},
"env": {
"browser": true,
"node": true,
"es6": true,
"cypress/globals": true
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"typescript": {
"alwaysTryTypes": true
}
}
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"plugins": ["eslint-plugin-tsdoc"],
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
"@typescript-eslint/indent": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "ignoreRestSiblings": true }
],
"tsdoc/syntax": "error",
// The option `allowTypedFunctionExpressions` doesn't work with
// nested typed functions, so this rule is disabled.
// Bug: https://github.com/typescript-eslint/typescript-eslint/issues/2183
// Docs: https://github.com/typescript-eslint/typescript-eslint/blob/v4.6.0/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md#allowtypedfunctionexpressions
"@typescript-eslint/explicit-module-boundary-types": "off"
}
},
// Overrides for all the tests files.
{
"files": [
"**/__tests__/*.{js,ts,jsx,tsx}",
"**/integration/**/*.spec.{js,ts}"
],
"rules": {
"jsdoc/require-jsdoc": "off",
"jsdoc/require-description": "off",
"tsdoc/syntax": "off",
"jest/expect-expect": [
"error",
{
"assertFunctionNames": ["expect", "**.should"]
}
]
}
},
// Overrides for Cypress test files.
{
"files": ["**/integration/**/*.spec.{js,ts}"],
"rules": {
"jest/valid-expect-in-promise": "off"
}
}
]
}