import-sort-style-retino
Retino style for import-sort.
Credits
This style is just a fork of import-sort-style-wes.
Sorting Example
import React from 'react';
import ReactDom from 'react-dom';
import _, {...} from 'first-module';
import _, {...} from 'second-module';
import localModule from 'localModule';
import things from '../grand-parent';
import name from '../parent';
import sibling from './sibling';
import "style.css"
Usage
These instrutions use prettier, which is my preferred
method of enforcing import sort order.
yarn add -D prettier-plugin-import-sort
yarn add -D import-sort-style-retino
Then add on your root package.json
:
{
"importSort": {
".js, .jsx": {
"parser": "babylon",
"style": "retino"
},
".ts, .tsx": {
"parser": "typescript",
"style": "retino"
}
}
}
Config
Use .import-sort-style-retino-config
file. Used variables:
RETINO_OUR_MODULES_NAMES
selects which modules should be threated as a local modules (and appear in the second group)
Development
I've used yarn, and
tsdx, which provides scaffolding for
TypeScript libraries.
curl -o- -L https://yarnpkg.com/install.sh | bash
yarn install
yarn run dev
yarn run lint
yarn run test
yarn run build
License
MIT, https://wes.dev/LICENSE.txt