ESLint plugin with rules to sort imports effortlessly.
$ npm install eslint-plugin-jsort
This rule sorts & formats import declaration with a lot of flexibility using eslint --fix
.
JavaScript imports are frustrating and this tries to make them a bit easier to work with. Feel free to post any issues/suggestions you might have with the plugin on the issue tracker.
$ npm i eslint --save-dev
eslint-plugin-jsort
:$ npm install eslint-plugin-jsort --save-dev
jsort
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:{
"plugins": ["jsort"]
}
{
"rules": {
"jsort/sort-imports": [
"error",
{
/* `sort-imports` Additional Configuration */
}
],
"jsort/normalize-import-source": [
"error",
{
/* `normalize-import-source` Additional Configuration */
}
]
}
}
sort-imports
Additional Configuration" see jsort/sort-imports
docs.normalize-import-source
Additional Configuration" see jsort/normalize-import-source
docs
Written in Typescript. Workflows are defined in .envrc.sh
.
sort-imports
RuleAuthor | Estimated Hours |
---|---|
16.8 Hours | |
4.95 Hours | |
2 Hours |