-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnative.js
56 lines (52 loc) · 1.59 KB
/
native.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
const react = require('./react')
const extendsList = [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react-native/all',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:sonarjs/recommended',
'plugin:prettier/recommended',
'prettier',
]
const reactNativeRules = {
'react-native/no-color-literals': 0,
'react-native/no-raw-text': 0,
}
const overrides = react.overrides.map((override) => ({
...override,
extends: override.files[0].includes('*.js')
? override.files[0].includes('test')
? [
...extendsList.filter(
(extendEntry) => !extendEntry.includes('typescript'),
),
'plugin:testing-library/react',
'plugin:jest/recommended',
'plugin:jest/style',
]
: extendsList.filter(
(extendEntry) => !extendEntry.includes('typescript'),
)
: override.files[0].includes('test')
? [
...extendsList,
'plugin:testing-library/react',
'plugin:jest/recommended',
'plugin:jest/style',
]
: extendsList,
rules: {
...override.rules,
...reactNativeRules,
},
}))
module.exports = {
...react,
env: { 'es2021': true, 'react-native/react-native': true, 'node': true },
overrides,
}