-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
125 lines (121 loc) · 3.57 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
const fs = require('fs');
const { logger } = require('jege/server');
const path = require('path');
const log = logger('[dock-defenders]');
const excludedPackages = [
'image-extractor',
'model-simulator',
'sound-synthesizer',
'spectrogram-creator',
];
const packageDir = [__dirname].concat(
fs.readdirSync(path.resolve(__dirname, 'packages'))
.filter((child) => (excludedPackages.indexOf(child) < 0) && !child.startsWith('.'))
.map((child) => path.resolve(__dirname, 'packages', child)),
);
log('.eslintrc.js: packageDir: %s', packageDir);
module.exports = {
env: {
browser: true,
node: true,
},
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
project: ['./tsconfig.json', './packages/*/tsconfig.json'],
tsconfigRootDir: __dirname,
},
plugins: [
'@typescript-eslint',
'sort-destructure-keys',
'typescript-sort-keys',
'eslint-plugin-react',
'sort-class-members',
],
root: true,
rules: {
'@typescript-eslint/camelcase': ['off'],
'@typescript-eslint/explicit-function-return-type': ['off'],
'@typescript-eslint/member-ordering': ['error', {
classes: [
'static-field',
'instance-field',
'constructor',
'static-method',
'instance-method',
],
}],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/no-implied-eval': ['off'],
'@typescript-eslint/no-namespace': ['off'],
'@typescript-eslint/no-non-null-assertion': ['off'],
'@typescript-eslint/no-use-before-define': ['error', {
functions: false,
}],
'@typescript-eslint/no-var-requires': ['off'],
'@typescript-eslint/quotes': [
'error',
'single',
{
allowTemplateLiterals: true,
},
],
'arrow-body-style': ['off'],
'arrow-parens': ['error', 'always'],
'dot-notation': ['off'],
'global-require': ['off'],
'import/no-dynamic-require': ['off'],
'import/no-extraneous-dependencies': ['error', {
devDependencies: true,
packageDir,
}],
'import/no-unresolved': ['off'],
'import/order': ['off'],
'import/prefer-default-export': ['off'],
'jsx-a11y/click-events-have-key-events': ['off'],
'jsx-a11y/label-has-associated-control': ['off'],
'jsx-a11y/label-has-for': ['off'],
'jsx-a11y/media-has-caption': ['off'],
'jsx-a11y/no-noninteractive-element-interactions': ['off'],
'lines-between-class-members': ['off'],
'no-await-in-loop': ['off'],
'no-param-reassign': ['off', { props: false }],
'no-underscore-dangle': ['off'],
'no-unneeded-ternary': ['error', {
defaultAssignment: true,
}],
'no-use-before-define': ['error', {
functions: false,
}],
'object-curly-newline': ['off'],
'prefer-arrow-callback': ['off', {
allowNamedFunctions: true,
}],
'prefer-template': ['off'],
quotes: ['off'],
'react/destructuring-assignment': ['off'],
'react/jsx-max-props-per-line': ['error', {
maximum: 2,
}],
'react/jsx-sort-props': ['error', {
reservedFirst: false,
}],
'react/no-danger': ['off'],
'react/no-unescaped-entities': ['off'],
'react/prop-types': ['off'],
'react/state-in-constructor': ['off'],
'sort-destructure-keys/sort-destructure-keys': 2,
'sort-keys': ['error'],
'typescript-sort-keys/interface': ['error', 'asc', {
caseSensitive: false,
}],
'typescript-sort-keys/string-enum': 2,
'wrap-iife': ['error', 'inside'],
},
};