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.

typescript[satisfies] bugs in complex ternary conditions

See original GitHub issue
package.json {
    "@typescript-eslint/eslint-plugin": "5.46.0",
    "@typescript-eslint/parser": "5.46.0",
    "prettier": "2.8.1",
    "typescript": "4.9.3"
}

Bug: Screenshot 2022-12-10 at 17 30 03

What happens: The formatter, somehow, stops working on the file and sometimes I have to restart Intellij IDEA Ultimate for the formatter to start working across all the project again.

Expected behavior: not to bug because this is valid typescript code.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cmolinacommented, Dec 26, 2022

I just discovered that it works if I set "parser": "babel-ts". I don’t know why it doesn’t work with typescript though since it should be supported by @typescript-eslint/typescript-estree.

{
  "semi": false,
  "overrides": [
    {
      "files": ["*.ts", "*.tsx"],
      "options": {
        "parser": "babel-ts"
      }
    }
  ]
}

0reactions
github-actions[bot]commented, Dec 28, 2022

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strange bug with ternary -> not respecting union with undefined
Your issue essentially boils down to the array access returning the type { a: number, b: string } , and not { a:...
Read more >
A compiler error while using ternary operator - Stack Overflow
I am using typescript 0.9. 0.1 in Visual Studio 2012. At a time I use ternary operator in my code, compiler throws an...
Read more >
Ternary operators should not be nested - SonarSource Rules
TypeScript static code analysis. Unique rules to find Bugs, Vulnerabilities, Security Hotspots, and Code Smells in your TYPESCRIPT code.
Read more >
Using The Ternary Operator And Nullish Coalescing
What is the most succinct and elegant method of writing one-liner conditionals? Let's look at the ternary operator and nullish coalescing!
Read more >
Is using nested ternary statements a bad practice? - Quora
But no, using nested ternary expressions is not a bad practice. In fact, there are benefits to using ternaries over if statements because...
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