-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Repro steps
-
Run
pnpm run lintwill report errors. -
Run
pnpm run lint:fixerror still exists. -
Comment
fallbackSortoption ineslint.config.mjs, no error reported.
Besides, if there is no // eslint-disable-next-line perfectionist/sort-imports, it still works fine.
Reproduction repo
https://github.com/ntnyq-dev/repro-perfectionist-sort-imports
Code example
Config
// @ts-check
import pluginPerfectionist from 'eslint-plugin-perfectionist'
import { config, configs } from 'typescript-eslint'
export default config(
{
extends: configs.recommended,
},
{
plugins: {
perfectionist: pluginPerfectionist,
},
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'perfectionist/sort-imports': [
'error',
{
fallbackSort: { order: 'asc', type: 'alphabetical' },
order: 'asc',
type: 'alphabetical',
groups: [
// Side effect style imports (e.g. 'normalize.css')
'side-effect-style',
// Styles (e.g. *.{css,scss,less})
'style',
/**
* Imports that don’t fit into any other group
*/
'unknown',
],
internalPattern: ['^~/.+', '^@/.+', '^#.+'],
},
],
},
},
)Code
import '@unocss/reset/tailwind.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import 'element-plus/theme-chalk/index.css'
import 'uno.css'
// COMMENT BELLOW is IMPORTANT
// eslint-disable-next-line perfectionist/sort-imports
import '@/styles/app.scss'ESLint version
v9.22.0
ESLint Plugin Perfectionist version
v4.10.0
Additional comments
Since option order and type is the same as option fallbackSort.
I think there is no need to attempt to apply fallback sort.
Maybe some deep equal check.
Validations
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
hugop95
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working