Skip to content

Commit 9d6ec1e

Browse files
authored
Update dependencies and linter (react-toolbox#1180)
1 parent bc18e56 commit 9d6ec1e

File tree

169 files changed

+3638
-3806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+3638
-3806
lines changed

.eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
**/node_modules/
22
**/build/
3+
docs/
4+
spec/
35
lib
6+
karma.conf.js
7+
gulpfile.js
8+
tests.webpack*
9+
server.js
10+
webpack*

.eslintrc

+21-218
Original file line numberDiff line numberDiff line change
@@ -1,227 +1,30 @@
11
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
24
"env": {
35
"browser": true,
46
"node": true,
5-
"mocha": true,
7+
"jest": true,
68
"es6": true
79
},
8-
9-
"ecmaFeatures": {
10-
"jsx": true,
11-
"templateStrings": true,
12-
"superInFunctions": false,
13-
"classes": true,
14-
"modules": true
15-
},
16-
17-
"parser": "babel-eslint",
18-
19-
"plugins": [
20-
"babel",
21-
"react"
22-
],
23-
2410
"rules": {
25-
"block-scoped-var": [0],
26-
"brace-style": [2, "1tbs", {
27-
"allowSingleLine": true
28-
}],
29-
"camelcase": [0],
30-
"comma-dangle": [2, "never"],
31-
"comma-spacing": [2],
32-
"comma-style": [2, "last"],
33-
"complexity": [0, 11],
34-
"constructor-super": [2],
35-
"consistent-return": [0],
36-
"consistent-this": [0, "that"],
37-
"curly": [2, "multi-line"],
38-
"default-case": [2],
39-
"dot-notation": [2, {
40-
"allowKeywords": true
41-
}],
42-
"eol-last": [2],
43-
"eqeqeq": [2],
44-
"func-names": [0],
45-
"func-style": [0, "declaration"],
46-
"generator-star-spacing": [2, "after"],
47-
"guard-for-in": [0],
48-
"handle-callback-err": [0],
49-
"key-spacing": [2, {
50-
"beforeColon": false,
51-
"afterColon": true
52-
}],
53-
"quotes": [2, "single", "avoid-escape"],
54-
"max-depth": [0, 4],
55-
"max-len": [0, 80, 4],
56-
"max-nested-callbacks": [0, 2],
57-
"max-params": [0, 3],
58-
"max-statements": [0, 10],
59-
"new-parens": [2],
60-
"new-cap": [0],
61-
"newline-after-var": [0],
62-
"no-alert": [2],
63-
"no-array-constructor": [2],
64-
"no-bitwise": [0],
65-
"no-caller": [2],
66-
"no-catch-shadow": [2],
67-
"no-cond-assign": [2],
68-
"no-console": [0],
69-
"no-constant-condition": [1],
70-
"no-continue": [2],
71-
"no-control-regex": [2],
72-
"no-debugger": [2],
73-
"no-delete-var": [2],
74-
"no-div-regex": [0],
75-
"no-dupe-args": [2],
76-
"no-dupe-keys": [2],
77-
"no-duplicate-case": [2],
78-
"no-else-return": [0],
79-
"no-empty": [2],
80-
"no-empty-character-class": [2],
81-
"no-eq-null": [0],
82-
"no-eval": [2],
83-
"no-ex-assign": [2],
84-
"no-extend-native": [1],
85-
"no-extra-bind": [2],
86-
"no-extra-boolean-cast": [2],
87-
"no-extra-parens": [0],
88-
"no-extra-semi": [1],
89-
"no-fallthrough": [2],
90-
"no-floating-decimal": [2],
91-
"no-func-assign": [2],
92-
"no-implied-eval": [2],
93-
"no-inline-comments": [0],
94-
"no-inner-declarations": [2, "functions"],
95-
"no-invalid-regexp": [2],
96-
"no-irregular-whitespace": [2],
97-
"no-iterator": [2],
98-
"no-label-var": [2],
99-
"no-labels": [2],
100-
"no-lone-blocks": [2],
101-
"no-lonely-if": [2],
102-
"no-loop-func": [2],
103-
"no-mixed-requires": [0, false],
104-
"no-mixed-spaces-and-tabs": [2, false],
105-
"no-multi-spaces": [2],
106-
"no-multi-str": [2],
107-
"no-multiple-empty-lines": [2, {
108-
"max": 2
109-
}],
110-
"no-native-reassign": [1],
111-
"no-negated-in-lhs": [2],
112-
"no-nested-ternary": [0],
113-
"no-new": [2],
114-
"no-new-func": [2],
115-
"no-new-object": [2],
116-
"no-new-require": [0],
117-
"no-new-wrappers": [2],
118-
"no-obj-calls": [2],
119-
"no-octal": [2],
120-
"no-octal-escape": [2],
121-
"no-path-concat": [0],
122-
"no-param-reassign": [2],
123-
"no-plusplus": [0],
124-
"no-process-env": [0],
125-
"no-process-exit": [2],
126-
"no-proto": [2],
127-
"no-redeclare": [2],
128-
"no-regex-spaces": [2],
129-
"no-reserved-keys": [0],
130-
"no-restricted-modules": [0],
131-
"no-return-assign": [2],
132-
"no-script-url": [2],
133-
"no-self-compare": [0],
134-
"no-sequences": [2],
135-
"no-shadow": [2],
136-
"no-shadow-restricted-names": [2],
137-
"semi-spacing": [2],
138-
"no-spaced-func": [2],
139-
"no-sparse-arrays": [2],
140-
"no-sync": [0],
141-
"no-ternary": [0],
142-
"no-this-before-super": [2],
143-
"no-throw-literal": [2],
144-
"no-trailing-spaces": [2],
145-
"no-undef": [2],
146-
"no-undef-init": [2],
147-
"no-undefined": [0],
148-
"no-underscore-dangle": [0],
149-
"no-unreachable": [2],
150-
"no-unused-expressions": [2, {
151-
"allowShortCircuit": true
152-
}],
153-
"no-unused-vars": [1, {
154-
"vars": "all",
155-
"args": "after-used"
156-
}],
157-
"no-use-before-define": [2, "nofunc"],
158-
"no-var": [2],
159-
"no-void": [0],
160-
"no-warning-comments": [0, {
161-
"terms": ["todo", "fixme", "xxx"],
162-
"location": "start"
163-
}],
164-
"no-with": [2],
165-
"object-shorthand": [2],
166-
"one-var": [0],
167-
"operator-assignment": [0, "always"],
168-
"operator-linebreak": [2, "before"],
169-
"padded-blocks": [0],
170-
"prefer-const": [2],
171-
"prefer-spread": [2],
172-
"quote-props": [0],
173-
"radix": [0],
174-
"semi": [2],
175-
"sort-vars": [0],
176-
"keyword-spacing": [2, {"after": true}],
177-
"space-before-function-paren": [2, { "anonymous": "always", "named": "always" }],
178-
"space-before-blocks": [0, "always"],
179-
"space-in-brackets": [0, "never", {
180-
"singleValue": true,
181-
"arraysInArrays": false,
182-
"arraysInObjects": false,
183-
"objectsInArrays": true,
184-
"objectsInObjects": true,
185-
"propertyName": false
186-
}],
187-
"space-in-parens": [2, "never"],
188-
"space-infix-ops": [2],
189-
"space-unary-ops": [2, {
190-
"words": true,
191-
"nonwords": false
192-
}],
193-
"spaced-line-comment": [0, "always"],
194-
"strict": [1],
195-
"use-isnan": [2],
196-
"valid-jsdoc": [0],
197-
"valid-typeof": [2],
198-
"vars-on-top": [0],
199-
"wrap-iife": [2],
200-
"wrap-regex": [2],
201-
"yoda": [2, "never", {
202-
"exceptRange": true
203-
}],
204-
"react/display-name": 0,
205-
"react/jsx-boolean-value": 1,
206-
"react/jsx-closing-bracket-location": 0,
207-
"react/jsx-curly-spacing": 1,
208-
"react/jsx-max-props-per-line": 0,
209-
"react/jsx-indent-props": 0,
210-
"react/jsx-no-duplicate-props": 1,
211-
"react/jsx-no-undef": 1,
212-
"react/jsx-pascal-case": 1,
213-
"react/sort-prop-types": 1,
214-
"react/jsx-sort-props": 0,
215-
"react/jsx-uses-react": 1,
216-
"react/jsx-uses-vars": 1,
217-
"react/no-danger": 0,
218-
"react/no-did-mount-set-state": 0,
219-
"react/no-did-update-set-state": 1,
220-
"react/no-multi-comp": 0,
221-
"react/no-unknown-property": 1,
222-
"react/prop-types": [2, {"ignore": ["onMouseDown", "onTouchStart"]}],
223-
"react/react-in-jsx-scope": 1,
224-
"react/self-closing-comp": 1,
225-
"react/sort-comp": 1
11+
"func-names": "off",
12+
"global-require": "off",
13+
"no-use-before-define": 0,
14+
"no-underscore-dangle": 0,
15+
"react/sort-prop-types": 2,
16+
"react/jsx-no-bind": 2,
17+
"react/require-default-props": 0,
18+
"react/no-find-dom-node": 0,
19+
"react/jsx-filename-extension": 0,
20+
"import/prefer-default-export": 0,
21+
"jsx-a11y/no-static-element-interactions": 0,
22+
"import/no-extraneous-dependencies": [
23+
"error", {
24+
"devDependencies": true,
25+
"optionalDependencies": false,
26+
"peerDependencies": false
27+
}
28+
]
22629
}
22730
}

