New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@alesmenzel/prettier-sort-classes-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alesmenzel/prettier-sort-classes-plugin

Prettier plugin that sorts class names.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Prettier sort classes plugin

Prettier plugin that sorts class names based on a given config. If no config is provided or the class is not found in the config, the classes are sorted alphabetically (en locale).

Installation

npm install --save-dev @alesmenzel/prettier-sort-classes-plugin

Example

Assuming the following config

const CLASS_LIST = ['flex', 'flex-1', 'items-center', 'justify-between', 'gap-1', 'gap-2']

The following class names

<div className='gap-2 aaa flex bbb items-center justify-between ccc'>
  {/* ... */}
</div>

will be sorted as

<div className='flex items-center justify-between gap-2 aaa bbb ccc'>
  {/* ... */}
</div>

Usage

Add the plugin to your prettier plugin configuration.

module.exports = {
  // ...
  plugins: ['@alesmenzel/prettier-sort-classes-plugin'],
}

Keywords

prettier

FAQs

Package last updated on 12 Oct 2025

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