Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arnaud-barre/prettier-plugin-sort-imports

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arnaud-barre/prettier-plugin-sort-imports

A small low-overhead TS-only Prettier plugin to sort imports

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
increased by4.76%
Maintainers
1
Weekly downloads
 
Created
Source

@arnaud-barre/prettier-plugin-sort-imports npm

A small low-overhead TS-only Prettier plugin to sort imports. Inspired by IanVS/prettier-plugin-import-sort.

This package is using a monkey-patch of the estree pinter preprocess to avoid a double code -> AST -> code pass. This is obviously not stable, but allows to get everything I need for 200 lines of code and without any dependency.

The plugin is published as an ESM module, so it requires prettier 3.

This plugin sorts imports into 4 groups (bun:, node:, <packages>, .<relative>), which a natural sorting inside each group. Comments follow the imports they are attached too.

Features

  • Don't reorder imports across side effect boundaries
  • Enforce node: prefix
  • Merge imports statement from the same module

FAQs

Package last updated on 14 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc