eslint-plugin-sort-import
sort-import eslint
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-sort-import
:
$ npm install eslint-plugin-sort-import --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-sort-import
globally.
Usage
Add sort-import
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["sort-import"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"sort-import/order-import": [
"error",
{
"ignoreCase": true,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["react", "single", "multiple", "all", "none"]
}
]
}
}
Supported Rules
- Fill in provided rules here