-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
84 lines (79 loc) · 2.21 KB
/
.eslintrc.js
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
module.exports = {
env: {
node: true,
jest: true,
},
extends: [
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'prettier', 'import'],
ignorePatterns: ['.eslintrc.js'],
root: true,
rules: {
'prettier/prettier': 2,
'no-tabs': ['error'],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { 'allowTemplateLiterals': true }],
semi: ['error', 'always'],
'import/first': 'error',
'import/named': 'error',
'import/namespace': 'error',
'import/default': 'error',
'import/export': 'error',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'index',
['sibling', 'parent'],
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
},
},
],
'space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never', // Only remove spaces for something like function abc() {}
asyncArrow: 'always',
},
],
'no-console': 'warn',
'no-warning-comments': 'warn',
'comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
// we need this due to our injections in services and controllers
'no-useless-constructor': 'off',
},
'overrides': [
// to allow for NextJS inferred typing like this
// https://nextjs.org/docs/api-reference/data-fetching/get-server-side-props
{
'files': ['*.tsx'],
'rules': {
'@typescript-eslint/explicit-module-boundary-types': ['off']
}
}
],
settings: {
// This uses the eslint-import-resolver-typescript npm module to properly
// resolve the imports. Without it, the linter thinks 'utils/error' is an
// external package, whereas it is just an absolute import.
'import/resolver': 'typescript',
},
};