Skip to content

Commit 82d488f

Browse files
author
Edward Drapkin
committed
fix eslint errors
1 parent 69f06b3 commit 82d488f

File tree

4 files changed

+32
-26
lines changed

4 files changed

+32
-26
lines changed

src/extendReactClass.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ import {isObject} from './utils';
1414
export default (Component: Object, defaultStyles: Object, options: Object) => {
1515
const WrappedComponent = class extends Component {
1616
render () {
17-
let propsChanged = false,
17+
let propsChanged,
1818
styles;
1919

20+
propsChanged = false;
21+
2022
if (this.props.styles) {
2123
styles = this.props.styles;
2224
} else if (isObject(defaultStyles)) {

src/makeConfiguration.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ export default (userConfiguration = {}) => {
1515
errorWhenNotFound: true
1616
};
1717

18-
for(const name in userConfiguration) {
19-
const value = userConfiguration[name];
18+
for (const name in userConfiguration) {
19+
if (userConfiguration.hasOwnProperty(name)) {
20+
const value = userConfiguration[name];
2021

21-
if (!(name in configuration)) {
22-
throw new Error('Unknown configuration property "' + name + '".');
23-
}
22+
if (!(name in configuration)) {
23+
throw new Error('Unknown configuration property "' + name + '".');
24+
}
2425

25-
if (value !== true && value !== false) {
26-
throw new Error('"' + name + '" property value must be a boolean.');
27-
}
26+
if (value !== true && value !== false) {
27+
throw new Error('"' + name + '" property value must be a boolean.');
28+
}
2829

29-
configuration[name] = value;
30+
configuration[name] = value;
31+
}
3032
}
3133

3234
return configuration;

src/parseStyleName.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
const styleNameIndex = {};
21
import {trim, filterForTruthy} from './utils';
32

3+
const styleNameIndex = {};
4+
45
export default (styleNamePropertyValue: string, allowMultiple: boolean): Array<string> => {
56
let styleNames;
67

src/utils.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
export function isObject(obj) {
1+
export const isObject = function (obj) {
22
return obj === Object(obj);
3-
}
3+
};
44

5-
export function isFunction(func) {
5+
export const isFunction = function (func) {
66
return (
7-
Object.prototype.toString.call(func) === '[object Function]'
8-
|| Object.prototype.toString.call(func) === '[object GeneratorFunction]'
9-
);
10-
}
7+
Object.prototype.toString.call(func) === '[object Function]' ||
8+
Object.prototype.toString.call(func) === '[object GeneratorFunction]'
9+
);
10+
};
1111

12-
export function isArray(arr) {
12+
export const isArray = function (arr) {
1313
return Array.isArray ? Array.isArray(arr) : Object.prototype.toString.call(arr) === '[object Array]';
14-
}
14+
};
1515

16-
export function trim(str) {
16+
export const trim = function (str) {
1717
return String.prototype.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
18-
}
18+
};
1919

20-
export function filterForTruthy(arr) {
20+
export const filterForTruthy = function (arr) {
2121
const results = [];
22-
for(const key in arr) {
23-
if(arr[key]) {
22+
23+
for (const key in arr) {
24+
if (arr[key]) {
2425
results.push(arr[key]);
2526
}
2627
}
2728

2829
return results;
29-
}
30+
};

0 commit comments

Comments
 (0)