eslint-plugin-beautiful-sort
eslint plugin for es6 imports sort by order like eslnt/sort-imports with fix option
Example
From
import './Test.css';
import {a,b,c} from 'a';
import C, {h} from 'j';
import A from 'g';
import * as Meme from 'meme';
import React from 'react';
To
import React from 'react';
import * as Meme from 'meme';
import A from 'g';
import C, {h} from 'j';
import {a,b,c} from 'a';
import './Test.css';
Requirements
node js: v14.15.1+
Usage
npm i -D eslint-plugin-beautiful-sort
{
"plugins": [
"beautiful-sort"
],
"rules": {
"beautiful-sort/import": [2, {
"special": ["react"],
"order": ["special", "namespace", "default", "defaultObj", "obj", "none"]
}]
}
}