-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
76 lines (74 loc) · 1.86 KB
/
eslint.config.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
import upleveled from 'eslint-config-upleveled';
/** @type
* {import('@typescript-eslint/utils/ts-eslint').FlatConfig.ConfigArray}
* */
const config = [
...upleveled,
{
rules: {
// Copied from UpLeveled ESLint config
'@typescript-eslint/naming-convention': [
'warn',
// Allow PascalCase for React Navigation's Stack variable
// (object) from the `createStackNavigator` function
// https://github.com/typescript-eslint/typescript-eslint/issues/2149#issuecomment-1315578975
{
selector: 'variable',
format: ['camelCase', 'PascalCase'],
filter: {
regex: '^Stack$',
match: true,
},
},
{
selector: 'variable',
types: ['boolean', 'string', 'number', 'array'],
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'function',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: 'variable',
types: ['function'],
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: 'property',
format: null,
},
{
selector: 'parameter',
format: ['camelCase', 'snake_case', 'PascalCase'],
},
],
'react/style-prop-object': [
'warn',
{
allow: ['StatusBar'],
},
],
},
},
{
files: ['e2e/**/*.ts'],
languageOptions: {
globals: {
describe: 'readonly',
beforeAll: 'readonly',
beforeEach: 'readonly',
it: 'readonly',
},
},
},
];
export default config;