Site-www: Remove "PREFER placing external 'package:' imports before other imports."

Created on 13 May 2020  路  6Comments  路  Source: dart-lang/site-www

I personally like the guideline, but we've never had automated tooling support for it and don't have any plans. I think the benefits of being able to easily automatically sort imports outweigh the benefits of seeing a package's own "package:" imports separately.

I think we should just remove the rule and let the previous rule cover all "package:" imports.

EffectiveDart e1-hours p2-medium

Most helpful comment

The sorting in Analysis Server also does not separate package's own package: imports from other package: imports.

All 6 comments

I personally like the guideline, but we've never had automated tooling support for it

Unless I'm misunderstanding, I _think_ we do?

I believe that the sorting analysis server provides and you can call out to in IntelliJ via the Code Menu respects this ordering.

image

(fyi @scheglov)

Also as of really recently (https://github.com/dart-lang/sdk/commit/7fe16ba8125ccaa275dfb29bf029cf5d4566c105) I added a quickfix that I've been wanting forever for the corresponding directives_ordering lint so the tooling is slowly catching up... 馃悓

We have support for sorting imports, but (as far as I know) it doesn't separate out a package's own "package:" imports from "package:" imports of other packages. At least tidy_dart does not support that, and I think that's the one that is most widely used inside Google.

The sorting in Analysis Server also does not separate package's own package: imports from other package: imports.

Ah, ok, cool. Thanks! In that case, bombs away :)

Is this done?

Fixed by #2405.

Was this page helpful?
0 / 5 - 0 ratings