Optimize Imports issues

I'm having an issue where the optimizing imports functionality is causing errors in my code which has forced me to disable it manually.

For example a react function with this import
import CircularProgress from '@mui/material/CircularProgress';

After the optimize imports will result in a final import of both imports

import CircularProgress from '@mui/material/CircularProgress';
import { CircularProgress } from '@mui/material';

This is causing issue as i'm getting duplicate declarations in all of my files. Is there any way to update my settings to resolve this or is this a bug?

EDIT: I've already tried using the Do not import exactly from:feature with the pattern @mui/materialbut that doesn't seem to work either and there doesn't seem to be a use single class import feature anymore
 

IntelliJ IDEA 2023.2.5 (Ultimate Edition)
Build #IU-232.10227.8, built on November 9, 2023
Licensed to Tyler Pham
Subscription is active until December 21, 2023.
Runtime version: 17.0.9+7-b1000.46 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.6.8
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 10
Metal Rendering is ON
Registry:
    editor.focus.mode.color.light=5a5d63
    ide.editor.tab.selection.animation=true
    ide.animate.toolwindows=true
    ide.new.editor.tabs.vertical.borders=true
    ide.experimental.ui=true
    ide.balloon.shadow.size=0
    editor.focus.mode.color.dark=5a5d63

Non-Bundled Plugins:
    com.kagof.pokeprogress (2.1.1)
    AceJump (3.8.17)
    IdeaVIM (2.7.5)
    org.jetbrains.IdeaVim-EasyMotion (1.10)
    com.joshestein.ideavim-quickscope (1.0.11)
    com.intellij.ml.llm (232.9826)
    Pythonid (232.10227.8)
    com.chrisrm.idea.MaterialThemeUI (8.12.6)

Kotlin: 232-1.9.0-IJ10227.8
0

I think I found the fix, the issue was I was applying the pattern to the javascript import rules not the typescript import rules

0

请先登录再写评论。