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
This turned out to be more complex than I initially anticipated; the prettier plugin I mentioned doesn’t work with solidity out of the box because it’s missing a parser. Therefore I see three possible solutions:
Fork and adjust the plugin to support solidity (I think it’s doable by reusing the existing solidity parser) -> this would imply maintaining the plugin
Use foundry instead of prettier for formatting solidity contracts
Continue without import sorting
I’m personally leaning towards option 2. What do you think?
EDIT: Foundry can only sort imports alphabetically, so it is impossible to use it, leaving 1 and 3 as the only options. Going with 1 will imply adjusting the complexity from 2 to 5/8
Context / issue
While working on creating Interfaces for Safe, importing order inconsistency was found.
Proposed solution
Using a npm package like: https://github.com/trivago/prettier-plugin-sort-imports with settings mentioned in like: foundry-rs/foundry#3396 (Thanks to @mmv08 for finding it out!)
Alternatives
Doing it manually. It can become a tedious process in the long run though.
Additional context
Initial discussion took place here: #722 (comment)
The text was updated successfully, but these errors were encountered: