forked from usds/us-forms-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
107 lines (103 loc) · 3.83 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
{
// All rules should be disabled or they should produce errors. No warnings.
"extends": ["airbnb", "plugin:jsx-a11y/recommended"],
"parser": "babel-eslint",
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"mocha": true
},
"globals": {
"__BUILDTYPE__": true
},
"plugins": ["jsx-a11y", "chai-expect"],
"rules": {
// Override airbnb style.
"arrow-body-style": 0, // Leave bracing to code reviewer discretion.
"camelcase": [2, { "properties": "always" }],
"comma-dangle": 0, // Dangling commas are wonderful. It's JSON that's stupid.
"func-names": 2,
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
"no-negated-condition": 0, // Sometimes negated conditions are easier to understand.
"no-unused-vars": [2, { "args": "after-used", "argsIgnorePattern": "^_", "vars": "local" }],
"prefer-rest-params": 2,
"quote-props": [2, "as-needed", { "keywords": true }],
"space-unary-ops": 2,
"max-len": [2, 250], // TODO: make smaller
"arrow-parens": 0, // We don't have an agreed upon pattern here
"no-plusplus": 0,
"no-underscore-dangle": 0,
"import/no-extraneous-dependencies": 0,
// Plugins
"chai-expect/missing-assertion": 2,
"chai-expect/terminating-properties": 2,
// Disabled rules with rationale.
"react/no-multi-comp": 0, // Leave organization to code reviewer discretion.
"react/prefer-stateless-function": 0, // Leave statelessness to code reviewer discretion.
"react/jsx-closing-bracket-location": [2, "after-props"],
"react/jsx-equals-spacing": 2,
"react/jsx-key": 2,
"react/jsx-pascal-case": 2,
"react/sort-prop-types": [0, { "callbacksLast": true, "requiredFirst": true }], // TODO(awong): Too hard to turn on.
"react/jsx-sort-props": [0, { "callbacksLast": true, "shorthandFirst": true }], // TODO(awong): Too hard to turn on.
"react/jsx-no-duplicate-props": 2,
"react/no-danger": 2,
"react/no-deprecated": 2,
"react/no-direct-mutation-state": 2,
"react/prop-types": 0, // TODO(awong): Enable.
"react/jsx-tag-spacing": [2, { "beforeSelfClosing": "never" }],
// this is the airbnb default, minus for..of
"no-restricted-syntax": [
2,
"error",
{
"selector": "ForInStatement",
"message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array."
},
{
"selector": "LabeledStatement",
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
},
{
"selector": "WithStatement",
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
}
],
// TODO: evaluate and potentially turn these rules back on
"jsx-a11y/no-onchange": 0, // possibly bad advice? https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/398
"import/extensions": 0,
"import/first": 0,
"react/require-default-props": 0,
"block-spacing": 0,
"class-methods-use-this": 0,
"import/no-named-as-default": 0,
"react/forbid-prop-types": 0,
"react/self-closing-comp": 0,
"no-mixed-operators": 0,
"react/jsx-first-prop-new-line": 0,
"react/jsx-max-props-per-line": 0,
"react/no-array-index-key": 0,
"react/no-unused-prop-types": 0,
"no-multi-spaces": 0,
"no-undef-init": 0,
"padded-blocks": 0,
"import/prefer-default-export": 0,
"global-require": 0,
"no-lonely-if": 0,
"lines-around-directive": 0
},
"overrides": [
{
"files": ["**/*.spec.jsx", "**/*.spec.js"],
"rules": {
"react/no-find-dom-node": 0,
"no-unused-expressions": 0
}
}
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
}
}