Skip to content

Commit 39744d8

Browse files
committed
diffs from running autofix
1 parent 89facb4 commit 39744d8

File tree

22 files changed

+648
-814
lines changed

22 files changed

+648
-814
lines changed

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ before_install:
1010
install:
1111
- 'if [ -n "${PACKAGE-}" ]; then cd "packages/${PACKAGE}"; fi'
1212
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
13-
- 'if [ -n "${ESLINT}" ]; then npm install --no-save "eslint@${ESLINT}"; fi'
14-
- 'if [ -n "${REACT_HOOKS}" ]; then npm install --no-save "eslint-plugin-react-hooks@${REACT_HOOKS}"; fi'
13+
- 'if [ -n "${ESLINT-}" ]; then npm install --no-save "eslint@${ESLINT}"; fi'
14+
- 'if [ -n "${REACT_HOOKS-}" ]; then npm install --no-save "eslint-plugin-react-hooks@${REACT_HOOKS}"; fi'
1515
script:
1616
- 'if [ -n "${PREPUBLISH-}" ]; then npm run pretravis && npm run prepublish && npm run posttravis; elif [ -n "${LINT-}" ]; then npm run lint; else npm run travis; fi'
1717
sudo: false
1818
env:
1919
matrix:
20-
- 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb-prettier'
2120
- 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb-base'
2221
- 'TEST=true ESLINT=6 PACKAGE=eslint-config-airbnb'
2322
- 'TEST=true ESLINT=6 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb'
24-
- 'TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-prettier'
2523
- 'TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb-base'
2624
- 'TEST=true ESLINT=5 PACKAGE=eslint-config-airbnb'
2725
- 'TEST=true ESLINT=5 REACT_HOOKS=1.7 PACKAGE=eslint-config-airbnb'

packages/eslint-config-airbnb-base/legacy.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,35 @@ module.exports = {
44
'./rules/errors',
55
'./rules/node',
66
'./rules/style',
7-
'./rules/variables'
7+
'./rules/variables',
88
].map(require.resolve),
99
env: {
1010
browser: true,
1111
node: true,
1212
amd: false,
1313
mocha: false,
14-
jasmine: false
14+
jasmine: false,
1515
},
1616
rules: {
1717
'comma-dangle': ['error', 'never'],
1818
'prefer-numeric-literals': 'off',
19-
'no-restricted-properties': ['error', {
20-
object: 'arguments',
21-
property: 'callee',
22-
message: 'arguments.callee is deprecated',
23-
}, {
24-
property: '__defineGetter__',
25-
message: 'Please use Object.defineProperty instead.',
26-
}, {
27-
property: '__defineSetter__',
28-
message: 'Please use Object.defineProperty instead.',
29-
}],
19+
'no-restricted-properties': [
20+
'error',
21+
{
22+
object: 'arguments',
23+
property: 'callee',
24+
message: 'arguments.callee is deprecated',
25+
},
26+
{
27+
property: '__defineGetter__',
28+
message: 'Please use Object.defineProperty instead.',
29+
},
30+
{
31+
property: '__defineSetter__',
32+
message: 'Please use Object.defineProperty instead.',
33+
},
34+
],
3035
'no-var': 'off',
3136
strict: ['error', 'safe'],
32-
}
37+
},
3338
};

packages/eslint-config-airbnb-base/rules/best-practices.js

