-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy path.eslintrc.js
65 lines (64 loc) · 1.72 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
const error = 2;
const warn = 1;
const off = 0;
module.exports = {
root: true,
extends: ['airbnb', 'plugin:jest/recommended', 'prettier', 'prettier/react'],
env: {
es6: true,
node: true,
'jest/globals': true,
},
settings: {
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
},
rules: {
'react/jsx-filename-extension': off,
'react/react-in-jsx-scope': off,
'react/require-default-props': warn,
},
overrides: [
{
files: ['./examples/**'],
env: {
browser: true,
},
},
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier/@typescript-eslint',
'plugin:import/typescript',
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './{packages,examples}/**/tsconfig.json',
},
rules: {
'@typescript-eslint/no-floating-promises': warn,
'@typescript-eslint/no-unsafe-assignment': warn,
'@typescript-eslint/no-unsafe-call': warn,
'@typescript-eslint/no-unsafe-member-access': warn,
'@typescript-eslint/prefer-regexp-exec': warn,
'import/extensions': off,
'import/no-default-export': error,
'import/prefer-default-export': off,
'no-use-before-define': warn,
'react/require-default-props': off,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
ts: {
directory: './{packages,examples}/*/tsconfig.json',
},
},
},
},
],
};