VS 代码加载 React 文件图标而不是 JS 文件图标

VS Code Loading React file icon instead of JS file icon

我安装了 material 图标,它可以完美地显示 JS 图标,但最近 VS 代码出于某种原因正在加载 JS 文件的反应图标,我不明白为什么。

Settings.json:

   {
    "workbench.startupEditor": "newUntitledFile",
    "workbench.iconTheme": "material-icon-theme",
    "workbench.preferredLightColorTheme": "Monokai++",
    "window.menuBarVisibility": "toggle",
    "editor.minimap.enabled": false,
    "javascript.updateImportsOnFileMove.enabled": "always",
    "[dart]": {
        "editor.formatOnSave": true,
        "editor.formatOnType": true,
        "editor.rulers": [
            80
        ],
        "editor.selectionHighlight": false,
        "editor.suggest.snippetsPreventQuickSuggestions": false,
        "editor.suggestSelection": "first",
        "editor.tabCompletion": "onlySnippets",
        "editor.wordBasedSuggestions": false
    },
    "dart.previewLsp": true,
    "dart.debugExternalLibraries": true,
    "dart.debugSdkLibraries": false,
    "[javascriptreact]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "liveServer.settings.donotShowInfoMsg": true,
    "editor.formatOnSave": true,
    "[html]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[css]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "workbench.colorTheme": "Monokai++",
    "editor.fontWeight": "normal",
    "material-icon-theme.activeIconPack": "none",
    "material-icon-theme.folders.associations": {
    
    },
    "material-icon-theme.files.associations": {
       
    }
}

尝试将以下设置添加到您的配置中:

"material-icon-theme.files.associations": {
    "**.js": "javascript",
}

通过此设置,您可以将每个 .js 文件的图标设置为 javascript 图标