Capital import-sort style
npm install import-sort-style-capitalCapital style for import-sort.
This style is just a fork of import-sort-style-retino.
``js
// Modules that start with 'react'
import React from 'react';
import ReactDom from 'react-dom';
// Other Modules
import _, {...} from 'first-module';
import _, {...} from 'second-module';
// Modules starting with capital letter
import localModule from 'LocalModule';
// Siblings and parents
import things from '../grand-parent';
import name from '../parent';
import sibling from './sibling';
// Imports without members
import "style.css"
`
These instrutions use prettier, which is my preferred
method of enforcing import sort order.
`shInstall prettier-plugin-import-sort
yarn add -D prettier-plugin-import-sort
Then add on your root
package.json:`json
{
"importSort": {
".js, .jsx": {
"parser": "babylon",
"style": "capital"
},
".ts, .tsx": {
"parser": "typescript",
"style": "capital"
}
}
}
`Development
I've used yarn, and
tsdx, which provides scaffolding for
TypeScript libraries.
`sh
Install yarn, if you don't have it
curl -o- -L https://yarnpkg.com/install.sh | bashInstall dependencies
yarn installBuild upon changes (development mode)
yarn run devLint code
yarn run lintTest code
yarn run testBuild code
yarn run build
``MIT, https://wes.dev/LICENSE.txt