Skip to content

Commit

Permalink
Allow webpack to compile on lint error (#1104)
Browse files Browse the repository at this point in the history
Add an emitWarning to the webpack config so that webpack will compile despite lint 
errors when running in development mode. This is necessary to enable development 
on the frontend using webpack-dev-server's automatic reloading.

Also sets a NODE_ENV in travis.yml so that the build will fail if linting fails.
  • Loading branch information
Risha Mars committed Jun 14, 2018
1 parent 13aaa82 commit 72415d1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.7.0
- export PATH="$HOME/.yarn/bin:$PATH"
- export NODE_ENV=test
install:
- ./bin/web
script:
Expand Down
4 changes: 2 additions & 2 deletions web/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.3",
"babel-loader": "^7.1.2",
"babel-loader": "^7.1.4",
"babel-plugin-import": "^1.7.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react-app": "^3.1.1",
"css-loader": "^0.28.7",
"enzyme-context-patch": "^0.0.8",
"eslint": "^4.12.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-loader": "^1.9.0",
"eslint-loader": "^2.0.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-promise": "^3.6.0",
Expand Down
8 changes: 7 additions & 1 deletion web/app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ module.exports = {
exclude: /node_modules/,
use: [
'babel-loader',
{ loader: 'eslint-loader', options: { fix: true } }
{
loader: 'eslint-loader',
options: {
fix: true,
emitWarning: process.env.NODE_ENV == 'development'
}
}
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions web/app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,9 @@ babel-helpers@^6.24.1:
babel-runtime "^6.22.0"
babel-template "^6.24.1"

babel-loader@^7.1.2:
version "7.1.2"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.2.tgz#f6cbe122710f1aa2af4d881c6d5b54358ca24126"
babel-loader@^7.1.4:
version "7.1.4"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.4.tgz#e3463938bd4e6d55d1c174c5485d406a188ed015"
dependencies:
find-cache-dir "^1.0.0"
loader-utils "^1.0.2"
Expand Down Expand Up @@ -2838,9 +2838,9 @@ eslint-import-resolver-node@^0.3.1:
debug "^2.6.9"
resolve "^1.5.0"

eslint-loader@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-1.9.0.tgz#7e1be9feddca328d3dcfaef1ad49d5beffe83a13"
eslint-loader@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-2.0.0.tgz#d136619b5c684e36531ffc28c60a56e404608f5d"
dependencies:
loader-fs-cache "^1.0.0"
loader-utils "^1.0.2"
Expand Down

0 comments on commit 72415d1

Please sign in to comment.