forked from novuhq/novu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
102 lines (101 loc) · 3.46 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
module.exports = {
root: true,
extends: [
'airbnb-typescript',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:promise/recommended',
'plugin:@cspell/recommended',
],
ignorePatterns: ['.eslintrc.js', '*.json', 'jest.config.js'],
plugins: ['import', 'promise', '@typescript-eslint', 'prettier'],
parser: '@typescript-eslint/parser',
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2020,
sourceType: 'module',
tsconfigRootDir: __dirname,
},
rules: {
'@typescript-eslint/space-before-blocks': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'react/jsx-wrap-multilines': 'off',
'react/jsx-filename-extension': 'off',
'multiline-comment-style': ['error', 'starred-block'],
'promise/catch-or-return': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'react/jsx-closing-bracket-location': 'off',
'@typescript-eslint/no-var-requires': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['off'],
'mocha/no-mocha-arrows': 'off',
'@typescript-eslint/default-param-last': 'off',
'no-return-await': 'off',
'no-await-in-loop': 'off',
'no-continue': 'off',
'no-console': 'warn',
'no-prototype-builtins': 'off',
'import/no-cycle': 'off',
'class-methods-use-this': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 1,
'no-restricted-syntax': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'no-underscore-dangle': 'off',
'import/prefer-default-export': 'off',
// A temporary hack related to IDE not resolving correct package.json
'import/no-extraneous-dependencies': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-no-bind': 'off',
'lines-between-class-members': 'off',
'max-classes-per-file': 'off',
'react/react-in-jsx-scope': 'off',
'max-len': ['warn', { code: 140 }],
'@typescript-eslint/return-await': 'off',
'no-restricted-imports': [
'error',
{
patterns: ['@novu/shared/*', '@novu/dal/*', '!import2/good'],
},
],
'padding-line-between-statements': [
'error',
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['if', 'for'] },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
{ blankLine: 'always', prev: '*', next: 'return' },
],
'id-length': ['error', { min: 2, exceptions: ['i', 'e', 'a', 'b', '_', 't'], properties: 'never' }],
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'enumMember', format: ['UPPER_CASE'] },
{ selector: 'enum', format: ['PascalCase'], suffix: ['Enum'] },
{ selector: 'class', format: ['PascalCase'] },
{ selector: 'variableLike', format: ['camelCase', 'UPPER_CASE'], leadingUnderscore: 'allow' },
{
selector: 'interface',
format: ['PascalCase'],
prefix: ['I'],
},
{
selector: ['function'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},
],
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
},
};