1.3.1 • Published 3 years ago
@alain00/eslint-plugin-import v1.3.1
eslint-plugin-import
This plugin intends to keep a clean import declaration and order.
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-import
:
npm install @alain00/eslint-plugin-import --save-dev
Usage
Add @alain00/import
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"@alain00/import"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@alain00/import/pretty": 2
}
}
Supported Rules
- Ensure an import declaration have the specifiers splitted into multiple lines. (
pretty
) - Ensure react import to be the first import. (
react-first
) - Ensure css imports to be the last import. (
css-last
) - Ensure function objects params have properties alphabetically sorted. (
sort-params
) - Ensure interface properties to be alphabetically sorted. (
sort-interface
)