`@4c/import-sort
An import-sort style config and
custom parser for Javascript and Typescript (using babel).
Install
yarn add -D @4c/import-sort
Configuration
In a package.json
:
{
"importSort": {
".js": {
"style": "@4c/import-sort",
"parser": "@4c/import-sort/parser"
},
".ts, .tsx": {
"style": "@4c/import-sort",
"parser": "@4c/import-sort/parser-ts"
}
}
}
Style
Imports are sorted into three groups: third party code, local code, styles and assets
import fs from 'fs';
import pick from 'lodash/pick';
import Env from '@4c/env';
import Foo from '../Foo';
import Bar from './Bar';
import Baz from './Baz';
import styles from 'styles.scss';