-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
95 lines (94 loc) · 2.69 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
module.exports = {
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
overrides: [
{
files: ['src/**/*.js', 'src/**/*.jsx', 'src/**/*.ts', 'src/**/*.tsx'],
parser: '@typescript-eslint/parser',
extends: [
'@react-native-community',
'airbnb',
'eslint:recommended',
'plugin:react/recommended',
'prettier',
],
plugins: ['react', 'react-hooks', 'import', 'jsx-a11y', 'prettier', '@typescript-eslint'],
env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
mocha: true
},
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true
},
sourceType: 'module'
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
map: [
['@core', './src/core'],
['@libraries', './src/libraries'],
["@assets", "./assets"]
]
}
}
},
rules: {
'prettier/prettier': 'warn',
'react/jsx-props-no-spreading': 'off',
'react/jsx-filename-extension': 'error',
'react/jsx-wrap-multilines': ['error', { declaration: false, assignment: false }],
'react/function-component-definition': [2, { namedComponents: 'arrow-function' }],
'arrow-body-style': ['error', 'as-needed'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'react/prop-types': 'off',
'react/require-default-props': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never'
}
],
}
},
{
files: ['src/**/*.ts', 'src/**/*.tsx'],
rules: {
'react/jsx-filename-extension': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
"import/no-unresolved": "off"
},
globals: {
JSX: true
}
}
// Eslint for test case env
// {
// files: ['**/*.test.js'],
// extends: ['airbnb', 'prettier', 'plugin:jest/recommended'],
// plugins: ['prettier', 'jest'],
// env: {
// commonjs: true,
// es6: true,
// node: true,
// jest: true,
// },
// },
]
};