-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
64 lines (61 loc) · 2.64 KB
/
index.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
'use strict';
module.exports = {
plugins: [
'react',
'jsx-a11y'
],
extends: [
'vast',
'plugin:react/recommended'
],
rules: {
// React rules
'react/display-name': 0, // this overrides plugin:react/recommended
'react/forbid-component-props': 2, // set to 2 for now, switch to 1 if needed
'react/no-children-prop': 2,
'react/no-did-update-set-state': 2,
'react/no-danger': 1, // see https://github.com/zeit/hyper/issues/730#issuecomment-249379034 and https://github.com/eslint/eslint/issues/7030
'react/no-danger-with-children': 2,
'react/no-direct-mutation-state': 2,
'react/no-string-refs': 2,
'react/no-unescaped-entities': 2,
'react/no-unused-prop-types': [1, { customValidators: [], skipShapeProps: true }], // disable this if it returns false positives
'react/prop-types': 1, // overrides plugin:react/recommended, only warn for now, we should probably set this to default (2)
'react/style-prop-object': 2,
// JSX rules
'react/jsx-boolean-value': 2,
'react/jsx-closing-bracket-location': [2, 'after-props'],
'react/jsx-curly-spacing': [2, 'never'],
'react/jsx-equals-spacing': [2, 'never'],
'react/jsx-handler-names': 2,
'react/jsx-no-bind': [2, { ignoreRefs: true, allowArrowFunctions: true, allowBind: false }],
'react/jsx-no-comment-textnodes': 2,
'react/jsx-no-duplicate-props': [2, { ignoreCase: true }], // overrides plugin:react/recommended
'react/jsx-no-target-blank': 2,
'react/jsx-pascal-case': 2,
'react/jsx-space-before-closing': 2,
'react/jsx-wrap-multilines': 2,
// Accessibility rules
'jsx-a11y/anchor-has-content': 2,
'jsx-a11y/aria-props': 2,
'jsx-a11y/aria-proptypes': 2,
'jsx-a11y/aria-role': 2,
'jsx-a11y/aria-unsupported-elements': 2,
'jsx-a11y/heading-has-content': 2,
'jsx-a11y/href-no-hash': 1,
'jsx-a11y/html-has-lang': 2,
'jsx-a11y/img-has-alt': 2,
'jsx-a11y/img-redundant-alt': 1,
'jsx-a11y/label-has-for': 2, // this can report false positives - wrapping labels don't need `for`
'jsx-a11y/lang': 2,
'jsx-a11y/mouse-events-have-key-events': 1,
'jsx-a11y/no-access-key': 2,
'jsx-a11y/no-onchange': 1,
'jsx-a11y/no-static-element-interactions': 1,
'jsx-a11y/onclick-has-focus': 1,
'jsx-a11y/onclick-has-role': 1,
'jsx-a11y/role-has-required-aria-props': 2,
'jsx-a11y/role-supports-aria-props': 2,
'jsx-a11y/tabindex-no-positive': 2
}
};