Skip to content

Commit

Permalink
#26 readme for eslint ignoring rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ddhp committed Apr 20, 2018
1 parent d6cdb2c commit 955331c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ yarn build:browser:prod && yarn build:server:prod
node dist/server/index.js
```

### Eslint
Some rules are disabled in `hot` mode(the mode when you run `yarn start`),
check `webpack.base.js:16`.
`yarn build:browser:dev/prod` would save output to a json file, so you would only see subtle error message on terminal,
in this case you have to check generated `compilation-stats.json`'s `errors` for reasons.

### Log
Import `stdout.js` and define namespace ([example](https://github.com/ddhp/react-isomorphic-boilerplate/blob/master/src/server/pages.js)), then turn on debug message depends on platform:
- browser: allow debug log by type `localStorage.debug = '*'` in console.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"license": "MIT",
"scripts": {
"start": "DEBUG=*,-nodemon*,-express*,-send,-babel*,-eslint*,-css-modules* NODE_ENV=hot babel-node --inspect src/server/hot/index.js",
"build:browser:dev": "webpack --env=dev --config=webpack.browser.babel.js --progress --profile --colors --json > compilation-stats.json",
"build:browser:dev": "webpack --env=dev --config=webpack.browser.babel.js --profile --progress --json > compilation-stats.json",
"build:server:dev": "webpack --env=dev --config=webpack.server.babel.js --progress --profile --colors",
"build:browser:prod": "webpack --env=prod --display-error-details --config=webpack.browser.babel.js --progress --profile --colors --json > compilation-stats.json",
"build:browser:prod": "webpack --env=prod --config=webpack.browser.babel.js --progress --json > compilation-stats.json",
"build:server:prod": "webpack --env=prod --config=webpack.server.babel.js --progress --profile --colors",
"eslint": "eslint ./",
"test": "npm run eslint && cross-env NODE_ENV=test nyc ava --verbose",
Expand Down
7 changes: 3 additions & 4 deletions webpack.browser.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ export default function browserConfig(env) {
// }),
// );

// set available stats
// disable some stats
// https://webpack.js.org/configuration/stats/
config.stats = {
all: false,
assets: true,
publicPath: true,
chunks: false,
modules: false,
};

// modify config for hot env
Expand Down

0 comments on commit 955331c

Please sign in to comment.