eslint-plugin-import-order-alphabetical
eslint-plugin-import-order-alphabetical copied to clipboard
Sort by default export name
Having:
import PropTypes from 'prop-types';
import Button from 'custom-button';
import SearchBox from 'custom-search-box';
I would like to have them sorted:
import Button from 'custom-button';
import PropTypes from 'prop-types';
import SearchBox from 'custom-search-box';
Currently the plugin sorts like this:
import Button from 'custom-button';
import SearchBox from 'custom-search-box';
import PropTypes from 'prop-types';
I think sort-imports has that behaviour.
https://eslint.org/docs/rules/sort-imports
I am evaluating this repo specifically because it sorts by path rather than the name of the import.
@daekano Do you know of a way for sort-imports
to sort within groups? This is what I am trying to achieve. I am using eslint-plugin-import
to group the imports, but it does not have the ability to sort them, this package does :) From eslint-plugin-import
I ended up here.
I do not want to change the current behaviour, just add the ability to choose by what you want to sort.