Skip to content

Commit

Permalink
use eslint instead of jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
clhenrick committed Jul 10, 2016
1 parent 3089212 commit a472244
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 126 deletions.
15 changes: 15 additions & 0 deletions .eslintrc
@@ -0,0 +1,15 @@
{
"parser": "babel-eslint",
"ecmaFeatures": {
"jsx": true
},
"env": {
"es6": true,
"browser": true,
"node": true
},
"rules": {
"indent": [1, 2, { "SwitchCase": 1 }],
"semi": [2, "always"]
}
}
21 changes: 0 additions & 21 deletions .jshintrc

This file was deleted.

21 changes: 9 additions & 12 deletions gulpfile.js
Expand Up @@ -15,10 +15,6 @@ var browserify = require('browserify');
var watchify = require('watchify');
var reactify = require('reactify');

// TODO: implement browserSync with live page reloading
// var browserSync = require('browser-sync');
// var reload = browserSync.reload;

// object containing file names and paths for output
var path = {
HTML: 'src/index.html',
Expand Down Expand Up @@ -52,13 +48,14 @@ gulp.task('watch', function() {

var watcher = watchify(
browserify({
entries: [path.ENTRY_POINT],
transform: [reactify],
debug: true,
cache: {},
packageCache: {},
fullPaths: true
}));
entries: [path.ENTRY_POINT],
transform: [reactify],
debug: true,
cache: {},
packageCache: {},
fullPaths: true
})
);

return watcher.on('update', function () {
watcher.bundle()
Expand Down Expand Up @@ -100,4 +97,4 @@ gulp.task('useref', function(){

// these are what get called when we do either `gulp` or `gulp production` on the CLI
gulp.task('default', ['connect', 'watch', 'copy', 'useref']);
gulp.task('production', ['useref', 'build']);
gulp.task('production', ['useref', 'build']);
7 changes: 5 additions & 2 deletions package.json
Expand Up @@ -20,23 +20,26 @@
},
"homepage": "https://github.com/clhenrick/React-Leaflet-demo#readme",
"devDependencies": {
"babel-eslint": "^6.1.2",
"browser-sync": "^2.10.1",
"browserify": "^12.0.1",
"eslint": "^3.0.1",
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0",
"gulp-connect": "^3.1.0",
"gulp-load-plugins": "^1.1.0",
"gulp-react": "^3.1.0",
"gulp-streamify": "^1.0.2",
"gulp-uglify": "^1.5.1",
"gulp-useref": "^3.1.0",
"reactify": "^1.1.1",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.6.1"
},
"dependencies": {
"leaflet": "^0.7.7",
"qwest": "^2.2.6",
"react": "^0.14.5",
"react-dom": "^0.14.5"
"react": "0.14.4",
"react-dom": "0.14.4"
}
}
2 changes: 1 addition & 1 deletion src/index.html
Expand Up @@ -19,4 +19,4 @@

<script src="src/build.js"></script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion src/js/App.js
Expand Up @@ -19,4 +19,4 @@ var App = React.createClass({
ReactDOM.render(
<App />,
mountNode
);
);
19 changes: 10 additions & 9 deletions src/js/Filter.js
Expand Up @@ -12,21 +12,22 @@ var Filter = React.createClass({
return {
lines: [],
curFilter: ''
}
};
},

updateFilter: function(e) {
// console.log(e.target.value);
this.state.filter = e.target.value;
this.setState({
filter: this.state.filter
});
this.handleUpdate();
// this.state.filter = e.target.value;
// this.setState({
// filter: this.state.filter
// });
// this.handleUpdate();
this.props.filterLines(e.target.value);
},

handleUpdate: function(){
// filterLines passes the value of "filter" to the Map component's updateMap method
this.props.filterLines(this.state.filter);
// this.props.filterLines(this.state.filter);
},

render: function() {
Expand All @@ -43,7 +44,7 @@ var Filter = React.createClass({
<select defaultValue="*" type="select" name="filterlines" onChange={this.updateFilter}>
{ /* This is how to do a comment in JSX! notice the curly braces. */ }
{ /* We render the select's option elements by maping each of the values of subwayLines array to option elements */ }
{this.props.lines.map(function(line, i){
{this.props.lines.map(function(line, i){
{ /* the "key" property is recommended by React when creating list like elements */ }
return (
<option value={line} key={i}>{line}</option>
Expand All @@ -56,4 +57,4 @@ var Filter = React.createClass({
});

// make sure to export our module so that it can be used elsewhere
module.exports = Filter;
module.exports = Filter;

0 comments on commit a472244

Please sign in to comment.