generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
161 lines (155 loc) · 4.3 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
{
"env": {
"browser": true,
"node": true,
"jest": true
},
"extends": [
"airbnb-base",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"project": ["tsconfig.json", "integration_tests/tsconfig.json", "script/tsconfig.json"]
},
"ignorePatterns": ["cypress.config.ts", "cypress-refer-disabled.config.ts"],
"plugins": ["@typescript-eslint", "import", "no-only-tests", "sort-exports"],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"]
},
"typescript": {
"alwaysTryTypes": true
}
}
},
"rules": {
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
"@typescript-eslint/consistent-indexed-object-style": "error",
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/member-ordering": [
"error",
{
"default": {
"memberTypes": [
"public-static-method",
"protected-static-method",
"private-static-method",
"static-field",
"instance-field",
"constructor",
["public-get", "public-set"],
"public-instance-method",
["protected-get", "protected-set"],
"protected-instance-method",
["private-get", "private-set"],
"private-instance-method"
],
"order": "natural-case-insensitive"
},
"interfaces": {
"memberTypes": ["field", "signature", "constructor", "method"],
"optionalityOrder": "required-first",
"order": "natural-case-insensitive"
},
"typeLiterals": {
"memberTypes": ["field", "signature", "constructor", "method"],
"optionalityOrder": "required-first",
"order": "natural-case-insensitive"
}
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "res|next|^err|_",
"ignoreRestSiblings": true
}
],
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/prefer-destructuring": [
"error",
{
"array": false,
"object": true
},
{
"enforceForRenamedProperties": false
}
],
"@typescript-eslint/semi": "off",
"@typescript-eslint/sort-type-constituents": "error",
"class-methods-use-this": "off",
"comma-dangle": ["error", "always-multiline"],
"import/exports-last": "error",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"mjs": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"import/first": "error",
"import/group-exports": "error",
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": ["**/*.test.js", "**/*.test.ts", "**/testutils/**", "cypress.config.ts"] }
],
"import/no-unresolved": "error",
"import/order": [
"error",
{
"alphabetize": { "order": "asc", "orderImportKind": "asc" },
"groups": [["builtin", "external"]],
"newlines-between": "always"
}
],
"no-empty-function": [
"warn",
{
"allow": ["constructors"]
}
],
"no-only-tests/no-only-tests": "error",
"no-shadow": "off",
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "res|next|^err|_",
"ignoreRestSiblings": true
}
],
"no-use-before-define": "off",
"no-useless-constructor": "off",
"prettier/prettier": [
"error",
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"semi": false
}
],
"quotes": ["error", "single", { "avoidEscape": true }],
"semi": "off",
"sort-exports/sort-exports": ["error", { "sortExportKindFirst": "value" }],
"sort-imports": [
"error",
{
"ignoreDeclarationSort": true
}
],
"sort-keys": ["error", "asc", { "caseSensitive": true, "natural": false }]
}
}