-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.cjs
69 lines (68 loc) · 1.77 KB
/
.eslintrc.cjs
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
'use strict';
module.exports = {
root: true,
env: {
node: true,
browser: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
'plugin:import/warnings',
'plugin:regexp/recommended',
'plugin:etc/recommended',
'plugin:promise/recommended',
'plugin:prettier/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
project: ['./tsconfig.eslint.json'],
sourceType: 'module',
ecmaFeatures: {
jsx: false,
},
warnOnUnsupportedTypeScriptVersion: false,
},
plugins: [
'import',
'@typescript-eslint',
'prettier',
'simple-import-sort',
'etc',
'promise'
],
rules: {
// core
'consistent-return': [1, { treatUndefinedAsUnspecified: true }],
'quotes': [1, 'single', { allowTemplateLiterals: true, avoidEscape: true }],
'semi': [1, 'always'],
'max-lines': [1, { max: 300 }],
'max-params': [1, { max: 5 }],
'no-unneeded-ternary': [1],
// import
'import/max-dependencies': [1, { max: 15 }],
// simple-import-sort with recomended settings
'simple-import-sort/imports': 1,
'simple-import-sort/exports': 1,
'sort-imports': 0,
'import/first': 1,
'import/newline-after-import': 1,
'import/no-duplicates': 1,
// typescript-eslint
'@typescript-eslint/no-floating-promises': 1,
'@typescript-eslint/no-unnecessary-condition': 1,
'@typescript-eslint/no-explicit-any': [1, { ignoreRestArgs: true }],
},
overrides: [
{
files: ['.eslintrc.cjs', '.prettierrc.cjs', '.commitlintrc.js', '*.js'],
env: {
node: true,
},
},
],
};