@briankosw/prettier-plugin-sort-imports

0.0.5 • Public • Published

@briankosw/prettier-plugin-sort-imports

A Prettier plugin that sorts your import declarations.

Setup

Install the plugin:

# Yarn
yarn add -D @briankosw/prettier-plugin-sort-imports

# npm
npm install -D @briankosw/prettier-plugin-sort-imports

Configure the plugin:

{
  "addEmptyLinesBetweenImportGroups": boolean  # default: false
  "importGroups": ["builtin", "src", "*"]      # default: ["builtin", "*"]
}

If, for whatever reason, you want the plugin to not run for a file, then add the following pragma to the file:

// @briankosw/prettier-plugin-sort-imports:disable

Currently, the plugin only supports TypeScript.

Disclaimer

This plugin modifies the AST of the passed in code, which goes against Prettier's principle of not mutating the AST.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.52,546latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.52,546
0.0.41
0.0.31
0.0.21
0.0.11
0.0.01

Package Sidebar

Install

npm i @briankosw/prettier-plugin-sort-imports

Weekly Downloads

2,551

Version

0.0.5

License

MIT

Unpacked Size

28.2 MB

Total Files

429

Last publish

Collaborators

  • briankosw