import-sort-style-fengk
v1.1.0
Published
An import-sort style for my own to sort React project modules
Downloads
20
Readme
import-sort-style-fengk
why to create this
- to verify my own code since no satisfied tools found in eslint plugins. (Maybe
eslint-plugin-import
is great, but couldn't auto fix)
how it work
- this is based on import-sort. You may need to create a
.importsortrc
file in your working directory just like this:
{
".js, .jsx": {
"parser": "babylon",
"style": "fengk"
}
}
npm i import-sort-style-fengk --save-dev
or just put this package into yournode_modules
instead of writing dependencies into yourpackage.json
result
// Modules from the Node.js "standard" Library sorted by name
import { readFile, writeFile } from 'fs'
import path from 'path'
// Modules about React
import React from 'react'
import ReactDOM from 'react-dom'
import { Button } from 'antd'
// Absolute modules with side effects(not styled modules)
import 'a'
import 'b'
// Absolute modules from third-party modules
import aa from 'aa'
import bb from 'bb'
// Relative modules sorted by "relative depth" and then by name
import aaa from '././aaa'
import bbb from '././bbb'
import aaaa from './a'
import bbbb from './b'
// Absolute styled modules
import 'index.css'
// Firts-party styled modules
import styles from "./index.css"
other
- Thanks for using or referencing. The best way to write your own style is to look at existing styles like this style or the orgin author's style