Skip to content

Commit 44f3562

Browse files
author
tsuyoshiwada
committed
Remove lint errors in demo pages
1 parent 93a5247 commit 44f3562

5 files changed

Lines changed: 54 additions & 51 deletions

File tree

‎.eslintrc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"react/sort-comp": "off",
4040
"react/require-default-props": "off",
4141
"react/no-multi-comp": "off",
42+
"jsx-a11y/href-no-hash": "off",
43+
"jsx-a11y/label-has-for": "off",
4244
"jsx-a11y/img-has-alt": "off"
4345
}
4446
}

‎docs/js/components/DemoControl.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable react/prop-types */
2+
/* eslint-disable import/no-extraneous-dependencies */
23
import React, { Component } from 'react';
34
import Slider from 'rc-slider';
45
import { easings, transitions } from '../../../src/';

‎docs/js/components/Header.js‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
/* eslint-disable react/prop-types */
2-
import React, { Component } from 'react';
2+
/* eslint-disable import/no-extraneous-dependencies */
3+
import React from 'react';
34
import { IndexLink, Link } from 'react-router';
45

5-
export default class Header extends Component {
6-
render() {
7-
return (
8-
<header className="header">
9-
<h1><img src="./images/logo.png" alt="React Stack Grid" /></h1>
10-
<nav>
11-
<ul>
12-
<li><IndexLink to="/" activeClassName="is-active">Home</IndexLink></li>
13-
<li><Link to="/real-world/" activeClassName="is-active">Real World</Link></li>
14-
<li><a href="https://github.com/tsuyoshiwada/react-stack-grid">GitHub</a></li>
15-
</ul>
16-
</nav>
17-
</header>
18-
);
19-
}
20-
}
6+
const Header = () => (
7+
<header className="header">
8+
<h1><img src="./images/logo.png" alt="React Stack Grid" /></h1>
9+
<nav>
10+
<ul>
11+
<li><IndexLink to="/" activeClassName="is-active">Home</IndexLink></li>
12+
<li><Link to="/real-world/" activeClassName="is-active">Real World</Link></li>
13+
<li><a href="https://github.com/tsuyoshiwada/react-stack-grid">GitHub</a></li>
14+
</ul>
15+
</nav>
16+
</header>
17+
);
18+
19+
export default Header;

‎docs/js/pages/Home.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
/* eslint-disable class-methods-use-this */
12
/* eslint-disable react/prop-types */
3+
/* eslint-disable jsx-a11y/no-static-element-interactions */
24
import React, { Component } from 'react';
35
import StackGrid, { transitions, easings } from '../../../src/';
46
import DemoControl from '../components/DemoControl';
@@ -21,7 +23,7 @@ export default class Home extends Component {
2123

2224
const items = [];
2325

24-
for (let i = 0; i < 10; i++) {
26+
for (let i = 0; i < 10; i += 1) {
2527
items.push(this.createItem());
2628
}
2729

@@ -37,7 +39,7 @@ export default class Home extends Component {
3739

3840
createItem() {
3941
const id = Math.random().toString(36).substr(2, 9);
40-
const height = Math.floor(Math.random() * (300 - 80) + 80);
42+
const height = Math.floor((Math.random() * (300 - 80)) + 80);
4143
const modifier = itemModifier[Math.floor(Math.random() * itemModifier.length)];
4244

4345
return { id, height, modifier };
@@ -49,7 +51,7 @@ export default class Home extends Component {
4951

5052
while (i) {
5153
const j = Math.floor(Math.random() * i);
52-
const t = newItems[--i];
54+
const t = newItems[--i]; // eslint-disable-line no-plusplus
5355
newItems[i] = newItems[j];
5456
newItems[j] = t;
5557
}
@@ -72,7 +74,7 @@ export default class Home extends Component {
7274
multipleAppendItem = () => {
7375
const newItems = [];
7476

75-
for (let i = 0; i < 5; i++) {
77+
for (let i = 0; i < 5; i += 1) {
7678
newItems.push(this.createItem());
7779
}
7880

‎docs/js/pages/RealWorld.js‎

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* eslint-disable react/prop-types */
2-
import React, { Component } from 'react';
2+
import React from 'react';
33
import StackGrid, { transitions, easings } from '../../../src/';
44

5+
56
const transition = transitions.scaleDown;
67

78
const images = [
@@ -30,33 +31,31 @@ const images = [
3031
];
3132

3233

33-
export default class RealWorld extends Component {
34-
render() {
35-
return (
36-
<StackGrid
37-
monitorImagesLoaded
38-
columnWidth={300}
39-
duration={600}
40-
gutterWidth={15}
41-
gutterHeight={15}
42-
easing={easings.cubicOut}
43-
appearDelay={60}
44-
appear={transition.appear}
45-
appeared={transition.appeared}
46-
enter={transition.enter}
47-
entered={transition.entered}
48-
leaved={transition.leaved}
34+
const RealWorld = () => (
35+
<StackGrid
36+
monitorImagesLoaded
37+
columnWidth={300}
38+
duration={600}
39+
gutterWidth={15}
40+
gutterHeight={15}
41+
easing={easings.cubicOut}
42+
appearDelay={60}
43+
appear={transition.appear}
44+
appeared={transition.appeared}
45+
enter={transition.enter}
46+
entered={transition.entered}
47+
leaved={transition.leaved}
48+
>
49+
{images.map(obj =>
50+
(<figure
51+
key={obj.src}
52+
className="image"
4953
>
50-
{images.map(obj =>
51-
(<figure
52-
key={obj.src}
53-
className="image"
54-
>
55-
<img src={obj.src} alt={obj.label} />
56-
<figcaption>{obj.label}</figcaption>
57-
</figure>)
58-
)}
59-
</StackGrid>
60-
);
61-
}
62-
}
54+
<img src={obj.src} alt={obj.label} />
55+
<figcaption>{obj.label}</figcaption>
56+
</figure>)
57+
)}
58+
</StackGrid>
59+
);
60+
61+
export default RealWorld;

0 commit comments

Comments
 (0)