Lines changed: 121 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ module.exports = {
1515

1616
// enforce that class methods use "this"
1717
// https://eslint.org/docs/rules/class-methods-use-this
18-
'class-methods-use-this': ['error', {
19-
exceptMethods: [],
20-
}],
18+
'class-methods-use-this': [
19+
'error',
20+
{
21+
exceptMethods: [],
22+
},
23+
],
2124

2225
// require return statements to either always or never specify values
2326
'consistent-return': 'error',
@@ -80,13 +83,12 @@ module.exports = {
8083

8184
// disallow empty functions, except for standalone funcs/arrows
8285
// https://eslint.org/docs/rules/no-empty-function
83-
'no-empty-function': ['error', {
84-
allow: [
85-
'arrowFunctions',
86-
'functions',
87-
'methods',
88-
]
89-
}],
86+
'no-empty-function': [
87+
'error',
88+
{
89+
allow: ['arrowFunctions', 'functions', 'methods'],
90+
},
91+
],
9092

9193
// disallow empty destructuring patterns
9294
// https://eslint.org/docs/rules/no-empty-pattern
@@ -122,12 +124,15 @@ module.exports = {
122124

123125
// disallow implicit type conversions
124126
// https://eslint.org/docs/rules/no-implicit-coercion
125-
'no-implicit-coercion': ['off', {
126-
boolean: false,
127-
number: true,
128-
string: true,
129-
allow: [],
130-
}],
127+
'no-implicit-coercion': [
128+
'off',
129+
{
130+
boolean: false,
131+
number: true,
132+
string: true,
133+
allow: [],
134+
},
135+
],
131136

132137
// disallow var and named functions in global scope
133138
// https://eslint.org/docs/rules/no-implicit-globals
@@ -153,17 +158,23 @@ module.exports = {
153158

154159
// disallow magic numbers
155160
// https://eslint.org/docs/rules/no-magic-numbers
156-
'no-magic-numbers': ['off', {
157-
ignore: [],
158-
ignoreArrayIndexes: true,
159-
enforceConst: true,
160-
detectObjects: false,
161-
}],
161+
'no-magic-numbers': [
162+
'off',
163+
{
164+
ignore: [],
165+
ignoreArrayIndexes: true,
166+
enforceConst: true,
167+
detectObjects: false,
168+
},
169+
],
162170

163171
// disallow use of multiple spaces
164-
'no-multi-spaces': ['error', {
165-
ignoreEOLComments: false,
166-
}],
172+
'no-multi-spaces': [
173+
'error',
174+
{
175+
ignoreEOLComments: false,
176+
},
177+
],
167178

168179
// disallow use of multiline strings
169180
'no-multi-str': 'error',
@@ -187,21 +198,24 @@ module.exports = {
187198
// disallow reassignment of function parameters
188199
// disallow parameter object manipulation except for specific exclusions
189200
// rule: https://eslint.org/docs/rules/no-param-reassign.html
190-
'no-param-reassign': ['error', {
191-
props: true,
192-
ignorePropertyModificationsFor: [
193-
'acc', // for reduce accumulators
194-
'accumulator', // for reduce accumulators
195-
'e', // for e.returnvalue
196-
'ctx', // for Koa routing
197-
'req', // for Express requests
198-
'request', // for Express requests
199-
'res', // for Express responses
200-
'response', // for Express responses
201-
'$scope', // for Angular 1 scopes
202-
'staticContext', // for ReactRouter context
203-
]
204-
}],
201+
'no-param-reassign': [
202+
'error',
203+
{
204+
props: true,
205+
ignorePropertyModificationsFor: [
206+
'acc', // for reduce accumulators
207+
'accumulator', // for reduce accumulators
208+
'e', // for e.returnvalue
209+
'ctx', // for Koa routing
210+
'req', // for Express requests
211+
'request', // for Express requests
212+
'res', // for Express responses
213+
'response', // for Express responses
214+
'$scope', // for Angular 1 scopes
215+
'staticContext', // for ReactRouter context
216+
],
217+
},
218+
],
205219

206220
// disallow usage of __proto__ property
207221
'no-proto': 'error',
@@ -211,45 +225,57 @@ module.exports = {
211225

212226
// disallow certain object properties
213227
// https://eslint.org/docs/rules/no-restricted-properties
214-
'no-restricted-properties': ['error', {
215-
object: 'arguments',
216-
property: 'callee',
217-
message: 'arguments.callee is deprecated',
218-
}, {
219-
object: 'global',
220-
property: 'isFinite',
221-
message: 'Please use Number.isFinite instead',
222-
}, {
223-
object: 'self',
224-
property: 'isFinite',
225-
message: 'Please use Number.isFinite instead',
226-
}, {
227-
object: 'window',
228-
property: 'isFinite',
229-
message: 'Please use Number.isFinite instead',
230-
}, {
231-
object: 'global',
232-
property: 'isNaN',
233-
message: 'Please use Number.isNaN instead',
234-
}, {
235-
object: 'self',
236-
property: 'isNaN',
237-
message: 'Please use Number.isNaN instead',
238-
}, {
239-
object: 'window',
240-
property: 'isNaN',
241-
message: 'Please use Number.isNaN instead',
242-
}, {
243-
property: '__defineGetter__',
244-
message: 'Please use Object.defineProperty instead.',
245-
}, {
246-
property: '__defineSetter__',
247-
message: 'Please use Object.defineProperty instead.',
248-
}, {
249-
object: 'Math',
250-
property: 'pow',
251-
message: 'Use the exponentiation operator (**) instead.',
252-
}],
228+
'no-restricted-properties': [
229+
'error',
230+
{
231+
object: 'arguments',
232+
property: 'callee',
233+
message: 'arguments.callee is deprecated',
234+
},
235+
{
236+
object: 'global',
237+
property: 'isFinite',
238+
message: 'Please use Number.isFinite instead',
239+
},
240+
{
241+
object: 'self',
242+
property: 'isFinite',
243+
message: 'Please use Number.isFinite instead',
244+
},
245+
{
246+
object: 'window',
247+
property: 'isFinite',
248+
message: 'Please use Number.isFinite instead',
249+
},
250+
{
251+
object: 'global',
252+
property: 'isNaN',
253+
message: 'Please use Number.isNaN instead',
254+
},
255+
{
256+
object: 'self',
257+
property: 'isNaN',
258+
message: 'Please use Number.isNaN instead',
259+
},
260+
{
261+
object: 'window',
262+
property: 'isNaN',
263+
message: 'Please use Number.isNaN instead',
264+
},
265+
{
266+
property: '__defineGetter__',
267+
message: 'Please use Object.defineProperty instead.',
268+
},
269+
{
270+
property: '__defineSetter__',
271+
message: 'Please use Object.defineProperty instead.',
272+
},
273+
{
274+
object: 'Math',
275+
property: 'pow',
276+
message: 'Use the exponentiation operator (**) instead.',
277+
},
278+
],
253279

254280
// disallow use of assignment in return statement
255281
'no-return-assign': ['error', 'always'],
@@ -262,9 +288,12 @@ module.exports = {
262288

263289
// disallow self assignment
264290
// https://eslint.org/docs/rules/no-self-assign
265-
'no-self-assign': ['error', {
266-
props: true,
267-
}],
291+
'no-self-assign': [
292+
'error',
293+
{
294+
props: true,
295+
},
296+
],
268297

269298
// disallow comparisons where both sides are exactly the same
270299
'no-self-compare': 'error',
@@ -280,11 +309,14 @@ module.exports = {
280309
'no-unmodified-loop-condition': 'off',
281310

282311
// disallow usage of expressions in statement position
283-
'no-unused-expressions': ['error', {
284-
allowShortCircuit: false,
285-
allowTernary: false,
286-
allowTaggedTemplates: false,
287-
}],
312+
'no-unused-expressions': [
313+
'error',
314+
{
315+
allowShortCircuit: false,
316+
allowTernary: false,
317+
allowTaggedTemplates: false,
318+
},
319+
],
288320

289321
// disallow unused labels
290322
// https://eslint.org/docs/rules/no-unused-labels
@@ -350,6 +382,6 @@ module.exports = {
350382
'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],
351383

352384
// require or disallow Yoda conditions
353-
yoda: 'error'
354-
}
385+
yoda: 'error',
386+
},
355387
};

packages/eslint-config-airbnb-base/rules/errors.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,17 @@ module.exports = {
6464

6565
// disallow unnecessary parentheses
6666
// https://eslint.org/docs/rules/no-extra-parens
67-
'no-extra-parens': ['off', 'all', {
68-
conditionalAssign: true,
69-
nestedBinaryExpressions: false,
70-
returnAssign: false,
71-
ignoreJSX: 'all', // delegate to eslint-plugin-react
72-
enforceForArrowConditionals: false,
73-
}],
67+
'no-extra-parens': [
68+
'off',
69+
'all',
70+
{
71+
conditionalAssign: true,
72+
nestedBinaryExpressions: false,
73+
returnAssign: false,
74+
ignoreJSX: 'all', // delegate to eslint-plugin-react
75+
enforceForArrowConditionals: false,
76+
},
77+
],
7478

7579
// disallow unnecessary semicolons
7680
'no-extra-semi': 'error',
@@ -150,5 +154,5 @@ module.exports = {
150154
// ensure that the results of typeof are compared against a valid string
151155
// https://eslint.org/docs/rules/valid-typeof
152156
'valid-typeof': ['error', { requireStringLiterals: true }],
153-
}
157+
},
154158
};

0 commit comments

Comments
 (0)