question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prettier-eslint-cli does not throw eslint's errors

See original GitHub issue
  • prettier-eslint-cli version: 4.1.1
  • prettier-eslint version: 6.4.2
  • prettier version: 1.5.2
  • eslint 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.

capture d ecran 2017-07-12 a 14 00 36

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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
humanchimpcommented, Aug 27, 2019

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.

0reactions
arfacommented, Jul 13, 2017

I will do it 😄

It will be a PR on prettier-eslint

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found