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

Latest commit

 

History

History
27 lines (16 loc) · 729 Bytes

sort-import-destructures.md

File metadata and controls

27 lines (16 loc) · 729 Bytes

Sort destructured names in import statements (sort-import-destructures)

This rule enforces (and autofixes) that destructured names in import statements are sorted.

Rule Details

Examples of incorrect code for this rule:

import {xyz, abc} from 'other';

import main, {second as alias, first as nickname} from 'something';

Examples of correct code for this rule:

import {abc, xyz} from 'other';

import main, {first as nickname, second as alias} from 'something';

Note how the sorting is based on the name of the imported export (eg. first, second) and not the local name (eg. nickname, alias).

Further Reading