Skip to content

Commit

Permalink
Fix esling config (#113)
Browse files Browse the repository at this point in the history
* Fix eslint config

* Update eslintrc

* Remove package-lock.json

* Change from js to jsx

* Remove package-lock.json

* CR comments

* fix linting errors and add js tests to the build
  • Loading branch information
kentwills authored Jan 31, 2018
1 parent 351fe9d commit 312e86a
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 15 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
coverage-html/
venv/
google_appengine
11 changes: 7 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
'extends': 'airbnb',
'env': {
'browser': true
}
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": ["warn", { "extensions": [".js"] } ]
},
"env": {
"browser": true
},
};
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ before_script:
- unzip google_appengine.zip >/dev/null
- export APPENGINE_PATH=./google_appengine
- export PATH=$PATH:$APPENGINE_PATH
script: tox
script: make test
cache:
directories:
- $HOME/.cache/pip
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VIRTUALENV_REQUIREMENTS = requirements.txt requirements-dev.txt
SOURCES := $(shell find js -name '*.jsx' -o -name '*.js')
SOURCES := $(shell find js -name '*.js')

.PHONY: all
all: development
Expand Down
20 changes: 20 additions & 0 deletions js/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import Header from './components/Header';
import Footer from './components/Footer';

function App(props) {
return (
<div>
<Header />
{props.children}
<Footer />
</div>
);
}

App.propTypes = {
children: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
};

export default App;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion js/index.jsx → js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ ReactDOM.render(
</Provider>,
document.querySelector('#container'),
);

17 changes: 17 additions & 0 deletions js/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { Route, IndexRoute } from 'react-router';

import MetricsList from './containers/MetricsList';
import MeetingRequest from './containers/MeetingRequest';
import User from './containers/User';
import App from './App';


export default (
<Route path="/" component={App}>
<IndexRoute component={User} />
<Route path="/dashboard" component={MetricsList} />
<Route path="/user/:email" component={User} />
<Route path="/meeting_request/:id" component={MeetingRequest} />
</Route>
);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"react": "^16.1.1",
"react-dom": "^16.1.1",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"redux": "^3.7.2",
"redux-promise": "^0.5.3"
Expand Down Expand Up @@ -37,7 +38,7 @@
"scripts": {
"webpack-dev-server": "webpack-dev-server --port 8001",
"webpack": "webpack --progress --color",
"eslint": "eslint --ext .jsx --ext .js .",
"eslint": "eslint --ext .js .",
"test": "jest --config .jestrc.json",
"test:watch": "npm test -- --watch"
},
Expand Down
11 changes: 4 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const VENDOR = [

module.exports = {
entry: {
app: './js/index.jsx',
app: './js/index.js',
vendor: VENDOR,
},
output: {
Expand All @@ -26,23 +26,20 @@ module.exports = {
rules: [
{
use: 'eslint-loader?{fix: true}',
test: /\.jsx?$/,
test: /\.js$/,
exclude: /node_modules/,
enforce: 'pre',
},
{
use: 'babel-loader',
test: /\.jsx?$/,
test: /\.js$/,
exclude: /node_modules/,
},
],
},
devtool: 'source-map',
devServer: {
contentBase: './',
},
resolve: {
extensions: ['.js', '.jsx'],
extensions: ['.js'],
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
Expand Down

0 comments on commit 312e86a

Please # to comment.