prettier-eslint-cli does not throw eslint's errors
See original GitHub issueprettier-eslint-cli
version: 4.1.1prettier-eslint
version: 6.4.2prettier
version: 1.5.2eslint
version: 3.19.0
.eslintrc
:
{
"env": {
"browser": true,
"es6": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"extends": "defaults",
"plugins": [
"react"
],
"rules": {
"no-console": 2,
"no-const-assign": 2,
"no-unused-vars": 2,
"prefer-const": 2,
"semi": 2,
"comma-dangle": 0,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2
}
}
Problem description:
I have "no-console": 2
in my .eslintrc
file.
I put a console.log
in my code so when I run the command eslint
it throws an error.
However when I run prettier-eslint
it doesn’t show this error (I have tried all the --log-level
possible values).
If I am not missing something, it is supposed to show the error as it is mentioned in prettier-eslint
prettier-eslint will propagate errors when either prettier or eslint fails for one reason or another. In addition to propagating the errors, it will also log a specific message indicating what it was doing at the time of the failure.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Using Prettier and ESLint to automate formatting and fixing ...
Learn how to use ESLint and Prettier together to automatically format and fix JavaScript code in your projects.
Read more >Prettier doesn't format based on my eslint config - Stack Overflow
I have installed Eslint-Prettier extension on VSCode. I already have an .eslintrc.js and my default formatter (Eslint-prettier) doesn't ...
Read more >Install - Prettier
That's not a good idea when using Prettier, because we change how code is formatted ... If you use ESLint, install eslint-config-prettier to...
Read more >Working with Rules - ESLint - Pluggable JavaScript Linter
in the lib/rules directory: a source file (for example, no-extra-semi.js ) ... If this property isn't specified, ESLint will throw an error whenever...
Read more >How to Prevent Accidental Code Errors with ESLint, Prettier ...
For example: "no-console": "error" will block application compilation (it will throw an error) as soon as the linter detects console.log. {. "eslintConfig ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Our tree is large and it would be nice to only have to run one tool to format the files when nothing else is wrong, but that would throw when other eslint rules are violated so we don’t need to run the expensive operation against the entire tree twice. I can understand that it’s not the default behavior, but it seems reasonable to allow that as a configuration.
I will do it 😄
It will be a PR on prettier-eslint