components/app_bar/AppBar.js

+33-21
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { PropTypes } from 'react';
22
import classnames from 'classnames';
33
import { themr } from 'react-css-themr';
4-
import { APP_BAR } from '../identifiers.js';
5-
import InjectIconButton from '../button/IconButton.js';
4+
import { APP_BAR } from '../identifiers';
5+
import InjectIconButton from '../button/IconButton';
66

77
const factory = (IconButton) => {
88
class AppBar extends React.Component {
@@ -13,13 +13,13 @@ const factory = (IconButton) => {
1313
flat: PropTypes.bool,
1414
leftIcon: PropTypes.oneOfType([
1515
PropTypes.string,
16-
PropTypes.element
16+
PropTypes.element,
1717
]),
1818
onLeftIconClick: PropTypes.func,
1919
onRightIconClick: PropTypes.func,
2020
rightIcon: PropTypes.oneOfType([
2121
PropTypes.string,
22-
PropTypes.element
22+
PropTypes.element,
2323
]),
2424
scrollHide: PropTypes.bool,
2525
theme: PropTypes.shape({
@@ -30,27 +30,27 @@ const factory = (IconButton) => {
3030
leftIcon: PropTypes.string,
3131
rightIcon: PropTypes.string,
3232
scrollHide: PropTypes.string,
33-
title: PropTypes.string
33+
title: PropTypes.string,
3434
}),
35-
title: PropTypes.node
35+
title: PropTypes.node,
3636
};
3737

3838
static defaultProps = {
3939
className: '',
4040
fixed: false,
4141
flat: false,
42-
scrollHide: false
42+
scrollHide: false,
4343
};
4444

45-
state = {hidden: false, height: 0};
45+
state = { hidden: false, height: 0 };
4646

47-
componentDidMount () {
47+
componentDidMount() {
4848
if (this.props.scrollHide) {
4949
this.initializeScroll();
5050
}
5151
}
5252

53-
componentWillReceiveProps (nextProps) {
53+
componentWillReceiveProps(nextProps) {
5454
if (!this.props.scrollHide && nextProps.scrollHide) {
5555
this.initializeScroll();
5656
}
@@ -60,7 +60,7 @@ const factory = (IconButton) => {
6060
}
6161
}
6262

63-
componentWillUnmount () {
63+
componentWillUnmount() {
6464
if (this.props.scrollHide) {
6565
this.endScroll();
6666
}
@@ -70,7 +70,7 @@ const factory = (IconButton) => {
7070
window.addEventListener('scroll', this.handleScroll);
7171
const { height } = this.rootNode.getBoundingClientRect();
7272
this.curScroll = window.scrollY;
73-
this.setState({height});
73+
this.setState({ height });
7474
};
7575

7676
endScroll = () => {
@@ -79,39 +79,51 @@ const factory = (IconButton) => {
7979

8080
handleScroll = () => {
8181
const scrollDiff = this.curScroll - window.scrollY;
82-
const hidden = scrollDiff < 0 && window.scrollY !== undefined && window.scrollY > this.state.height;
83-
this.setState({hidden});
82+
const hidden = scrollDiff < 0
83+
&& window.scrollY !== undefined
84+
&& window.scrollY > this.state.height;
85+
this.setState({ hidden });
8486
this.curScroll = window.scrollY;
8587
};
8688

87-
render () {
88-
const { children, leftIcon, onLeftIconClick, onRightIconClick, rightIcon, theme, title } = this.props;
89+
render() {
90+
const {
91+
children,
92+
leftIcon,
93+
onLeftIconClick,
94+
onRightIconClick,
95+
rightIcon,
96+
theme,
97+
title,
98+
} = this.props;
8999
const className = classnames(theme.appBar, {
90100
[theme.fixed]: this.props.fixed,
91101
[theme.flat]: this.props.flat,
92-
[theme.scrollHide]: this.state.hidden
102+
[theme.scrollHide]: this.state.hidden,
93103
}, this.props.className);
94104

95105
return (
96106
<header
97107
className={className}
98-
data-react-toolbox='app-bar'
99-
ref={node => {this.rootNode = node;}}
108+
data-react-toolbox="app-bar"
109+
ref={(node) => { this.rootNode = node; }}
100110
>
101111
<div className={theme.inner}>
102112
{leftIcon && <IconButton
103113
inverse
104114
className={classnames(theme.leftIcon)}
105115
onClick={onLeftIconClick}
106-
icon={leftIcon} />
116+
icon={leftIcon}
117+
/>
107118
}
108119
{title && <h1 className={classnames(theme.title)}>{title}</h1>}
109120
{children}
110121
{rightIcon && <IconButton
111122
inverse
112123
className={classnames(theme.rightIcon)}
113124
onClick={onRightIconClick}
114-
icon={rightIcon} />
125+
icon={rightIcon}
126+
/>
115127
}
116128
</div>
117129
</header>

0 commit comments

Comments
 (0)