-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
69 lines (69 loc) · 1.83 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
module.exports = {
plugins: ['prettier', 'react', 'import'],
root: true,
env: {
browser: true, // Browser global variables like `window` etc.
commonjs: true, // CommonJS global variables and CommonJS scoping.Allows require, exports and module.
es6: true, // Enable all ECMAScript 6 features except for modules.
jest: true, // Jest global variables like `it` etc.
node: true, // Defines things like process.env when generating through node
},
extends: [
'airbnb-typescript',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
],
settings: {
react: {
version: 'detect', // Detect react version
},
},
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
warnOnUnsupportedTypeScriptVersion: false,
},
ignorePatterns: ['/*.*'],
rules: {
'prettier/prettier': 'error',
'no-underscore-dangle': 0,
'no-param-reassign': 0,
'no-restricted-syntax': 0,
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase'],
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'variable',
modifiers: ['global', 'const'],
types: ['boolean', 'number', 'string', 'array'],
format: ['UPPER_CASE'],
},
{
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'require',
},
],
},
overrides: [
{
files: ['*.test.tsx', '**/TestUtils.ts', 'src/lib/remoteService.ts'],
rules: {
'no-await-in-loop': 0,
'@typescript-eslint/no-explicit-any': 0,
'import/no-extraneous-dependencies': 0,
},
},
],
};