forked from shabados/database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
98 lines (98 loc) · 3.1 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
{
"extends": "airbnb-base",
"root": true,
"env": {
"es6": true,
"jest/globals": true
},
"plugins": ["jest", "require-sort"],
"rules": {
// Spacing in brackets is consistent and readable
"array-bracket-spacing": ["error", "always"],
// Spacing in brackets is consistent and readable
"computed-property-spacing": ["error", "always"],
// Allow clean function parens
"arrow-parens": [
"error",
"as-needed",
{
"requireForBlockBody": false
}
],
// Spacing in brackets is consistent and readable
"space-in-parens": [
"error",
"always",
{
"exceptions": ["empty"]
}
],
// Doesn't really help to check if the module is on the filesystem, and can harm when using Docker etc: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
"import/no-unresolved": "off",
// Do not require .js/ts extensions, except for .json
"import/extensions": "off",
// Preferable, but the author should know best for the situation
"import/prefer-default-export": "off",
// Windows users may checkout as CRLF, but check in as LF, which this rule breaks
"linebreak-style": "off",
// There's no need to have more than 1 empty line, ever
"no-multiple-empty-lines": [
"error",
{
"max": 1
}
],
// Allow nested ternary
"no-nested-ternary": "off",
// No unused variables except when prepended with _, to indicate that they're not to be used, but require definition to be valid code
"no-unused-vars": [
"error",
{
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_"
}
],
// https://eslint.org/docs/rules/no-shadow seems sensible to not have shadow variables, but can get annoying real quick, especially in the case of reducers
"no-shadow": "off",
// Be consistent about where the object braces go
"object-curly-newline": [
"error",
{
"consistent": true
}
],
// Object properties either on the same line, or all on separate, consistently
"object-property-newline": [
"error",
{
"allowAllPropertiesOnSameLine": true
}
],
// Semi colons are visual garbage
"semi": ["error", "never"],
// For the few semi-colons required (e.g. inline array operations), place them at the beginning of the statement
"semi-style": ["error", "first"],
// This plugin sorts alphabetically by default
"require-sort/require-sort": [
"error",
{
"ignoreCase": false,
"ignoreDeclarationSort": false,
"ignorePropertySort": false,
"propertySyntaxSortOrder": ["none", "single", "multiple"]
}
],
// Classes per file
"max-classes-per-file": [ "error", 2 ],
// Add new line between imports
"import/order": "off",
"sort-imports": "off",
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"default-param-last": "off",
"no-console": "off"
}
}