-
Notifications
You must be signed in to change notification settings - Fork 40
Sorter violates directives_ordering lint rule when file has named imports #28
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
Comments
👋 Hello! Thanks for submitting a issue 😄! @Matt-Gleich Will try to respond as soon as possible. |
Hello! What version of import_sorter are you using? Please fill out the template |
Sorry, I hit submit by accidentally ctrl+entering! |
No worries! |
Awesome, thank you! I will debug it when I get out of work in an hour or so. |
Hi Matt! I think I've almost finished an implementation for this if you're up for the PR! The parsing for imports is actually pretty complicated, because, for my usecase, I leverage a lot of the import related Dart features. That being said, I've got a WIP version that conforms to 90% of the Dart language specification. Would be happy to answer any questions that you would have about it! |
It will be 100% tested, and I will ensure that previous tests still pass. |
Hey! Yeah, that would super great! Sorry about the lack of work on this, I am super busy with my internship recently. |
No worries! |
As an FYI, the issue was around lack of support for "multiline", as opposed to the |
@andrewrowe-wk any update on this? If need be I can start work on it |
@Matt-Gleich Hi Matt! Yes, I've been working on it, and have a big PR I'm getting together, but I can only work on it on Fridays now, because I have other work that has come up. The change is pretty substantial, and the problem of sorting import statements is not very straightforward due to Dart the dart language specification. I ended up having to import a parser combinator library, to fully parse the import statements. The link to my branch is here if you want to take a look: https://github.com/andrewrowe-wk/import_sorter/tree/issue_28_fix_for_directive_ordering_lint_rule |
Awesome! Looks pretty great so far. No rush on the timing btw, keep it up tho! |
See #63 |
Describe the bug
In a file that contains relative import paths, and an absolute path to a named import, then the Dart linting rule
directives_ordering
fails.To Reproduce
analysis_options.yaml
file, enable thedirectives_ordering
option (more info here: http://dart-lang.github.io/linter/lints/directives_ordering.html)Expected behavior
The import sorter should respect conventional dart styling guidelines.
Screenshots
If applicable, add screenshots to help explain your problem.
Meta Information:
>=2.7.1 <3.0.0
import_sorter
Version: 4.2.1Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: