Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options to move imports to top of file #695

Open
guy-borderless opened this issue Jan 16, 2025 · 0 comments
Open

Options to move imports to top of file #695

guy-borderless opened this issue Jan 16, 2025 · 0 comments

Comments

@guy-borderless
Copy link

guy-borderless commented Jan 16, 2025

Having imports at the top of the file is a common convention, and makes it easier to analyze the dependency structure at a glance.

Scrolling to the top of the file can be tedious and sloppy developers like myself may sometimes paste the import near the function they are writing and forget to move it to the top.
It would be pleasant to simply paste the import statement in the right scope and have it moved to the top on format. No need to change the order of imports in the file so this has no impact on semantics I think. This is useful for large files which unfortunately happen.

{
  "fmt": {
      "ImportsAtTopOfFile": true
    },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant