This repository has been archived by the owner on Jun 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
.eslintrc.js
74 lines (72 loc) · 2.15 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
const OFF = 0;
const WARN = 1;
const ERROR = 2;
module.exports = {
root: true, // stop ESLint from looking for a configuration file in parent folders
extends: ['@kiwicom/eslint-config'],
parser: 'babel-eslint',
env: {
es6: true,
jest: true,
node: true,
browser: true,
},
rules: {
'react/sort-comp': ERROR,
'no-unused-vars': [ERROR, { args: 'after-used' }],
'no-restricted-imports': [
ERROR,
{
paths: [
{
name: 'react-relay',
message: 'Please use @kiwicom/margarita-relay package instead.',
},
{
name: 'graphql-relay',
importNames: [
'connectionArgs',
'connectionDefinitions',
'connectionFromArray',
'connectionFromArraySlice',
'connectionFromPromisedArray',
'connectionFromPromisedArraySlice',
],
message:
"please import { connectionFromArray } from '@kiwicom/graphql-utiles' instead",
},
{
name: 'react-native',
importNames: [
'StyleSheet',
'Text',
'TouchableHighlight',
'TouchableNativeFeedback',
'TouchableOpacity',
'TouchableWithoutFeedback',
'Button',
],
message:
'Please use @kiwicom/universal-components instead, and @kiwicom/margarita-components for TouchableWithoutFeedback and Text',
},
{
name: 'react-navigation',
importNames: ['withNavigation'],
message: 'Please use @kiwicom/margarita-navigation',
},
{
name: 'react-native-shimmer-placeholder',
message: 'Please use Shimmer from @kiwicom/margarita-components',
},
],
},
],
},
// set each global variable name equal to true to allow the variable to be overwritten or
// false to disallow overwriting
globals: {
fetch: false, // already by default in RN
FormData: false, // already by default in RN
__DEV__: false, // already by default in RN
},
};