-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
85 lines (85 loc) · 3.69 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
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": ["@typescript-eslint/eslint-plugin", "import", "unused-imports", "simple-import-sort"],
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"root": true,
"env": {
"node": true,
"jest": true
},
"ignorePatterns": [".eslintrc.json", "environment.prod.ts", "dist/**"],
"rules": {
/* Functions should always have a return type, even for void. */
"@typescript-eslint/explicit-function-return-type": "error",
/* An exported function should define the type of its arguments and return, even for void. */
"@typescript-eslint/explicit-module-boundary-types": "error",
/* Rules out the usage of 'any' type. */
"@typescript-eslint/no-explicit-any": "error",
/* Unuses variables are not allowed. */
"@typescript-eslint/no-unused-vars": "error",
/* Duplicate imports are not allowed. */
"no-duplicate-imports": "error",
/* Unused imports are not allowed. */
"unused-imports/no-unused-imports": "error",
/* If an if-block returns in all scenarios, then it should not have an else-block. */
"no-else-return": "error",
/* No assignments in the return statement. */
"no-return-assign": "error",
/* No await(s) in the return statement. */
"no-return-await": "error",
/* A 'return' that does not affect the flow in any way, is not allowed. */
"no-useless-return": "error",
/* Any callback functions should be arrow functions. */
"prefer-arrow-callback": "error",
/* If a variable is having no re-assignments then it should be const. */
"prefer-const": "error",
/* Destructuring should be followed wherever possible. */
"prefer-destructuring": "error",
/* Imports are sorted and grouped. */
"simple-import-sort/imports": "error",
/* Exports are sorted. */
"simple-import-sort/exports": "error",
/* Default sort-import mechanism of ESLint is disabled. */
"sort-imports": "off",
/* Allowing one new line after an import. */
"import/newline-after-import": ["error", { "count": 1 }],
/* No duplicate imports allowed. */
"import/no-duplicates": "error",
/* One space is put after semicolon. */
"semi-spacing": ["error", { "before": false, "after": true }],
/* All comment statements must have space before them. */
"spaced-comment": ["error", "always"],
/* Colon in a switch statement must be followed by a space. */
"switch-colon-spacing": ["error", { "after": true, "before": false }],
/* No spacing before/after the curly braces in a template string literal. */
"template-curly-spacing": ["error", "never"],
/* IIFE are wrapped. */
"wrap-iife": ["error", "outside"],
/* Regexes are wrapped. */
"wrap-regex": "error",
/* In a variable-literal comparison, the variable should come first. */
"yoda": "error",
/* There should be a new-line at the end of all files. */
"eol-last": ["error", "always"],
/* Only triple-equals will be used for comparisons. */
"eqeqeq": ["error", "always"],
/* No spacing in function call paranthesis. */
"func-call-spacing": ["error", "never"],
/* Functions should be declared as expressions. */
"func-style": ["error", "expression"],
/* Duplicate else-if not allowed. */
"no-dupe-else-if": "error",
/* Duplicate case not allowed. */
"no-duplicate-case": "error",
/* Extra semi-colon not allowed. */
"no-extra-semi": "error",
/* Absence of break statements in switch case is not allowed. */
"no-fallthrough": "error",
/* Assignment to an imported entity is not allowed. */
"no-import-assign": "error"
}
}