Skip to content

Sort imports alphabetically (JS, TS) #504

Closed
@hyunbinseo

Description

@hyunbinseo

Things I do after scaffolding a project include manually saving *.js and *.ts files. With this setting enabled on VS Code:

{ "editor.codeActionsOnSave": { "source.organizeImports": "explicit" } }

ESLint, Vite configs and other files get their import sorted. For example:

// eslint.config.js (generated)
import prettier from 'eslint-config-prettier';
import js from '@eslint/js';
import { includeIgnoreFile } from '@eslint/compat';
// eslint.config.js (organized with VS Code)
import { includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';

I believe prettier-plugin-sort-imports uses the same order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions