Pattern: Wrong import statement order
Issue: -
Requires that import statements be alphabetized.
Enforce a consistent ordering for ES6 imports:
- Named imports must be alphabetized (i.e.
import {A, B, C} from "foo";
)- The exact ordering can be controlled by the named-imports-order option.
- longName as name imports are ordered by longName.
- Import sources must be alphabetized within groups, i.e.:
import * as foo from "a"; import * as bar from "b";
- Groups of imports are delineated by blank lines. You can use these to group imports however you like, e.g. by first- vs. third-party or thematical ly.