eslint-plugin-align-import
What is this?
This plugin / rule will align all your import statements:
from
;;;;;;;;;
to
;;;;;;;;;
Installation
You'll first need to install ESLint:
$ npm install eslint --save-dev
Next, install eslint-plugin-align-import
:
$ npm install eslint-plugin-align-import --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-align-import
globally.
Usage
Add babel-align-import
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
You might have to update the no-multi-spaces
rule to allow multiple spaces in front of import
:
There are two rules available:
rule | description |
---|---|
align-import/align-import | Aligns your import statements, this is probably the rule you're looking for. |
align-import/trim-import | This rule will remove any extra space around your import keyword. |