You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @ts-checkimportpluginPerfectionistfrom'eslint-plugin-perfectionist'import{config,configs}from'typescript-eslint'exportdefaultconfig({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-importsimport'@/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.
@ntnyq Thank you for the details, a fix will come soon. Your reproduction case actually includes 2 bugs: one related to fallbackSort and one related to eslint-disable:
Describe the bug
Repro steps
Run
pnpm run lint
will report errors.Run
pnpm run lint:fix
error still exists.Comment
fallbackSort
option 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
Code
ESLint version
v9.22.0
ESLint Plugin Perfectionist version
v4.10.0
Additional comments
Since option
order
andtype
is the same as optionfallbackSort
.I think there is no need to attempt to apply fallback sort.
Maybe some deep equal check.
Validations
The text was updated successfully, but these errors were encountered: