Skip to content

Commit

Permalink
Merge pull request #76 from zpao/lint
Browse files Browse the repository at this point in the history
Update linting dependencies, fix errors
  • Loading branch information
kenwheeler committed Sep 22, 2015
2 parents 3c03abf + 251b30b commit 79e4388
Show file tree
Hide file tree
Showing 31 changed files with 101 additions and 81 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
"extends":
- "defaults/configurations/walmart/es6-react"
- "eslint-config-defaults/configurations/walmart/es6-react"

"rules":
"indent": [2, 2, {"SwitchCase": 1}]
"max-len": 0
6 changes: 3 additions & 3 deletions index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Presentation.contextTypes = {
router: React.PropTypes.object
};

Presentation = context(Presentation, {styles: config.theme, print: config.print, flux});
const PresentationContext = context(Presentation, {styles: config.theme, print: config.print, flux});

React.render(
<Router history={new HashHistory()}>
<Route path="/" component={Presentation} />
<Route path="/:slide" component={Presentation} />
<Route path="/" component={PresentationContext} />
<Route path="/:slide" component={PresentationContext} />
</Router>
, document.body);
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"start": "webpack-dev-server",
"lint": "eslint --ext .js,.jsx src",
"lint": "eslint --ext .js,.jsx .",
"build": "webpack",
"deploy": "npm run build && surge -p ./dist"
},
Expand All @@ -30,12 +30,13 @@
"autoprefixer-core": "^5.2.1",
"babel": "^5.6.14",
"babel-core": "^5.6.15",
"babel-eslint": "^3.1.23",
"babel-eslint": "^4.1.3",
"babel-loader": "^5.2.2",
"css-loader": "^0.15.1",
"eslint": "^0.24.0",
"eslint-config-defaults": "^3.0.3",
"eslint-plugin-react": "^2.6.4",
"eslint": "^1.5.1",
"eslint-config-defaults": "^6.0.0",
"eslint-plugin-filenames": "^0.1.2",
"eslint-plugin-react": "^3.4.2",
"file-loader": "^0.8.4",
"json-loader": "^0.5.2",
"node-libs-browser": "^0.5.2",
Expand Down
6 changes: 3 additions & 3 deletions presentation/deck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export default class extends React.Component {
</Link>
<Text textSize="1.5em" margin="20px 0px 0px" bold>Hit Your Right Arrow To Begin!</Text>
</Slide>
<Slide transition={['slide']} bgColor="black" notes="You can even put notes on your slide. How awesome is that?">
<Image src={images.kat.replace('/','')} margin="0px auto 40px" height="293px"/>
<Slide transition={["slide"]} bgColor="black" notes="You can even put notes on your slide. How awesome is that?">
<Image src={images.kat.replace("/", "")} margin="0px auto 40px" height="293px"/>
<Heading size={1} fit textColor="primary" textFont="secondary">
Wait what?
</Heading>
</Slide>
<Slide transition={['zoom', 'fade']} bgColor="primary" notes="<ul><li>talk about that</li><li>and that</li></ul>">
<Slide transition={["zoom", "fade"]} bgColor="primary" notes="<ul><li>talk about that</li><li>and that</li></ul>">
<CodePane
lang="javascript"
source={require("raw!./deck.example")}
Expand Down
3 changes: 2 additions & 1 deletion src/appear.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import assign from "object-assign";
const Appear = React.createClass({
mixins: [tweenState.Mixin],
propTypes: {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
},
contextTypes: {
flux: React.PropTypes.object,
Expand Down
2 changes: 1 addition & 1 deletion src/base.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint max-statements:0,complexity:0*/
/*eslint max-statements:0,complexity:0,no-invalid-this:0*/
import React from "react/addons";

const getStyles = function getStyles() {
Expand Down
3 changes: 2 additions & 1 deletion src/block-quote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class BlockQuote extends Base {
}

BlockQuote.propTypes = {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
};

BlockQuote.contextTypes = {
Expand Down
3 changes: 2 additions & 1 deletion src/code-pane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ CodePane.contextTypes = {

CodePane.propTypes = {
lang: React.PropTypes.string,
source: React.PropTypes.string
source: React.PropTypes.string,
style: React.PropTypes.object
};

CodePane.defaultProps = {
Expand Down
3 changes: 2 additions & 1 deletion src/code.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class Code extends Base {
}

Code.propTypes = {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
};

Code.contextTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/deck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class Deck extends React.Component {
}
_getHash(slide) {
let hash = slide;
if ('id' in this.props.children[slide].props) {
if ("id" in this.props.children[slide].props) {
hash = this.props.children[slide].props.id;
}
return hash;
Expand Down
3 changes: 2 additions & 1 deletion src/fill.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Fill extends React.Component {
}

Fill.propTypes = {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
};

export default Fill;
3 changes: 2 additions & 1 deletion src/fit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Fit extends React.Component {
}

Fit.propTypes = {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
};

export default Fit;
12 changes: 6 additions & 6 deletions src/heading.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ class Heading extends Base {
const Tag = "H" + this.props.size;
const styles = {
container: {
display: 'block',
width: '100%',
display: "block",
width: "100%",
height: this.state.height
},
text: {
fontSize: 16,
display: 'block',
display: "block",
margin: "0",
padding: "0",
lineHeight: this.props.lineHeight,
transform: "scale(" + this.state.scale + ")",
transformOrigin: 'center top'
transformOrigin: "center top"
}
};
return this.props.fit
Expand All @@ -71,8 +71,8 @@ class Heading extends Base {
</span>
</div>
: React.createElement(Tag, {
style: [this.context.styles.components.heading["h" + this.props.size], this.getStyles(), this.props.style]
}, this.props.children);
style: [this.context.styles.components.heading["h" + this.props.size], this.getStyles(), this.props.style]
}, this.props.children);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Image.propTypes = {
React.PropTypes.number
]),
display: React.PropTypes.string,
src: React.PropTypes.string
src: React.PropTypes.string,
style: React.PropTypes.object
};

Image.contextTypes = {
Expand Down
3 changes: 2 additions & 1 deletion src/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Layout extends React.Component {
}

Layout.propTypes = {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
};

export default Layout;
3 changes: 2 additions & 1 deletion src/link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class Link extends Base {

Link.propTypes = {
children: React.PropTypes.node,
href: React.PropTypes.string
href: React.PropTypes.string,
style: React.PropTypes.object
};

Link.contextTypes = {
Expand Down
3 changes: 2 additions & 1 deletion src/list-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class ListItem extends Base {
}

ListItem.propTypes = {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
};

ListItem.contextTypes = {
Expand Down
3 changes: 2 additions & 1 deletion src/list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class List extends Base {
}

List.propTypes = {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
};

List.contextTypes = {
Expand Down
2 changes: 0 additions & 2 deletions src/overview.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global setInterval*/

import React from "react/addons";
import cloneWithProps from "react/lib/cloneWithProps";
import Base from "./base";
Expand Down
7 changes: 4 additions & 3 deletions src/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Presenter extends Base {
_renderMainSlide() {
const child = this.props.slides[this.props.slide];
const presenterStyle = {
position: "relative",
position: "relative"
};
return cloneWithProps(child, {
key: this.props.slide,
Expand All @@ -42,7 +42,7 @@ class Presenter extends Base {
});
}
componentDidMount() {
this.time = setInterval(()=> {
this.time = setInterval(() => {
this.setState({
time: startTime(new Date())
});
Expand All @@ -61,7 +61,7 @@ class Presenter extends Base {
left: "50%",
transform: "translate(-50%, -50%)",
margin: 0,
color: 'white'
color: "white"
};
const child = this.props.slides[parseInt(this.props.slide) + 1];
return child ? cloneWithProps(child, {
Expand Down Expand Up @@ -183,6 +183,7 @@ class Presenter extends Base {

Presenter.propTypes = {
lastSlide: React.PropTypes.number,
hash: React.PropTypes.number,
slides: React.PropTypes.array,
slide: React.PropTypes.number
};
Expand Down
3 changes: 2 additions & 1 deletion src/quote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class Quote extends Base {
}

Quote.propTypes = {
children: React.PropTypes.node
children: React.PropTypes.node,
style: React.PropTypes.object
};

Quote.contextTypes = {
Expand Down
1 change: 1 addition & 0 deletions src/s.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class S extends React.Component {

S.propTypes = {
children: React.PropTypes.node,
style: React.PropTypes.object,
type: React.PropTypes.array
};

Expand Down
5 changes: 3 additions & 2 deletions src/slide.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const Slide = React.createClass({
},
propTypes: {
align: React.PropTypes.string,
hash: React.PropTypes.number,
presenterStyle: React.PropTypes.object,
children: React.PropTypes.node,
notes: React.PropTypes.string,
Expand Down Expand Up @@ -76,12 +77,12 @@ const Slide = React.createClass({
} : {};
const overViewStyles = {
inner: {
flexDirection: 'column'
flexDirection: "column"
},
content: {
width: "100%"
}
}
};
const styles = {
outer: {
position: this.context.export ? "relative" : "absolute",
Expand Down
8 changes: 4 additions & 4 deletions src/text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ class Text extends Base {
render() {
const styles = {
container: {
display: 'block',
width: '100%',
display: "block",
width: "100%",
height: this.state.height
},
text: {
fontSize: 16,
display: 'block',
display: "block",
margin: "0",
padding: "0",
lineHeight: this.props.lineHeight,
transform: "scale(" + this.state.scale + ")",
transformOrigin: 'center top'
transformOrigin: "center top"
}
};
return this.props.fit
Expand Down
2 changes: 1 addition & 1 deletion src/transitions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {

this.setState({
z: 1
}, ()=> {
}, () => {

if (this.props.transition.indexOf("fade") !== -1) {
this.tweenState("opacity", {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/context.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const context = function context(Component, params) {
overview: location.query && "overview" in location.query,
export: location.query && "export" in location.query,
print: location.query && "print" in location.query,
slide: slide
slide
};
},

Expand Down
40 changes: 20 additions & 20 deletions themes/default/html.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module.exports = function(data) {
module.exports = function (data) {
return {
'200.html': data.defaultTemplate(),
'index.html': [
'<!doctype html>',
'<html>',
'<head>',
'<meta charset="utf-8"/>',
'<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>',
'<link href="http://fonts.googleapis.com/css?family=Lobster+Two:400,700" rel="stylesheet" type="text/css">',
'<link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700" rel="stylesheet" type="text/css">',
'<link href="' + data.css + '" rel="stylesheet" type="text/css" />',
'</head>',
'<body>',
'<div id="root"></div>',
'<script src="' + data.main + '"></script>',
'</body>',
'</html>'
].join('')
}
}
"200.html": data.defaultTemplate(),
"index.html": [
"<!doctype html>",
"<html>",
"<head>",
"<meta charset=\"utf-8\"/>",
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/>",
"<link href=\"http://fonts.googleapis.com/css?family=Lobster+Two:400,700\" rel=\"stylesheet\" type=\"text/css\">",
"<link href=\"http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700\" rel=\"stylesheet\" type=\"text/css\">",
"<link href=\"" + data.css + "\" rel=\"stylesheet\" type=\"text/css\" />",
"</head>",
"<body>",
"<div id=\"root\"></div>",
"<script src=\"" + data.main + "\"></script>",
"</body>",
"</html>"
].join("")
};
};
Loading

0 comments on commit 79e4388

Please sign in to comment.