Skip to content

Commit 89ca255

Browse files
committed
Update Eslint
1 parent a902e0e commit 89ca255

12 files changed

Lines changed: 30 additions & 44 deletions

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: '@case/eslint-config' }

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"object-assign": "^4.1.0"
2020
},
2121
"devDependencies": {
22+
"@case/eslint-config": "^0.1.4",
2223
"babel": "^6.0.15",
2324
"babel-core": "^6.1.2",
2425
"babel-eslint": "^6.1.2",

src/autoprefix.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict'
2-
31
import map from 'lodash/map'
42
import objectAssign from 'object-assign'
53

src/deprecated/Component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict' /* eslint-disable */
1+
/* eslint-disable no-console */
22

33
import React from 'react'
44
import inline from './inline'

src/deprecated/check-class-structure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable */
1+
/* eslint-disable no-prototype-builtins, no-console */
22

33
import map from 'lodash/map'
44
import isObject from 'lodash/isObject'

src/deprecated/combine.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict' /* eslint-disable */
2-
31
import merge from './merge'
42
import mixins from './transform-mixins'
53

src/deprecated/inline.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict' /* eslint-disable */
1+
/* eslint-disable no-console, guard-for-in, no-restricted-syntax, no-plusplus, func-names */
22

33
import isObject from 'lodash/isObject'
44
import checkClassStructure from './check-class-structure'
@@ -11,7 +11,6 @@ import combine from './combine'
1111
*/
1212

1313
module.exports = function (declaredClasses) {
14-
1514
const arrayOfStyles = []
1615

1716
if (!this.classes) {
@@ -31,10 +30,9 @@ module.exports = function (declaredClasses) {
3130

3231
activateClass('default')
3332

34-
for (var prop in this.props) {
35-
let value = this.props[prop]
33+
for (const prop in this.props) {
34+
const value = this.props[prop]
3635
if (!isObject(value)) {
37-
3836
if (value === true) {
3937
activateClass(prop)
4038
activateClass(`${ prop }-true`)
@@ -43,22 +41,21 @@ module.exports = function (declaredClasses) {
4341
} else {
4442
activateClass(`${ prop }-false`)
4543
}
46-
4744
}
4845
}
4946

5047
// React Bounds
5148
// http://casesandberg.github.io/react-bounds/
5249
// Activate classes that match active bounds
5350
if (this.props && this.props.activeBounds) {
54-
for (var i = 0; i < this.props.activeBounds.length; i++) {
55-
var boundName = this.props.activeBounds[i]
51+
for (let i = 0; i < this.props.activeBounds.length; i++) {
52+
const boundName = this.props.activeBounds[i]
5653
activateClass(boundName)
5754
}
5855
}
5956

60-
for (var name in declaredClasses) {
61-
let condition = declaredClasses[name]
57+
for (const name in declaredClasses) {
58+
const condition = declaredClasses[name]
6259

6360
if (condition === true) {
6461
activateClass(name, { warn: true })

src/deprecated/merge.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict' /* eslint-disable */
2-
31
import mrg from 'merge'
42
import isObject from 'lodash/isObject'
53

src/deprecated/transform-mixins.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict' /* eslint-disable */
1+
/* eslint-disable consistent-return, guard-for-in, no-restricted-syntax, no-lonely-if */
22

33
import isObject from 'lodash/isObject'
44
import merge from 'merge'
@@ -9,7 +9,7 @@ import merge from 'merge'
99
*/
1010

1111
const localProps = {
12-
borderRadius: value => {
12+
borderRadius: (value) => {
1313
if (value !== null) {
1414
return {
1515
msBorderRadius: value,
@@ -21,7 +21,7 @@ const localProps = {
2121
}
2222
},
2323

24-
boxShadow: value => {
24+
boxShadow: (value) => {
2525
if (value !== null) {
2626
return {
2727
msBoxShadow: value,
@@ -33,7 +33,7 @@ const localProps = {
3333
}
3434
},
3535

36-
userSelect: value => {
36+
userSelect: (value) => {
3737
if (value !== null) {
3838
return {
3939
WebkitTouchCallout: value,
@@ -46,7 +46,7 @@ const localProps = {
4646
}
4747
},
4848

49-
flex: value => {
49+
flex: (value) => {
5050
if (value !== null) {
5151
return {
5252
WebkitBoxFlex: value,
@@ -58,7 +58,7 @@ const localProps = {
5858
}
5959
},
6060

61-
flexBasis: value => {
61+
flexBasis: (value) => {
6262
if (value !== null) {
6363
return {
6464
WebkitFlexBasis: value,
@@ -67,7 +67,7 @@ const localProps = {
6767
}
6868
},
6969

70-
justifyContent: value => {
70+
justifyContent: (value) => {
7171
if (value !== null) {
7272
return {
7373
WebkitJustifyContent: value,
@@ -76,7 +76,7 @@ const localProps = {
7676
}
7777
},
7878

79-
transition: value => {
79+
transition: (value) => {
8080
if (value !== null) {
8181
return {
8282
msTransition: value,
@@ -88,7 +88,7 @@ const localProps = {
8888
}
8989
},
9090

91-
transform: value => {
91+
transform: (value) => {
9292
if (value !== null) {
9393
return {
9494
msTransform: value,
@@ -100,7 +100,7 @@ const localProps = {
100100
}
101101
},
102102

103-
Absolute: value => {
103+
Absolute: (value) => {
104104
if (value !== null) {
105105
const direction = value.split(' ')
106106
return {
@@ -123,12 +123,11 @@ const localProps = {
123123
}
124124

125125
const transform = (styleObject, customFuncs, parent) => {
126-
127126
const customProps = merge(customFuncs, localProps)
128127
const obj = {}
129128

130-
for (var key in styleObject) {
131-
var value = styleObject[key]
129+
for (const key in styleObject) {
130+
const value = styleObject[key]
132131

133132
// If its an object
134133
if (isObject(value) && !Array.isArray(value)) {
@@ -138,9 +137,9 @@ const transform = (styleObject, customFuncs, parent) => {
138137
// Check to see if a custom prop exists for it
139138
if (customProps[key]) {
140139
// let loop though and save the results from the function
141-
var customResults = customProps[key](value, parent)
142-
for (var customKey in customResults) {
143-
var customValue = customResults[customKey]
140+
const customResults = customProps[key](value, parent)
141+
for (const customKey in customResults) {
142+
const customValue = customResults[customKey]
144143
obj[customKey] = customValue
145144
}
146145
} else {

src/flattenNames.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict'
2-
31
import map from 'lodash/map'
42
import isPlainObject from 'lodash/isPlainObject'
53
import isString from 'lodash/isString'
@@ -8,7 +6,7 @@ export const flattenNames = (things) => {
86
const names = []
97

108
things.map((thing) => {
11-
Array.isArray(thing) && flattenNames(thing).map((name) => names.push(name))
9+
Array.isArray(thing) && flattenNames(thing).map(name => names.push(name))
1210
isPlainObject(thing) && map(thing, (value, key) => {
1311
value === true && names.push(key)
1412
names.push(`${ key }-${ value }`)

0 commit comments

Comments
 (0)