Skip to content

Commit 78a6df8

Browse files
committed
Added jscs linting support
1 parent fbed641 commit 78a6df8

File tree

14 files changed

+42
-43
lines changed

14 files changed

+42
-43
lines changed

client/.jscsrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"preset": "airbnb",
33
"fileExtensions": [".js", ".jsx"],
4-
"excludeFiles": ["build/**", "node_modules/**"],
5-
"esprima": "esprima-fb"
4+
"excludeFiles": ["build/**", "node_modules/**"]
65
}

client/assets/javascripts/components/Comment.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Comment = React.createClass({
66

77
propTypes: {
88
author: React.PropTypes.string.isRequired,
9-
text: React.PropTypes.string.isRequired
9+
text: React.PropTypes.string.isRequired,
1010
},
1111

1212
render() {
@@ -19,7 +19,7 @@ const Comment = React.createClass({
1919
<span dangerouslySetInnerHTML={{__html: rawMarkup}}/>
2020
</div>
2121
);
22-
}
22+
},
2323
});
2424

2525
export default Comment;

client/assets/javascripts/components/CommentBox.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ const CommentBox = React.createClass({
1010

1111
propTypes: {
1212
url: React.PropTypes.string.isRequired,
13-
pollInterval: React.PropTypes.number.isRequired
13+
pollInterval: React.PropTypes.number.isRequired,
1414
},
1515

1616
getStoreState() {
1717
return {
1818
comments: CommentStore.getState(),
19-
form: FormStore.getState()
19+
form: FormStore.getState(),
2020
};
2121
},
2222

@@ -45,15 +45,15 @@ const CommentBox = React.createClass({
4545

4646
render() {
4747
return (
48-
<div className="commentBox container">
48+
<div className='commentBox container'>
4949
<h1>Comments { this.state.form.ajaxSending ? 'SENDING AJAX REQUEST!' : '' }</h1>
5050
<CommentForm formData={this.state.form.comment}
5151
url={this.props.url}
5252
ajaxSending={this.state.form.ajaxSending} />
5353
<CommentList comments={this.state.comments.comments} />
5454
</div>
5555
);
56-
}
56+
},
5757
});
5858

5959
export default CommentBox;

client/assets/javascripts/components/CommentForm.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ const CommentForm = React.createClass({
1313
propTypes: {
1414
url: React.PropTypes.string.isRequired,
1515
formData: React.PropTypes.object.isRequired,
16-
ajaxSending: React.PropTypes.bool.isRequired
16+
ajaxSending: React.PropTypes.bool.isRequired,
1717
},
1818

1919
getInitialState() {
2020
return {
21-
formMode: 0
21+
formMode: 0,
2222
};
2323
},
2424

@@ -34,14 +34,14 @@ const CommentForm = React.createClass({
3434
if (this.state.formMode < 2) {
3535
obj = {
3636
author: this.refs.author.getValue(),
37-
text: this.refs.text.getValue()
37+
text: this.refs.text.getValue(),
3838
};
3939
} else {
4040
obj = {
4141
// This is different because the input is a native HTML element
4242
// rather than a React element.
4343
author: this.refs.inlineAuthor.getDOMNode().value,
44-
text: this.refs.inlineText.getDOMNode().value
44+
text: this.refs.inlineText.getDOMNode().value,
4545
};
4646
}
4747

@@ -145,15 +145,15 @@ const CommentForm = React.createClass({
145145
}
146146
return (
147147
<div>
148-
<Nav bsStyle="pills" activeKey={this.state.formMode} onSelect={this.handleSelect}>
148+
<Nav bsStyle='pills' activeKey={this.state.formMode} onSelect={this.handleSelect}>
149149
<NavItem eventKey={0}>Horizontal Form</NavItem>
150150
<NavItem eventKey={1}>Stacked Form</NavItem>
151151
<NavItem eventKey={2}>Inline Form</NavItem>
152152
</Nav>
153153
{inputForm}
154154
</div>
155155
);
156-
}
156+
},
157157
});
158158

159159
export default CommentForm;

client/assets/javascripts/components/CommentList.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const CommentList = React.createClass({
55
displayName: 'CommentList',
66

77
propTypes: {
8-
comments: React.PropTypes.array
8+
comments: React.PropTypes.array,
99
},
1010

1111
render() {
@@ -20,11 +20,11 @@ const CommentList = React.createClass({
2020
});
2121

2222
return (
23-
<div className="commentList">
23+
<div className='commentList'>
2424
{commentNodes}
2525
</div>
2626
);
27-
}
27+
},
2828
});
2929

3030
export default CommentList;

client/assets/javascripts/stores/CommentStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CommentStore {
1010
handleFetchComments: CommentActions.FETCH_COMMENTS,
1111
handleUpdateComments: CommentActions.UPDATE_COMMENTS,
1212
handleUpdateCommentsError: CommentActions.UPDATE_COMMENTS_ERROR,
13-
handleAddComment: CommentActions.ADD_COMMENT
13+
handleAddComment: CommentActions.ADD_COMMENT,
1414
});
1515
}
1616

