Skip to content

Commit 68729e2

Browse files
committed
Update style config and fix linting
1 parent 9738652 commit 68729e2

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"react/forbid-prop-types": 0,
1414
"react/sort-comp": 0,
1515
"jsx-a11y/no-static-element-interactions": 0,
16-
"import/no-extraneous-dependencies": 0
16+
"import/no-extraneous-dependencies": ["error", {
17+
"devDependencies": ["**/__tests__/*-test.js"],
18+
"optionalDependencies": false
19+
}]
1720
}
1821
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"cross-env": "^3.0.0",
5454
"enzyme": "^2.3.0",
5555
"eslint": "^3.5.0",
56-
"eslint-config-airbnb": "^11.0.0",
56+
"eslint-config-airbnb": "^12.0.0",
5757
"eslint-plugin-import": "^1.8.0",
5858
"eslint-plugin-jsx-a11y": "^2.2.2",
5959
"eslint-plugin-react": "^6.2.1",

src/components/Tabs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class Tabs extends Component {
3939

4040
constructor(props) {
4141
super(props);
42-
this.state = this.copyPropsToState(this.props, this.state);
42+
this.state = Tabs.copyPropsToState(this.props, this.state);
4343
}
4444

4545
getChildContext() {
@@ -52,7 +52,7 @@ export default class Tabs extends Component {
5252
// Use a transactional update to prevent race conditions
5353
// when reading the state in copyPropsToState
5454
// See https://github.com/reactjs/react-tabs/issues/51
55-
this.setState(state => this.copyPropsToState(newProps, state));
55+
this.setState(state => Tabs.copyPropsToState(newProps, state));
5656
}
5757

5858
setSelected(index, focus) {
@@ -257,7 +257,7 @@ export default class Tabs extends Component {
257257
};
258258

259259
// This is an anti-pattern, so sue me
260-
copyPropsToState(props, state) {
260+
static copyPropsToState(props, state) {
261261
let selectedIndex = props.selectedIndex;
262262

263263
// If no selectedIndex prop was supplied, then try

src/components/__tests__/Tabs-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ describe('react-tabs', () => {
190190
it('should not clone non tabs element', () => {
191191
class Demo extends React.Component {
192192
render() {
193-
const plus = <div ref="yolo">+</div>;
193+
const plus = <div ref="yolo">+</div>; // eslint-disable-line react/no-string-refs
194194

195195
return (<Tabs>
196196
<TabList>

0 commit comments

Comments
 (0)