Skip to content
This repository was archived by the owner on Nov 29, 2020. It is now read-only.

Commit 9995c89

Browse files
authored
Merge pull request #148 from KleoPetroff/eslint-loader
Integrate eslint-loader
2 parents 38504dd + eaae12d commit 9995c89

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Simple and optimized React boilerplate. It includes:
1010
- [x] Component testing using [Enzyme](https://github.com/airbnb/enzyme)
1111
- [x] Latest Webpack (v.3.0.0) and Webpack Dev Server (v.2.5.0) with Scope Hoisting enabled
1212
- [x] Hot Module Replacement using [react-hot-loader](https://github.com/gaearon/react-hot-loader)
13+
- [x] ES6 linting with continuous linting on file change
1314
- [x] SASS support
1415
- [x] Separate CSS stylesheets generation
1516
- [x] Automatic HTML generation
1617
- [x] Production Config
17-
- [x] Custom Babel Preset with Decorators, Class Properties, Rest/Spread operator support
18-
- [x] ES6 Linting
18+
- [x] Custom Babel Preset with Decorators, Class Properties, Rest/Spread operator support
1919
- [x] Export Separate Vendor Files
2020
- [ ] Redux
2121

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"start": "webpack-dev-server",
88
"clean": "rimraf dist",
99
"production": "cross-env npm run clean && webpack --config webpack.production.config.js --progress --profile --colors",
10-
"lint": "eslint app",
10+
"lint": "eslint ./app/**/**.js",
1111
"test": "mocha --compilers js:babel-core/register --recursive ./tests/**/*.js",
1212
"precommit": "cross-env npm run lint && npm test",
1313
"prepush": "cross-env npm run lint && npm test"

webpack.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ const config = {
3232

3333
module: {
3434
rules: [
35+
{
36+
enforce: "pre",
37+
test: /\.js$/,
38+
exclude: /node_modules/,
39+
loader: "eslint-loader"
40+
},
3541
{
3642
test: /\.js$/,
3743
loaders: [
@@ -64,6 +70,15 @@ const config = {
6470
},
6571

6672
plugins: [
73+
new webpack.LoaderOptionsPlugin({
74+
test: /\.js$/,
75+
options: {
76+
eslint: {
77+
configFile: resolve(__dirname, '.eslintrc'),
78+
cache: false,
79+
}
80+
},
81+
}),
6782
new webpack.optimize.ModuleConcatenationPlugin(),
6883
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true }),
6984
new CopyWebpackPlugin([{ from: 'vendors', to: 'vendors' }]),

0 commit comments

Comments
 (0)