Skip to content

Commit

Permalink
Merge pull request folio-org#10 from thefrontside/jc/eslint
Browse files Browse the repository at this point in the history
Set up eslint
  • Loading branch information
cherewaty authored Jul 27, 2017
2 parents a99e227 + 24f04f6 commit dd10f6f
Show file tree
Hide file tree
Showing 7 changed files with 562 additions and 23 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
extends: ['eslint:recommended', 'plugin:react/recommended'],
env: {
browser: true
},
rules: {
}
};
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"chai": "^4.0.2",
"chai-enzyme": "^0.8.0",
"enzyme": "^2.9.1",
"eslint": "^4.3.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-react": "^7.1.0",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
Expand Down
6 changes: 5 additions & 1 deletion src/components/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React from 'react';

export default () => (
const App = () => (
<h1>Folio Resource Management</h1>
)

App.displayName = 'App';

export default App;
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global module */
import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
Expand Down
2 changes: 1 addition & 1 deletion tests/app-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global describe, beforeEach, afterEach, it */
/* global it */
import { expect } from 'chai';

import { describeApplication } from './helpers';
Expand Down
26 changes: 20 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,29 @@ let configuration = {
devServer: {
hot: true,
contentBase: path.join(__dirname, 'dist'),
historyApiFallback: false
historyApiFallback: false,
stats: 'errors-only'
},

module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}]
rules: [
{
enforce: "pre",
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
emitError: true,
emitWarning: true,
failOnError: true
}
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},

plugins: [
Expand Down
Loading

0 comments on commit dd10f6f

Please sign in to comment.