You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using prettier in conjunction with eslint, and so far my main obstacle is that prettier disagrees with how I've configured imports to be sorted in eslint. So when I save a TypeScript file, for example, the imports will get sorted according to prettier's philosophy, instead of according to my preference.
My preferred order, configured in eslint, looks like this:
But I can only get that order if I disable prettier altogether. But then I don't get a lot of the other benefits from prettier that I really like. I've experimented with various plugins to integrate prettier with eslint, but no luck so far. Prettier seems to always override this. With almost all other rules I don't mind prettier overriding them, but with this one I do care.
Now I know that prettier doesn't offer an option to disable this. But I thought, maybe it would be possible with a plugin? I just have no clue how to write a plugin that basically says "ignore import statements, and other than that, just do what you'd normally do".
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using prettier in conjunction with eslint, and so far my main obstacle is that prettier disagrees with how I've configured imports to be sorted in eslint. So when I save a TypeScript file, for example, the imports will get sorted according to prettier's philosophy, instead of according to my preference.
My preferred order, configured in eslint, looks like this:
But I can only get that order if I disable prettier altogether. But then I don't get a lot of the other benefits from prettier that I really like. I've experimented with various plugins to integrate prettier with eslint, but no luck so far. Prettier seems to always override this. With almost all other rules I don't mind prettier overriding them, but with this one I do care.
Now I know that prettier doesn't offer an option to disable this. But I thought, maybe it would be possible with a plugin? I just have no clue how to write a plugin that basically says "ignore import statements, and other than that, just do what you'd normally do".
Beta Was this translation helpful? Give feedback.
All reactions