import-sort-style-fengk
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

  1. 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"
    }
}
  1. npm i import-sort-style-fengk --save-dev or just put this package into your node_modules instead of writing dependencies into your package.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

Readme

Keywords

Package Sidebar

Install

npm i import-sort-style-fengk

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

2.78 kB

Total Files

2

Last publish

Collaborators

  • fengkun