prettier-plugin-organize-class-members weekly downloads statistics
By wdfinch · npm · Prettier plugins
prettier plugin to organize javascript and typescript classes
prettier-plugin-organize-class-members has 453 recorded weekly downloads on npm, an increase of 58.4% over the past 30 days, ranking #1563 of 2,322 tracked listings.
About prettier-plugin-organize-class-members
Prettier Plugin: Organize Class Members
Organize your Javascript and Typescript classes to keep them consistent.
A plugin that makes Prettier organize your Javascript and Typescript class members.
Features
- 👍 Supports .js, .jsx, .ts, .tsx files.
- 🚀 Works out of the box - zero-config required.
- 💪 Customizable - control exactly how your classes are organized.
- 🤓 No more messy diffs or merge conflicts from people using different class orderings strategies.
- 🤯 Never worry about manually ordering class members again
- 😌 Safe - modifying the order of class members has no effect on code execution.
Caveat
This plugin inherits, extends, and overrides the built-in Prettier parsers for babel and typescript. Therefore it's
incompatible with other plugins that do the same. See the troubleshooting section below for more details.
Stability
This plugin is new and currently in beta. It has not been extensively tested in large complex projects. Therefore if you are using this plugin for the first time, please run prettier in dry run mode or in a state where you can easily rollback.
Installation
npm install --save-dev prettier-plugin-organize-class-members
yarn add --dev prettier-plugin-organize-class-members
prettier is a peer dependencies, so make sure you have those installed in your project.
Usage
The plugin will be loaded by Prettier automatically. No configuration needed.
Files containing the substring // organize-class-members-ignore or // tslint:disable:organize-class-members are
skipped.
Configuration
This plugin works out of the box and requires no configuration to get started. You may customize how this plugin organizes your classes using the options below in your prettier config file.
Note if you are using a .prettierrc.cjs, you may add the following line to get type support for the options:
// .prettierrc.cjs
module.exports = {
plugins: [require.resolve('prettier-plugin-organize-class-members')],
// your other prettier options
}
Options
classSectionOrder
Details: Specify the order of various sections in your classes.
Type: string[]
Supported values:
constructor- Matches the constructor function of the class.methods- Matches all non-static methods.staticMethods- Matches all static methods.properties- Matches all non-static declared properties/fields in the class.staticProperties- Matches all static declared properties/fields in the class.
Default Value: ['staticProperties','staticMethods','properties','constructor','methods']
If you modify this option, you must follow these rules:
- Each value must be used.
- No duplicates or unsupported strings may be used.
// .prettierrc.cjs
module.exports = {
// invalid ❌ - missing staticProperties and methods
classSectionOrder: ['constructor', 'staticMethods', 'properties'],
// invalid ❌ - constructor is duplcated
classSectionOrder: ['constructor', 'constructor', 'properties'],
// invalid ❌ - unsupported values are used
classSectionOrder: ['someRandomValue', 'someOtherRandomValue', 'properties'],
// valid ✅
classSectionOrder: ['constructor', 'methods', 'staticMethods', 'properties', 'staticProperties']
}
classAccessibilityOrder
Details: Within a section, specify the order of members (methods and properties) by accessibility.
Type: string[]
Supported values:
private- Matches private members. The following members are considered private.- Those preceded by the typescript
privatekeyword. - Those preceded with a
#. See here for more details. - Those preceded with an
_(conventional private members). See here for more details.
- Those preceded by the typescript
protected- Matches all protected members. The following members are considered protected.- Those preceded by the typescript
protectedkeyword.
- Those preceded by the typescript
public- Matches all public members. The following members are considered public.- Those preceded by the typescript
publickeyword. - Those preceded by neither
_,#,private, norprotected.
- Those preceded by the typescript
Default Value: ['public','protected','private']
If you modify this option, you must follow these rules:
- Each value must be used.
- No duplicates or unsupported strings may be used.
// .prettierrc.cjs
module.exports = {
// invalid ❌ - missing public
classAccessibilityOrder: ['private', 'protected'],
// invalid ❌ - private is duplcated
classAccessibilityOrder: ['private', 'private', 'protected'],
// invalid ❌ - unsupported values are used
classAccessibilityOrder: ['someRandomValue', 'someOtherRandomValue', 'private'],
// valid ✅
classSectionOrder: ['private', 'public', 'protected']
}
classGroupOrder
Details: Within levels of accessibility, divide the members into groups. For example getter and setter methods can be grouped together.
Type: string[]
Supported values:
gettersAndSetters- Matches getter and setter methods. A getter or setter is one of the following:- A method with the word
getorsetat the start (ex:getDog() {}) - A typescript getter and or setter. See here for more details.
- A method with the word
everythingElse- Matches all remaining members that could not be assigned to a group.
Default Value: ['everythingElse']
If you modify this option, you must follow these rules:…
Description from the npm listing.
- prettier
- prettier-plugin
- typescript
- classes
- organize-classes
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm Prettier plugins plugins
All 20 prettier-plugin-organize-class-members alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/prettier-plugin-organize-class-members. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.