-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.js
More file actions
69 lines (69 loc) · 2.1 KB
/
eslint.js
File metadata and controls
69 lines (69 loc) · 2.1 KB
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
module.exports = {
env: {
commonjs: true,
es6: true,
jest: true,
mocha: true
},
extends: ["airbnb", "prettier", "prettier/react"],
parser: "babel-eslint",
plugins: [
"fp",
"prettier",
"react",
"react-native",
"transform-class-properties"
],
presets: ["flow", "stage-2"],
rules: {
// Soft some rules.
"global-require": 0, // Used by webpack-isomorphic-tools and React Native.
"import/first": 0, // Sorts by atom/sort-lines natural order.
"no-use-before-define": 0, // It's nice to have styles on the botom.
"import/no-duplicates": 2,
"no-undef": 0,
singleQuote: true,
"import/prefer-default-export": 0, // No. Actions can have just one action.
"no-class-assign": 0, // Class assign is used for higher order components.
"no-confusing-arrow": 0, // This rule is super confusing.
"no-duplicate-imports": 0, // github.com/babel/eslint-plugin-babel/issues/59#issuecomment-230118848
"no-nested-ternary": 0, // It's nice for JSX.
"no-param-reassign": 0, // We love param reassignment. Naming is hard.
"no-shadow": 0, // Shadowing is a nice language feature. Naming is hard.
"no-underscore-dangle": 0,
"import/extensions": [2, { js: "never", json: "always" }],
"react/jsx-filename-extension": 0, // No, JSX belongs to .js files
"jsx-a11y/href-no-hash": "off",
"sort-keys": 2,
// React Native.
"react-native/no-color-literals": 2,
"react-native/no-unused-styles": 2,
"react-native/split-platform-components": 2,
// Rules for functional programming. We do not need Object.freeze.
"fp/no-mutating-assign": 2,
"fp/no-mutating-methods": 2,
"fp/no-mutation": [
"error",
{
commonjs: true,
allowThis: true,
exceptions: [
{ property: "propTypes" },
{ property: "navigationOptions" }
]
}
],
// Prettier.
"prettier/prettier": [
"error",
{
bracketSpacing: true,
printWidth: 80,
singleQuote: true,
tabWidth: 2,
parser: "flow",
trailingComma: "all"
}
]
}
};