Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Use a stricter import order #189

Merged
merged 1 commit into from
Oct 25, 2018
Merged

Use a stricter import order #189

merged 1 commit into from
Oct 25, 2018

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Oct 25, 2018

A while ago we talked about ordering imports in #web-foundation-tech.

General opinion was alphabetic ordering is annoying but grouping types of imports - node buildins, vs npm modules vs relative paths etc - would be handy as we already aim to do that anyway.

This updates our import/order rule to be a bit stricter around forcing ordering based upon the type of import to the order goes internal imports (components/Blah) then parents (../Blah) then siblings (./Blah) instead of allowing those to be intermingled.

No ordering inside those groups is enforced, which shall keep the "no alphabets" group happy. And yes this has an autofix.

See https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md for more info

Copy link
Contributor

@cartogram cartogram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration for this rule is interesting. Changes LGTM 👍. Give the people what they want.

Force the order to be builtin, external, internal, parent, sibling
instead of allowing intermingling.
@BPScott BPScott merged commit 5a88680 into master Oct 25, 2018
@BPScott BPScott deleted the stricter-import-order branch October 25, 2018 18:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants