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.

How can I get rid of prettier completely?

See original GitHub issue

Current Behavior

Working with prettier is PITA. I don’t like how it formats my code.

Desired Behavior

I would like to get rid of it completely. What can I do about it?

Suggested Solution

  • Expose tsdx config to allow to remove and uninstall prettier (or any other component). https://github.com/jaredpalmer/tsdx/issues/634
  • Separate prettier from eslint tsdx lint to tsdx format.
  • Add option to remove prettier to install menu for tsdx.

Who does this impact? Who is this for?

It will only affect powerusers who like to control their configurations.

Describe alternatives you’ve considered

.prettierignore

Additional context

https://github.com/jaredpalmer/tsdx/issues/917 https://github.com/jaredpalmer/tsdx/issues/634

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
agilgur5commented, Apr 11, 2022

so tsdx uses something like eslint-plugin-prettier and runs prettier within eslint only

Yup exactly.

after eslint finds an error? And then, if eslint finds an error, it doesn’t send prettier the whole document, but just that part of code, so prettier effectively doesn’t do anything?

I don’t totally know how eslint-plugin-prettier works under-the-hood, so can’t answer that implementation detail question with confidence. But suffice to say, that’s not TSDX implementation, but eslint-plugin-prettier implementation.

But I assume this rule 'prettier/prettier': 'off' only works for this particular setup, right?

Yea, it’s turning off the ruleset that’s associated with eslint-plugin-prettier. That works with TSDX because your config is (currently) merged with TSDX’s. Normally your ESLint config would have to turn on the rules somewhere but because of how it’s currently set-up it’s done invisibly in a potentially unintuitive way. See also #634 , which you’ve already linked

PS: I managed to disable prettier with .prettierignore by adding all *.

That works too I suppose 👍

Closing this out as the symptoms have been resolved and the root cause already has a few issues open for it to decouple parts of TSDX

0reactions
ackvfcommented, Apr 11, 2022

It’s been few years since I was setting that up, I may need to refresh my knowledge.

I thought that it’s just extending prettier rules, so that you don’t get errors in IDE for prettier related issues. I was under the impression that prettier fixes everything regardless of any errors displayed in IDE.

Anyway I was just going through this https://prettier.io/docs/en/integrating-with-linters.html, so tsdx uses something like eslint-plugin-prettier and runs prettier within eslint only after eslint finds an error? And then, if eslint finds an error, it doesn’t send prettier the whole document, but just that part of code, so prettier effectively doesn’t do anything?

That’s awesome. But I assume this rule 'prettier/prettier': 'off' only works for this particular setup, right? In setups where both eslint and prettier run separately, it won’t care what eslint lists in eslint config…

Thanks!

PS: I managed to disable prettier with .prettierignore by adding all *.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove prettier plugin from ESLint in VS Code?
What I tried so far: deleting repo and cloning it from github with correct ESLint file. configuring ESLint file from template with eslint...
Read more >
How to disable prettier in VSCode for a specific project?
On Windows/Linux - File > Preferences > Settings · On macOS - Code > Preferences > Settings.
Read more >
Ignoring Code - Prettier
Use .prettierignore to ignore (i.e. not reformat) certain files and folders completely. Use “prettier-ignore” comments to ignore parts of files.
Read more >
Disabling languages for Prettier (in VScode) | Zell Liew
It used to be straightforward to disable languages for Prettier in VSCode. You just added a prettier.disableLanguages setting and you were done.
Read more >
Remove prettier from eslint-config-react-native-community
Prettier eslint rules should be removed. Prettier is to forget about formatting, not to paint your code with red underlines everywhere.
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