forked from salesforce/design-system-react
/
.eslintrc
114 lines (112 loc) · 3.66 KB
/
.eslintrc
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
"extends": "eslint-config-airbnb",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true,
"impliedStrict": true,
"modules": true
}
},
"env": {
"browser": true
},
"rules": {
"import/no-unresolved": [2, { "ignore": ["^[~]"] }],
"arrow-parens": [1, "always"],
"import/extensions": "off",
"no-underscore-dangle": ["error", { "allowAfterThis": true }],
"comma-dangle": [2, "never"],
"id-length": [2, {
"min": 2,
"properties": "never",
"exceptions": ["$", "_", "e", "i", "j", "a", "b", "n"]
}],
"import/first": 0,
"import/no-extraneous-dependencies": 0,
"import/no-webpack-loader-syntax": 0,
"indent": [2, "tab", {
"SwitchCase": 1
}],
"func-names": 0,
"max-len": [1, 140, 4, {
"ignoreUrls": true,
"ignoreComments": true,
"ignorePattern": "^(\\s*)<([^\"{}();])+$"
}],
"no-bitwise": 0,
"no-case-declarations": 1,
"no-console": 1,
"no-multi-spaces": [1, {
// Object keys are Abstract Syntax Tree types
"exceptions": {
"VariableDeclarator": true,
"Property": true,
"ImportDeclaration": true,
"AssignmentExpression": true,
"JSXAttribute": true
}
}],
"no-param-reassign": [1, {
"props": false
}],
"no-plusplus": 0,
"no-tabs": 0,
"no-trailing-spaces": [2, {
"skipBlankLines": true
}],
"no-undef": 1,
"prefer-template": 1,
"space-before-function-paren": [2, "always"],
"vars-on-top": 1,
//
// eslint-plugin-react
// https://github.com/yannickcr/eslint-plugin-react
//
// Prevent missing displayName in a React component definition
"react/display-name": [1, {
"ignoreTranspilerName": true
}],
// Used to prevent usage of any, array, and object but may be too strict currently
"react/forbid-prop-types": 0,
"react/jsx-indent": [2, "tab"],
// indent props passed to React component
"react/jsx-indent-props": [1, "tab"],
// Enforce event handler naming conventions in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
"react/jsx-handler-names": [0, {
"eventHandlerPrefix": "_handle",
"eventHandlerPropPrefix": "on"
}],
// Disallow undeclared variables in JSX
"react/jsx-no-undef": 2,
// Prevent multiple component definition per file
"react/no-multi-comp": 0,
// Prevent usage of unknown DOM property
"react/no-unknown-property": 2,
// Can"t be used because it doesn"t currently recognize props used in functions
"react/no-unused-prop-types": 0,
// ES6 classes vs React"s createClass method - disabled while we consider migrating to classes
"react/prefer-es6-class": 0,
// Don"t enforce stateless React Components to be written as a pure function (for now)
"react/prefer-stateless-function": 0,
// Prevent missing props validation in a React component definition
"react/prop-types": 1,
// Don"t throw errors when explicit defaults aren"t set
"react/require-default-props": 0,
// Prevent sorting of props or propTypes
"react/sort-comp": 0,
// New rules temporarily disabled
"jsx-a11y/aria-activedescendant-has-tabindex": 0,
"jsx-a11y/interactive-supports-focus": 0,
"jsx-a11y/no-autofocus": 0,
"jsx-a11y/no-interactive-element-to-noninteractive-role": 0,
"jsx-a11y/no-noninteractive-element-interactions": 0,
"jsx-a11y/no-noninteractive-tabindex": 0,
"jsx-a11y/no-redundant-roles": 0,
"jsx-a11y/role-has-required-aria-props": 0
}
}