1.0.0 • Published 4 years ago
eslint-plugin-beautiful-imports v1.0.0
Beautiful imports
This plugin sorts imports strictly in alphabetical order by first letter of import statement. It's based on sort-imports rule but it has a few differences.
It makes your imports look like this:
import 'alice'
import 'bob'
import * as Ant from 'ant'
import * as Bear from 'bear'
import Adam from 'adam'
import { B as A, C } from 'letters'
import David from 'david'
import { E, F as H } from 'other-letters'
If this project has helped you out, please support us with a star 🌟
Installation
You need ESLint to be installed for this plugin to work
Then install eslint-plugin-beautiful-imports
npm install --save eslint-plugin-beautiful-imports
or
yard add eslint-plugin-beautiful-imports
Add "beautiful-imports" to the plugins section
{"plugins": ["beautiful-imports"]}
Add beautiful-imports/sort-imports
to eslint rules
Parameters
This plugin has the following parameters:
- allowSeparatedGroups (default: false) - When true the rule checks the sorting of import declaration statements only for those that appear on consecutive lines. In other words, a blank line or a comment line or line with any other statement after an import declaration statement will reset the sorting of import declaration statements.