generated from Greenstand/treetracker-microservice-template
-
Notifications
You must be signed in to change notification settings - Fork 59
/
.eslintrc.js
108 lines (96 loc) · 2.43 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
module.exports = {
extends: [
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'airbnb-base',
'airbnb-typescript/base',
'prettier',
],
plugins: [],
rules: {
// disabled or modified because too strict
'no-nested-ternary': 'off',
'no-restricted-globals': 'warn',
'no-console': ['warn', { allow: ['info', 'error'] }],
'import/prefer-default-export': 'off',
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-promise-executor-return': 'off',
'consistent-return': 'off',
radix: 'off',
'@typescript-eslint/no-unused-expressions': [
'error',
{ allowShortCircuit: true },
],
// non-default errors
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
// naming conventions
camelcase: 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'snake_case'],
},
],
// allow test files to use dev deps
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/*.{test,spec}.ts', 'test/**/*'],
},
],
// import sorting
'import/order': [
'error',
{
groups: [
'builtin', // node built in
'external', // installed dependencies
'internal', // baseUrl
'index', // ./
'sibling', // ./*
'parent', // ../*
'object', // ts only
'type', // ts only
],
pathGroups: [
{
pattern: '@test/**',
group: 'internal',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'never',
},
],
},
env: {
es2021: true,
node: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 13,
sourceType: 'module',
project: ['./tsconfig.json'],
},
// report unused eslint-disable comments
reportUnusedDisableDirectives: true,
settings: {
'import/resolver': {
node: {
extensions: ['.ts'],
moduleDirectory: ['server/'],
},
},
},
};