client/assets/javascripts/stores/FormStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class FormStore {
1515
handleFetchComments: CommentActions.FETCH_COMMENTS,
1616
handleUpdateComments: CommentActions.UPDATE_COMMENTS,
1717
handleUpdateCommentsError: CommentActions.UPDATE_COMMENTS_ERROR,
18-
handleAddComment: CommentActions.ADD_COMMENT
18+
handleAddComment: CommentActions.ADD_COMMENT,
1919
});
2020
}
2121

client/assets/javascripts/utils/CommentsManager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const CommentsManager = {
1010
fetchComments(url) {
1111
return $.ajax({
1212
url: url,
13-
dataType: 'json'
13+
dataType: 'json',
1414
});
1515
},
1616

@@ -26,9 +26,9 @@ const CommentsManager = {
2626
url: url,
2727
dataType: 'json',
2828
type: 'POST',
29-
data: {comment: comment}
29+
data: {comment: comment},
3030
});
31-
}
31+
},
3232
};
3333

3434
export default CommentsManager;

client/bootstrap-sass.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = {
3131
popover: true,
3232
scrollspy: true,
3333
tab: true,
34-
affix: true
34+
affix: true,
3535
},
3636

3737
// ### Styles
@@ -83,6 +83,6 @@ module.exports = {
8383
carousel: true,
8484

8585
utilities: true,
86-
'responsive-utilities': true
87-
}
86+
'responsive-utilities': true,
87+
},
8888
};

client/karma.conf.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ module.exports = function karmaMain(config) {
1212
frameworks: ['mocha'],
1313

1414
files: [
15-
'tests.webpack.js'
15+
'tests.webpack.js',
1616
],
1717

1818
preprocessors: {
19-
'tests.webpack.js': ['webpack', 'sourcemap']
19+
'tests.webpack.js': ['webpack', 'sourcemap'],
2020
},
2121

2222
reporters: ['dots'],
@@ -25,19 +25,19 @@ module.exports = function karmaMain(config) {
2525
devtool: 'inline-source-map',
2626
module: {
2727
loaders: [
28-
{test: /\.js$/, loader: 'babel-loader'}
29-
]
28+
{test: /\.js$/, loader: 'babel-loader'},
29+
],
3030
},
3131
plugins: [
3232
new webpack.DefinePlugin({
33-
'process.env.NODE_ENV': JSON.stringify('test')
34-
})
35-
]
33+
'process.env.NODE_ENV': JSON.stringify('test'),
34+
}),
35+
],
3636
},
3737

3838
webpackServer: {
39-
noInfo: true
40-
}
39+
noInfo: true,
40+
},
4141

4242
});
4343
};

0 commit comments

Comments
 (0)