I can not find the documentation for configuring the "eslint-plugin-import" rules.
I would like to sort my imports alphabetically by class/interface/etc.. name without taking into consideration the file path.
For example, with my current configuration, here is how my imports are sorted by ESLint:
import React from 'react';
import './App.css';
import MenuIcon from '@mui/icons-material/Menu'; <---------------- Look at this line
import AppBar from '@mui/material/AppBar';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import IconButton from '@mui/material/IconButton';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import logo from './logo.svg';
Here is the configuration I use
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal"
],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": [
"react"
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
I would like to sort them this way:
import React from 'react';
import './App.css';
import AppBar from '@mui/material/AppBar';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import IconButton from '@mui/material/IconButton';
import MenuIcon from '@mui/icons-material/Menu'; <---------------- Look at this line
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import logo from './logo.svg';