Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
How do I interpret Prettier --debug-check output?

I am using prettier --debug-check and it is producing the following error information...

[error] my.js: ast(input) !== ast(prettier(input))
[error] Index:
[error] ===================================================================
[error] ---
[error] +++
[error] @@ -3497,8 +3497,6 @@
[error]                                "argument": {
[error]                                  "type": "LogicalExpression",
[error] -                                "operator": "&&",
[error]                                  "left": {
[error]                                    "type": "LogicalExpression",
[error] -                                  "operator": "&&",
[error]                                    "left": {
[error]                                      "type": "LogicalExpression",
[error] @@ -3529,4 +3527,5 @@
[error]                                      }
[error]                                    },
[error] +                                  "operator": "&&",
[error]                                    "right": {
[error]                                      "type": "Identifier",
[error] @@ -3534,4 +3533,5 @@
[error]                                    }
[error]                                  },
[error] +                                "operator": "&&",
[error]                                  "right": {
[error]                                    "type": "BinaryExpression",
[error]
[error] Index:
[error] ===================================================================
...
... below this appears to be a diff between the original file and the 
... prettier output...there is a huge difference between them.

I am having a hard time determining what in the original file is resulting in this error being produced. I assume that the error information is trying to tell me where to look...is it?

How can I resolve this error so prettier can be used to format the file?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Perhaps someone else will be able to provide a better answer.

The error output provided by --debug-check is uninterpretable.

To resolve the issue, a method that worked was to comment out code until I was able to narrow it down to the line that Pettier was complaining about.

The line had the form:

return (a && a.length > 0) && (b && b.length > 0);

Now, clearly the parenthesis are not needed, but including them leads to two different ASTs.

The solution was to write the line without the parenthesis:

return a && a.length > 0 && b && b.length > 0;

Doing so stops Prettier from complaining.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!