0.5.0
Changes:
- Imports are now grouped (see separate section at the bottom).
tab
andmax_line_length
has been moved to configuration (was previously controlled by the editor)goto
is now no longer experimental (after a few important improvements was made)- The
import-js
CLI tool is now able to overwrite a file (--overwrite
flag), as well as rewriting all imports for a file (--rewrite
flag).
Grouping
Starting with version 0.5.0, imports are now split into groups. Package
dependencies come first, followed by one or more groups containing "internal"
imports. It will look something like this:
import React from 'react';
import { debounce } from 'underscore';
import Button from 'components/Button'
import Icon from 'components/Icon';
To prepare your codebase for the change in one sweep, you can run the following
command:
find ./app -name "**.js" -exec import-js {} --overwrite --rewrite \;
You will need to adapt it to fit your project. And please note that this command
is destructive - it will overwrite all files matched by the find
pattern.
Thanks to @lencioni for making the grouping feature happen!