-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
90 lines (90 loc) · 2.46 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
module.exports = {
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.android.js', '.ios.js'],
},
},
'import/core-modules': ['react', 'react-native'],
},
parser: 'babel-eslint',
env: {
node: true,
es6: true,
},
globals: {
fetch: true,
__DEV__: true,
FormData: true,
},
extends: [
'plugin:react/recommended',
'plugin:flowtype/recommended',
'airbnb',
'prettier',
'prettier/flowtype',
'prettier/react',
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
impliedStrict: false,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
},
plugins: ['jsx-a11y', 'flowtype', 'react', 'react-native'],
rules: {
'no-undef': 0,
'react/no-unused-prop-types': 0,
'react-native/no-unused-styles': 1,
'react-native/split-platform-components': 2,
'jsx-quotes': ['error', 'prefer-double'],
'jsx-a11y/label-has-for': 2,
'jsx-a11y/mouse-events-have-key-events': 2,
'jsx-a11y/role-has-required-aria-props': 2,
'jsx-a11y/role-supports-aria-props': 2,
'jsx-a11y/aria-props': 2,
'react/display-name': 1,
'react/jsx-boolean-value': 0,
'react/jsx-no-undef': 2,
'react/jsx-sort-prop-types': 0,
'react/jsx-sort-props': 0,
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1,
'react/no-did-mount-set-state': 1,
'react/no-did-update-set-state': 1,
'react/no-unknown-property': 1,
'react/prop-types': 1,
'react/default-props-match-prop-types': 0,
'react/react-in-jsx-scope': 1,
'react/self-closing-comp': 1,
'react/sort-comp': 0,
'react/jsx-wrap-multilines': 1,
'react/jsx-filename-extension': 0, // disabled because react native doesnt like .jsx
'arrow-parens': 0,
'new-cap': [
'error',
{
newIsCap: true,
capIsNewExceptions: [
'Color',
'TouchableNativeFeedback.SelectableBackground',
],
},
],
indent: ['warn', 2],
'linebreak-style': ['warn', 'unix'],
quotes: ['warn', 'single'],
semi: ['warn', 'always'],
'comma-dangle': ['warn', 'always-multiline'],
'no-unused-vars': 1,
'no-use-before-define': 0,
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-mixed-operators': 0,
'class-methods-use-this': 0,
'react/forbid-prop-types': 0, // replace with 1 for very strict type checks
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
},
};