Skip to content

Commit

Permalink
rules: add eslint to detect JS issue at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
regit committed Mar 15, 2018
1 parent 2ea16a0 commit c5a9a78
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parser": "babel-eslint",
"rules": {
"strict": 1,
"no-undef": 1
},
"env": {
"browser": true,
"node": true,
"jquery": true
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
"@babel/core": "^7.0.0-beta.37",
"@babel/preset-env": "^7.0.0-beta.37",
"autoprefixer": "^7.2.4",
"babel-eslint": "^7.2.3",
"babel-loader": "^8.0.0-beta.0",
"css-loader": "^0.28.8",
"eslint": "^3.19.0",
"eslint-loader": "^2.0.0",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.6",
"node-sass": "^4.7.2",
Expand Down
5 changes: 5 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ module.exports = {
}
}
},
{
test: /\.js$/,
exclude: /node_modules/,
use: ['eslint-loader']
},
{
test: /\.(css|scss)$/,
use: extractSass.extract({
Expand Down

0 comments on commit c5a9a78

Please sign in to comment.