Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Format eslint errors consistently across commands using the codeframe styler #510

Merged
merged 1 commit into from
Dec 2, 2017
Merged

Format eslint errors consistently across commands using the codeframe styler #510

merged 1 commit into from
Dec 2, 2017

Conversation

eliperelman
Copy link
Member

@eliperelman eliperelman commented Dec 2, 2017

Fixes #380.

Output of a sample project with an eslint warning and error:

❯ yarn lint
yarn run v1.3.2
$ neutrino lint
✖ Running lint failed
warning: 'use strict' is unnecessary inside of modules (strict) at src/index.js:1:1:
> 1 | 'use strict';
    | ^
  2 |
  3 | const root = document.getElementById('root');
  4 |


error: Missing semicolon (semi) at src/index.js:5:89:
  3 | const root = document.getElementById('root');
  4 |
> 5 | root.innerHTML = '<div style="padding: 20px"><h1>Welcome to 6cbcd59625d4f957</h1></div>'
    |                                                                                         ^
  6 |
  7 | // This is needed for Hot Module Replacement
  8 | if (module.hot) {


1 error and 1 warning found.
1 error and 1 warning potentially fixable with the `--fix` option.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

/var/folders/dl/9lrzd5110zlft676qdpr7xn40000gp/T/6cbcd59625d4f957
❯ yarn start
yarn run v1.3.2
$ neutrino start
✔ Development server running on: http://localhost:5000
✔ Build completed

ERROR in ./src/index.js
warning: 'use strict' is unnecessary inside of modules (strict) at src/index.js:1:1:
> 1 | 'use strict';
    | ^
  2 |
  3 | const root = document.getElementById('root');
  4 |


error: Missing semicolon (semi) at src/index.js:5:89:
  3 | const root = document.getElementById('root');
  4 |
> 5 | root.innerHTML = '<div style="padding: 20px"><h1>Welcome to 6cbcd59625d4f957</h1></div>'
    |                                                                                         ^
  6 |
  7 | // This is needed for Hot Module Replacement
  8 | if (module.hot) {


1 error and 1 warning found.
1 error and 1 warning potentially fixable with the `--fix` option.
 @ multi (webpack)-dev-server/client?http://localhost:5000 (webpack)/hot/dev-server.js ./src/index
^C

/var/folders/dl/9lrzd5110zlft676qdpr7xn40000gp/T/6cbcd59625d4f957
❯ yarn build
yarn run v1.3.2
$ neutrino build
✖ Building project failed
./src/index.js
Module build failed: Module failed because of a eslint error.
warning: 'use strict' is unnecessary inside of modules (strict) at src/index.js:1:1:
> 1 | 'use strict';
    | ^
  2 |
  3 | const root = document.getElementById('root');
  4 |


error: Missing semicolon (semi) at src/index.js:5:89:
  3 | const root = document.getElementById('root');
  4 |
> 5 | root.innerHTML = '<div style="padding: 20px"><h1>Welcome to 6cbcd59625d4f957</h1></div>'
    |                                                                                         ^
  6 |
  7 | // This is needed for Hot Module Replacement
  8 | if (module.hot) {


1 error and 1 warning found.
1 error and 1 warning potentially fixable with the `--fix` option.
 @ multi ./src/index
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

@eliperelman eliperelman added this to the v8 milestone Dec 2, 2017
@eliperelman eliperelman self-assigned this Dec 2, 2017
@eliperelman eliperelman requested a review from a team December 2, 2017 01:21
@eliperelman eliperelman merged commit 4391630 into neutrinojs:master Dec 2, 2017
@edmorley edmorley removed the request for review from a team May 14, 2018 10:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

Lint and build tasks display lint warnings differently
1 participant