Skip to content

Commit

Permalink
fix lint command
Browse files Browse the repository at this point in the history
  • Loading branch information
aholachek committed Jan 4, 2019
1 parent 12d398d commit 8e13795
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 76 deletions.
143 changes: 70 additions & 73 deletions demo/src/FlipMove/index.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import React, { Component } from "react";
import { Flipper, Flipped } from "../../../src";
import Card from "./Card";
import "./index.css";
import React, { Component } from 'react'
import { Flipper, Flipped } from '../../../src'
import Card from './Card'
import './index.css'

const data = [
{ id: 1, title: "Somebody once told me" },
{ id: 2, title: "The World was gonna roll me" },
{ id: 3, title: "I aint the sharpest tool in the shed" },
{ id: 1, title: 'Somebody once told me' },
{ id: 2, title: 'The World was gonna roll me' },
{ id: 3, title: 'I aint the sharpest tool in the shed' },
{
id: 4,
title: "She was looking kind of dumb"
title: 'She was looking kind of dumb'
},
{
id: 5,
title: "With her finger and her thumb"
title: 'With her finger and her thumb'
},
{ id: 6, title: "In the Shape of an L on her Forehead" },
{ id: 7, title: "Well the years start coming" }
];
{ id: 6, title: 'In the Shape of an L on her Forehead' },
{ id: 7, title: 'Well the years start coming' }
]

class ListExample extends Component {
state = {
type: "list",
sort: "asc",
type: 'list',
sort: 'asc',
filteredIds: [],
stagger: "forward",
spring: "noWobble"
};
stagger: 'forward',
spring: 'noWobble'
}

addToFilteredIds = id => {
this.setState(prevState => {
return {
filteredIds: prevState.filteredIds.concat(id)
};
});
};
}
})
}

render() {
return (
Expand All @@ -49,7 +49,7 @@ class ListExample extends Component {
spring={this.state.spring}
staggerConfig={{
default: {
reverse: this.state.stagger !== "forward",
reverse: this.state.stagger !== 'forward',
speed: 0
}
}}
Expand All @@ -61,28 +61,28 @@ class ListExample extends Component {
<label
onClick={() => {
this.setState({
sort: "asc"
});
sort: 'asc'
})
}}
>
<input
type="radio"
name="sort"
checked={this.state.sort === "asc"}
checked={this.state.sort === 'asc'}
/>
asc
</label>
<label
onClick={() => {
this.setState({
sort: "desc"
});
sort: 'desc'
})
}}
>
<input
type="radio"
name="sort"
checked={this.state.sort === "desc"}
checked={this.state.sort === 'desc'}
/>
desc
</label>
Expand All @@ -93,28 +93,28 @@ class ListExample extends Component {
<label
onClick={() => {
this.setState({
type: "grid"
});
type: 'grid'
})
}}
>
<input
type="radio"
name="type"
checked={this.state.type === "grid"}
checked={this.state.type === 'grid'}
/>
grid
</label>
<label
onClick={() => {
this.setState({
type: "list"
});
type: 'list'
})
}}
>
<input
type="radio"
name="type"
checked={this.state.type === "list"}
checked={this.state.type === 'list'}
/>
list
</label>
Expand All @@ -123,7 +123,7 @@ class ListExample extends Component {
<fieldset>
<legend>Stagger</legend>
<div className="fm-flex-container">
{["forward", "reverse", "none"].map(type => {
{['forward', 'reverse', 'none'].map(type => {
return (
<label>
<input
Expand All @@ -133,91 +133,88 @@ class ListExample extends Component {
onChange={() => {
this.setState({
stagger: type,
sort: this.state.sort === "asc" ? "desc" : "asc"
});
sort: this.state.sort === 'asc' ? 'desc' : 'asc'
})
}}
/>
{type}
</label>
);
)
})}
</div>
</fieldset>
<fieldset>
<legend>Spring</legend>
{[
"stiff",
"noWobble",
"veryGentle",
"gentle",
"wobbly"
].map(type => {
return (
<label>
<input
type="radio"
name="spring"
checked={this.state.spring === type}
onChange={() => {
this.setState({
spring: type,
sort: this.state.sort === "asc" ? "desc" : "asc"
});
}}
/>
{type}
</label>
);
})}
{['stiff', 'noWobble', 'veryGentle', 'gentle', 'wobbly'].map(
type => {
return (
<label>
<input
type="radio"
name="spring"
checked={this.state.spring === type}
onChange={() => {
this.setState({
spring: type,
sort: this.state.sort === 'asc' ? 'desc' : 'asc'
})
}}
/>
{type}
</label>
)
}
)}
</fieldset>
</div>
<div>
{!!this.state.filteredIds.length &&
{!!this.state.filteredIds.length && (
<button
className="fm-show-all"
onClick={() => {
this.setState({
filteredIds: []
});
})
}}
>
show all cards
</button>}
</button>
)}
</div>

<Flipped flipId="list">
<div className={this.state.type === "grid" ? "fm-grid" : "fm-list"}>
<div className={this.state.type === 'grid' ? 'fm-grid' : 'fm-list'}>
<Flipped inverseFlipId="list">
<ul className="list-contents">
{[...data]
.filter(d => !this.state.filteredIds.includes(d.id))
.sort((a, b) => {
if (this.state.sort === "asc") {
return a.id - b.id;
if (this.state.sort === 'asc') {
return a.id - b.id
} else {
return b.id - a.id;
return b.id - a.id
}
})
.map(({ title, id }) =>
.map(({ title, id }) => (
<Card
id={id}
title={title}
stagger={["forward", "reverse"].includes(
stagger={['forward', 'reverse'].includes(
this.state.stagger
)}
type={this.state.type}
key={id}
addToFilteredIds={this.addToFilteredIds}
/>
)}
))}
</ul>
</Flipped>
</div>
</Flipped>
</Flipper>
</div>
);
)
}
}

export default ListExample;
export default ListExample
3 changes: 2 additions & 1 deletion mocha/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import '../src/flip/animateFlippedElements/__tests__/filterFlipDescendants.domte
import '../src/flip/animateFlippedElements/__tests__/animateFlippedElements.domtest.js'
import '../src/flip/animateUnflippedElements/animateUnflippedElements.domtest.js'
import '../src/flip/getFlippedElementPositions/getFlippedElementPositions.domtest.js'
mocha.run()
mocha.run() // eslint-disable-line

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"prepare": "yarn run build",
"predeploy": "cd example && yarn install && yarn run build",
"inspect": "npx source-map-explorer dist/index.umd.js dist/index.umd.js.map",
"lint": "tslint",
"lint": "tslint src",
"tslint-fix": "tslint --fix 'src/**/*.{ts,tsx}'",
"format": "prettier --write 'src/**/*.{ts,tsx}",
"format-and-fix": "npm-run-all format tslint-fix",
Expand Down
3 changes: 2 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"one-variable-per-declaration": false,
"no-empty": false,
"trailing-comma": false,
"ban-types": false
"ban-types": false,
"variable-name": false
}
}

0 comments on commit 8e13795

Please sign in to comment.