-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
.eslintrc.js
90 lines (90 loc) · 2.62 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-567365174
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:eslint-comments/recommended',
],
settings: {
'import/core-modules': ['@internal/tsup'],
jsdoc: {
mode: 'typescript',
},
},
rules: {
'no-continue': 'off',
'no-restricted-syntax': [
'off',
{
selector: 'ForOfStatement',
},
],
'no-trailing-spaces': 'error',
'@typescript-eslint/no-non-null-assertion': 1,
// Disable error on devDependencies importing since this isn't a TS library
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'no-await-in-loop': 0,
'prefer-destructuring': 0,
'no-bitwise': 0,
'no-underscore-dangle': 'off',
'class-methods-use-this': 'off',
'no-plusplus': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],
'import/order': [
'error',
{
groups: [['builtin', 'external', 'internal'], ['parent'], ['sibling', 'index']],
'newlines-between': 'always',
alphabetize: { order: 'asc' },
},
],
'@typescript-eslint/consistent-type-imports': 2,
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'eslint-comments/no-unused-disable': 'error',
'import/prefer-default-export': 'off',
'tsdoc/syntax': 'warn',
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'error',
curly: ['error', 'all'],
},
// Disable no-unused-expressions to allow chai 'expect' expressions in testing
overrides: [
{
files: ['*.test.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
},
{
files: ['**/test/typegen/**/*.ts'],
rules: {
'eslint-comments/no-unlimited-disable': 'off',
'eslint-comments/no-unused-disable': 'off',
},
},
],
};