Allow webpack to compile on lint error (#1104)

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.
This commit is contained in:
Risha Mars 2018-06-14 11:26:59 -07:00 committed by GitHub
parent 13aaa82c95
commit 72415d173e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 9 deletions

View File

@ -59,6 +59,7 @@ jobs:
before_install: before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.7.0 - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.7.0
- export PATH="$HOME/.yarn/bin:$PATH" - export PATH="$HOME/.yarn/bin:$PATH"
- export NODE_ENV=test
install: install:
- ./bin/web - ./bin/web
script: script:

View File

@ -37,7 +37,7 @@
"devDependencies": { "devDependencies": {
"babel-core": "^6.26.0", "babel-core": "^6.26.0",
"babel-eslint": "^8.0.3", "babel-eslint": "^8.0.3",
"babel-loader": "^7.1.2", "babel-loader": "^7.1.4",
"babel-plugin-import": "^1.7.0", "babel-plugin-import": "^1.7.0",
"babel-preset-env": "^1.7.0", "babel-preset-env": "^1.7.0",
"babel-preset-react-app": "^3.1.1", "babel-preset-react-app": "^3.1.1",
@ -45,7 +45,7 @@
"enzyme-context-patch": "^0.0.8", "enzyme-context-patch": "^0.0.8",
"eslint": "^4.12.1", "eslint": "^4.12.1",
"eslint-config-airbnb": "^16.1.0", "eslint-config-airbnb": "^16.1.0",
"eslint-loader": "^1.9.0", "eslint-loader": "^2.0.0",
"eslint-plugin-import": "^2.12.0", "eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-promise": "^3.6.0", "eslint-plugin-promise": "^3.6.0",

View File

@ -24,7 +24,13 @@ module.exports = {
exclude: /node_modules/, exclude: /node_modules/,
use: [ use: [
'babel-loader', 'babel-loader',
{ loader: 'eslint-loader', options: { fix: true } } {
loader: 'eslint-loader',
options: {
fix: true,
emitWarning: process.env.NODE_ENV == 'development'
}
}
] ]
}, },
{ {

View File

@ -631,9 +631,9 @@ babel-helpers@^6.24.1:
babel-runtime "^6.22.0" babel-runtime "^6.22.0"
babel-template "^6.24.1" babel-template "^6.24.1"
babel-loader@^7.1.2: babel-loader@^7.1.4:
version "7.1.2" version "7.1.4"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.2.tgz#f6cbe122710f1aa2af4d881c6d5b54358ca24126" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.4.tgz#e3463938bd4e6d55d1c174c5485d406a188ed015"
dependencies: dependencies:
find-cache-dir "^1.0.0" find-cache-dir "^1.0.0"
loader-utils "^1.0.2" loader-utils "^1.0.2"
@ -2838,9 +2838,9 @@ eslint-import-resolver-node@^0.3.1:
debug "^2.6.9" debug "^2.6.9"
resolve "^1.5.0" resolve "^1.5.0"
eslint-loader@^1.9.0: eslint-loader@^2.0.0:
version "1.9.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-1.9.0.tgz#7e1be9feddca328d3dcfaef1ad49d5beffe83a13" resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-2.0.0.tgz#d136619b5c684e36531ffc28c60a56e404608f5d"
dependencies: dependencies:
loader-fs-cache "^1.0.0" loader-fs-cache "^1.0.0"
loader-utils "^1.0.2" loader-utils "^1.0.2"