Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-plugin-perfectionist

azat-io2.6mMIT4.10.1TypeScript support: included

ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.

eslint, eslint-plugin, perfectionist

readme

ESLint Plugin Perfectionist

ESLint Plugin Perfectionist logo

Version Monthly Download Code Coverage GitHub License

An ESLint plugin that sets rules to format your code and make it consistent.

This plugin defines rules for sorting various data, such as objects, imports, TypeScript types, enums, JSX props, Svelte attributes, etc. alphabetically, naturally, or by line length.

All rules are automatically fixable. It's safe!

Why

Sorting imports and properties in software development offers numerous benefits:

  • Readability: Finding declarations in a sorted, large list is a little faster. Remember that you read the code much more often than you write it.

  • Maintainability: Sorting imports and properties is considered a good practice in software development, contributing to code quality and consistency across the codebase.

  • Code Review and Collaboration: If you set rules that say you can only do things one way, no one will have to spend time thinking about how to do it.

  • Code Uniformity: When all code looks exactly the same, it is very hard to see who wrote it, which makes achieving the lofty goal of collective code ownership easier.

  • Aesthetics: This not only provides functional benefits, but also gives the code an aesthetic appeal, visually pleasing and harmonious structure. Take your code to a beauty salon!

Documentation

See docs.

Alphabetical Sorting

<picture> <source srcset="https://raw.githubusercontent.com/azat-io/eslint-plugin-perfectionist/main/docs/public/examples/example-alphabetical-light.webp" media="(prefers-color-scheme: light)" /> <source srcset="https://raw.githubusercontent.com/azat-io/eslint-plugin-perfectionist/main/docs/public/examples/example-alphabetical-dark.webp" media="(prefers-color-scheme: dark)" /> ESLint Plugin Perfectionist alphabetical usage example </picture>

Sorting by Line Length

<picture> <source srcset="https://raw.githubusercontent.com/azat-io/eslint-plugin-perfectionist/main/docs/public/examples/example-line-length-light.webp" media="(prefers-color-scheme: light)" /> <source srcset="https://raw.githubusercontent.com/azat-io/eslint-plugin-perfectionist/main/docs/public/examples/example-line-length-dark.webp" media="(prefers-color-scheme: dark)" /> ESLint Plugin Perfectionist line length usage example </picture>

Installation

You'll first need to install ESLint v8.45.0 or greater:

npm install --save-dev eslint

Next, install eslint-plugin-perfectionist:

npm install --save-dev eslint-plugin-perfectionist

Usage

Add eslint-plugin-perfectionist to the plugins section of the ESLint configuration file and define the list of rules you will use.

Flat Config (eslint.config.js)

import perfectionist from 'eslint-plugin-perfectionist'

export default [
  {
    plugins: {
      perfectionist,
    },
    rules: {
      'perfectionist/sort-imports': [
        'error',
        {
          type: 'natural',
          order: 'asc',
        },
      ],
    },
  },
]

Legacy Config (.eslintrc.js)

module.exports = {
  plugins: [
    'perfectionist',
  ],
  rules: {
    'perfectionist/sort-imports': [
      'error',
      {
        type: 'natural',
        order: 'asc',
      }
    ]
  }
}

Configs

The easiest way to use eslint-plugin-perfectionist is to use ready-made configs. Config files use all the rules of the current plugin, but you can override them.

Flat Config (eslint.config.js)

import perfectionist from 'eslint-plugin-perfectionist'

export default [
  perfectionist.configs['recommended-natural'],
]

Legacy Config (.eslintrc)

module.exports = {
  extends: [
    'plugin:perfectionist/recommended-natural-legacy',
  ],
}

List of Configs

Name Description
recommended-alphabetical All plugin rules with alphabetical sorting in ascending order
recommended-natural All plugin rules with natural sorting in ascending order
recommended-line-length All plugin rules with sorting by line length in descending order
recommended-custom All plugin rules with sorting by your own custom order

Rules

🔧 Automatically fixable by the --fix CLI option.

Name Description 🔧
sort-array-includes Enforce sorted arrays before include method 🔧
sort-classes Enforce sorted classes 🔧
sort-decorators Enforce sorted decorators 🔧
sort-enums Enforce sorted TypeScript enums 🔧
sort-exports Enforce sorted exports 🔧
sort-heritage-clauses Enforce sorted implements/extends clauses 🔧
sort-imports Enforce sorted imports 🔧
sort-interfaces Enforce sorted interface properties 🔧
sort-intersection-types Enforce sorted intersection types 🔧
sort-jsx-props Enforce sorted JSX props 🔧
sort-maps Enforce sorted Map elements 🔧
sort-modules Enforce sorted modules 🔧
sort-named-exports Enforce sorted named exports 🔧
sort-named-imports Enforce sorted named imports 🔧
sort-object-types Enforce sorted object types 🔧
sort-objects Enforce sorted objects 🔧
sort-sets Enforce sorted Set elements 🔧
sort-switch-case Enforce sorted switch case statements 🔧
sort-union-types Enforce sorted union types 🔧
sort-variable-declarations Enforce sorted variable declarations 🔧

FAQ

Can I automatically fix problems in the editor?

Yes. To do this, you need to enable autofix in ESLint when you save the file in your editor. You may find instructions for your editor here.

Is it safe?

Overall, yes. We want to make sure that the work of the plugin does not negatively affect the behavior of the code. For example, the plugin takes into account spread operators in JSX and objects, comments to the code. Safety is our priority. If you encounter any problem, you can create an issue.

Why not use Prettier?

I love Prettier. However, this is not its area of responsibility. Prettier is used for formatting, and ESLint for styling. For example, changing the order of imports can affect how the code works (console.log calls, fetch, style loading). Prettier should not change the AST. There is a cool article about this: "The Blurry Line Between Formatting and Style" by @joshuakgoldberg.

Versioning Policy

This plugin is following Semantic Versioning and ESLint's Semantic Versioning Policy.

Contributing

See Contributing Guide.

License

MIT © Azat S.

changelog

Changelog

v4.10.1

compare changes

🐞 Bug Fixes

  • Remove deprecated eslint source code api (8d4ad4f)
  • sort-imports: Fix explicit fallback sort overriding side-effects (1ac83c9)

❤️ Contributors

v4.10.0

compare changes

🚀 Features

  • Add sort by value related-options (94caac8)
  • Add custom groups fallback sort option (f42f24f)
  • Support sorting by type in fallback sorting (79d0441)

🐞 Bug Fixes

  • Fix maximum call stack size with fallback sort (8b78710)

❤️ Contributors

v4.9.0

compare changes

🚀 Features

  • Add missing newlines between validation in groups (e6e0588)
  • Improve regex-related options (00a8080)
  • Add fallback sort option to all rules (f639d94)
  • sort-jsx-props: Add use configuration if option (7208274)
  • Allow unsorted type for all remaining rules (f92ab2a)

🐞 Bug Fixes

  • Fix complex decorators not being handled (e667433)
  • sort-classes: Fix dependency detection regression (df40df4)

❤️ Contributors

v4.8.0

compare changes

🚀 Features

  • sort-enums: Adds groups, custom groups and newlines between (fe134a9)
  • Improve new lines between inside groups option behavior (a682297)
  • sort-named-exports: Add ignore alias option (266910b)

🐞 Bug Fixes

  • Add missing closing curly bracket (0ec132a)
  • sort-classes: Fix new lines inside always for signature overloads (f581714)

❤️ Contributors

v4.7.0

compare changes

🚀 Features

  • sort-objects: Add array-based custom groups option (afdda90)
  • sort-maps: Add groups, custom groups and new lines between options (317baaa)
  • Add newlines-between to some rules (231af42)

🐞 Bug Fixes

  • Fix overlapping errors between newlines-between and comment-after fixes (a6e1daf)

❤️ Contributors

v4.6.0

compare changes

🚀 Features

  • Allow to enter new lines between in groups (4045595)

🐞 Bug Fixes

  • sort-objects: Fix function name pattern usage with variable assignment (8d15b98)

❤️ Contributors

v4.5.0

compare changes

🚀 Features

  • Add custom group newlines inside option (3b3d2d5)
  • Make partition by comment support line and block (dd71f11)

🐞 Bug Fixes

  • Gives maximum priority to the void character in custom sort type (1649bea)

❤️ Contributors

v4.4.0

compare changes

🚀 Features

  • sort-array-includes: Add use configuration if and groups (a06ce5c)
  • Add ignore rule for objects passed as arguments to function calls (41c9f4f)
  • Add use configuration if option to sort-object-types and sort-interfaces (aa18f1a)

🏎 Performance Improvements

  • Improve rules performance (42ac82d)

🐞 Bug Fixes

  • sort-interfaces: Prevent constructor declarations from being sorted (b4ee1cc)

❤️ Contributors

v4.3.0

compare changes

🚀 Features

  • Improve function detection (ac1e7c4)
  • sort-objects: Handle context-based configurations (a3ee3ff)
  • Add custom sort type through custom alphabet (ac7d709)

❤️ Contributors

v4.2.0

compare changes

🚀 Features

  • Improve groups and custom groups in sort-interfaces and sort-object-types (8407bae)

🐞 Bug Fixes

  • sort-decorators: Keep jsdoc blocks in place (54dfdd9)
  • Fix ignoring order in natural sorting (82cb68a)

❤️ Contributors

v4.1.2

compare changes

🐞 Bug Fixes

❤️ Contributors

v4.1.1

compare changes

🐞 Bug Fixes

  • sort-modules: Check if node is sortable (26e2195)

❤️ Contributors

v4.1.0

compare changes

🚀 Features

  • sort-enums: Handle numeric operations (710cc24)
  • sort-objects: Add object declarations and destructured objects options (5606fad)

❤️ Contributors

v4.0.3

compare changes

🐞 Bug Fixes

  • sort-modules: Handle deprecated eslint enum attributes (979ece8)
  • Fix runtime errors in non-typescript eslint projects (84cddf7)

❤️ Contributors

v4.0.2

compare changes

🐞 Bug Fixes

  • sort-imports: Sort default internal pattern (a4bfc2b)

❤️ Contributors

v4.0.1

compare changes

🐞 Bug Fixes

  • Fix peer dependencies issues (3eba895)
  • Fix peer dependencies issues (191902a)
  • sort-modules: Disable sorting for export decorated classes (84de1d4)

❤️ Contributors

v4.0.0

compare changes

🚀 Features

  • ⚠️ Remove sort-astro-attributes, sort-svelte-attributes and sort-vue-attributes (0430412)
  • sort-classes: ⚠️ Update default grouping (97adf51)
  • Add sort-decorators rule (8fd2c4e)
  • Support arbitrary module identifiers (5557198)
  • sort-objects: Add multiline and method groups (1f454d9)
  • Adds newlines between option (7f44e80)
  • Add sort-heritage-clauses rule (90dfb15)
  • sort-classes: ⚠️ Remove support for old custom groups api (93e0b53)
  • sort-switch-case: Improve sorting nodes with comments (140c2c8)
  • ⚠️ Remove minimatch in favor of regexp (e240971)
  • Add locales option for all rules (f84cb5f)
  • sort-classes: Add partition by new line and newlines between options (4369803)
  • sort-imports: Resolve aliased imports through tsconfig.json (9ac3188)
  • sort-imports: ⚠️ Add partition by new line and partition by comment options (6812e2b)
  • sort-classes: Adds ignore callback dependencies patterns option (90a9132)
  • Add eslint disable directives handling (a485c39)
  • Add sort-modules rule (950db4e)
  • sort-classes: Add async modifier (be0b68f)
  • ⚠️ Move from natural-compare-lite to natural-orderby (cdc0f2e)

🐞 Bug Fixes

  • Respect comment boundaries with partitioning by comments (e5279ac)
  • Improve ending commas and semicolon behavior (a3804b8)
  • Make types compatible with eslint types (c9a48dd)
  • sort-switch-case: Fix ignoring breaks in case statements (960e21c)
  • sort-classes: Fix # properties not being detected as dependencies (0cf84ae)
  • Support optional chaining imports (932c5c9)
  • sort-classes: Fix inline issue with declare class (59ee21c)
  • sort-object-types: Fix getting key name (eb81e69)

⚠️ Breaking Changes

  • ⚠️ Remove sort-astro-attributes, sort-svelte-attributes and sort-vue-attributes (0430412)
  • sort-classes: ⚠️ Update default grouping (97adf51)
  • sort-classes: ⚠️ Remove support for old custom groups api (93e0b53)
  • ⚠️ Remove minimatch in favor of regexp (e240971)
  • sort-imports: ⚠️ Add partition by new line and partition by comment options (6812e2b)
  • ⚠️ Move from natural-compare-lite to natural-orderby (cdc0f2e)

❤️ Contributors

v3.9.1

compare changes

🐞 Bug Fixes

  • sort-switch-case: Fixe expressions being ignored (3fb34fc)

❤️ Contributors

v3.9.0

compare changes

🚀 Features

  • Adds possibility to trim / remove special characters before sorting (96f8b10)
  • Add element value pattern filter for properties in sort-classes (4e7e5ad)
  • Throw error when a group does not exist or duplicated in sort-classes (d447ffb)
  • Add method group in sort-interfaces (b797371)
  • Add method group in sort-object-types (4609ad2)
  • Add special characters and matcher to settings (a7d3f8c)
  • Improve side-effect handling behavior in sort-imports (398ac13)
  • Deprecate sort-astro-attributes, sort-svelte-attributes and sort-vue-attributes (46790ea)

🐞 Bug Fixes

  • Fix runtime error related o dependencies in sort-classes (7dfcb8e)
  • Fix unrecognized break statements in sort-switch-case (552c65c)

❤️ Contributors

v3.8.0

compare changes

🚀 Features

  • Add matcher option (9434334)
  • Add ability to disable sorting objects in jsx styles (45f7661)

🐞 Bug Fixes

  • Ignore whitespaces in node names (7a0a96c)
  • Fix linting of nodes that are neighboring to ignored nodes (a11841a)

❤️ Contributors

v3.7.0

compare changes

🚀 Features

  • Add partition by new line and group kind in sort-exports (4db2c5e)
  • Add dependency order errors (125e1cb)
  • Add partition by comment option in sort-exports (f6b7803)
  • Add partition by comment and partition by new line in sort-intersection-types (9fe8abd)
  • Add partition by comment and partition by new line in sort-union-types (4a0931b)
  • Add partition by comment and partition by new line in sort-named-imports (41e18b9)
  • Add partition by comment and partition by new line in sort-named-exports (928246e)
  • Add partition by comment and partition by new line in sort-maps (7bf6756)
  • Add partition by comment and partition by new line in sort-variable-declarations (aa29335)
  • Add partition by comment and partition by new line in sort-interfaces (fae756a)
  • Add partition by comment and partition by new line in sort-array-includes and sort-sets (e4fc538)
  • Add partition by comment option in sort-objects-types (69b643e)
  • Add partition by new line option in sort-enums (defd370)

🐞 Bug Fixes

  • Prioritize dependencies over partitions by comment and partitions by line (199ab39)

❤️ Contributors

v3.6.0

compare changes

🚀 Features

  • Improve error messages when sorting different groups (e0f375a)
  • Improve dependency detection in sort-objects rule (412d5da)
  • Keep comments above elements being sorted (bd8ba3f)

🐞 Bug Fixes

  • Detect dependencies in template literals in sort-enums (c9367eb)

❤️ Contributors

v3.5.0

compare changes

🚀 Features

  • Add ability to disable or enable side effect imports sorting (ae02009)

🐞 Bug Fixes

  • Detect dependencies in template literals (4e0e6d8)
  • Improve dependency detection in sort-variable-declarations rule (6beb536)

❤️ Contributors

v3.4.0

compare changes

🚀 Features

  • Improve ability to expand custom groups (5088619)
  • Downgrade minimatch dependency (4803030)
  • Generate exception if group does not exist (0872bdd)
  • Add sort-sets rule (7d4cf14)

🐞 Bug Fixes

  • Place static-block after static-property in default-options in sort-classes (73b1b54)
  • Fix sorting of members with dependencies (e7c113d)

❤️ Contributors

v3.3.0

compare changes

🚀 Features

  • Improve checking if a member is private in sort-classes rule (4e19b94)
  • Add static-block and accessor-property to default groups in sort-classes (0c724e0)
  • Don't sort unknown elements if unknown is not referenced in groups (0086427)
  • Add optional modifier in sort-classes rule (27fa7e8)

🐞 Bug Fixes

  • Fix sorting class members with same names (f1f875e)
  • Fix use of case named default in sort-switch-case rule (5583eb0)
  • Take into account dependencies in sort-enums (eeb0534)

❤️ Contributors

v3.2.0

compare changes

🚀 Features

  • Use dynamic group generation in sort-classes (baa701d)
  • Support for sorting by enum value (285a451)
  • Improve group order error messages in sort-classes (b02d626)
  • Allow specifying cross-rule settings (8e15730)
  • Add property-function groups in sort-class rule (41b92d3)

❤️ Contributors

v3.1.3

compare changes

🐞 Bug Fixes

  • Fix export of typescript types (1c4e960)

❤️ Contributors

v3.1.2

compare changes

🏎 Performance Improvements

  • Remove node cloning to improve performance (00b2cc3)

🐞 Bug Fixes

  • Fix sorting switch cases with default in middle of group (4ee655e)
  • Fix getting enum members in eslint v8 (3f3d77c)

❤️ Contributors

v3.1.1

compare changes

🐞 Bug Fixes

  • Fix getting enum members in eslint v8 (4789764)

❤️ Contributors

v3.1.0

compare changes

🚀 Features

  • Support for ordering protected properties and methods in classes (7efadfa)
  • Replace sort-objects custom ignore option with destructure only (f3906f9)
  • Move to typescript-eslint v8 (05b6502)

🐞 Bug Fixes

  • Fix switch case sorting with grouped default case (7428523)
  • Switch from to-sorted to sort method (bff6575)
  • Disable sorting dynamic require imports (68632df)
  • Define as builtin modules that require a node prefix (aac4725)
  • Fix sorting of complex switch case expressions (d07f5f7)

❤️ Contributors

v3.0.0

compare changes

🚀 Features

  • ⚠️ Drop nodejs v16 support (79f74f5)
  • Move to typescript-eslint v7 (933cebd)
  • Add new docs website (76b29e8)
  • ⚠️ Rename options from kebab case to camel case (6592f6f)
  • ⚠️ Make case ignoring enabled by default (63efbf7)
  • Update svelte eslint parser (611f088)
  • Add ability to ignore jsx elements (da515ce)
  • Use ignore pattern when sorting object for call expressions (471de40)
  • ⚠️ Make new config export (2a7eec2)
  • Add sort-switch-case rule (5311118)
  • Add typescript types (2b63ab5)
  • Add custom ignore to enable customisable ignore sort-objects rule (4fa2b3e)
  • Respect numeric separators in natural sorting (7b57ba2)
  • Add groups option in sort-intersection-types rule (208a9db)
  • ⚠️ Remove nullable last option in sort-union-types (c4977df)
  • Add groups option in sort-union-types rule (c69f277)
  • Add partition by comment option in sort-classes (da01c85)
  • ⚠️ Make recommended options default (d0d9115)
  • ⚠️ Replace spread last sort-array-includes option with group kind (721e1ee)
  • Add group kind option in sort-object-types (96cfcd8)
  • ⚠️ Rename optionality order option to group kind in sort-interfaces rule (79a4823)
  • Add sort-variable-declarations rule (12bd265)
  • Support require in sort-imports (bc16243)

🐞 Bug Fixes

  • Move typescript-eslint types to dependencies (44edb63)
  • Add ability to select enviorenment and separate bun modules (c8b2fa4)
  • Fix disabling styled components when using css func (d4e8011)
  • Support old getting context eslint api (09900aa)
  • Fix export and import kind default value (a0208ac)
  • Don't sort class members if right value depends on left (8c35a7d)

⚠️ Breaking Changes

  • ⚠️ Drop nodejs v16 support (79f74f5)
  • ⚠️ Rename options from kebab case to camel case (6592f6f)
  • ⚠️ Make case ignoring enabled by default (63efbf7)
  • ⚠️ Make new config export (2a7eec2)
  • ⚠️ Remove nullable last option in sort-union-types (c4977df)
  • ⚠️ Make recommended options default (d0d9115)
  • ⚠️ Replace spread last sort-array-includes option with group kind (721e1ee)
  • ⚠️ Rename optionality order option to group kind in sort-interfaces rule (79a4823)

❤️ Contributors

v2.11.0

compare changes

🚀 Features

  • Update svelte (861a381)
  • sort-classes: Add custom-group to sort-classes rule (1773ffb)

❤️ Contributors

v2.10.0

compare changes

🚀 Features

  • Allow typescript-eslint v7 (ccdaeb8)

🐞 Bug Fixes

  • sort-imports: Empty named imports being considered side-effect imports (ca69069)

❤️ Contributors

v2.9.0

compare changes

🚀 Features

  • Add sort-intersection-types rule (3ad40ff)
  • Use preserve modules for package build (be13a21)

🐞 Bug Fixes

  • Sort-objects ignore-pattern add property type (3de399f)
  • sort-exports: Work with star exports (ce76606)

❤️ Contributors

v2.8.0

compare changes

🚀 Features

  • sort-interfaces: Add optionalityOrder option (e142c39)

🐞 Bug Fixes

  • Convert optionalityOrder to kebab case (7726294)

❤️ Contributors

v2.7.0

compare changes

🚀 Features

  • sort-enums: Add partition-by-comment option (ec3d11c)
  • Add group-kind option on sort-named-imports and sort-named-exports (eb78461)

❤️ Contributors

v2.6.0

compare changes

🚀 Features

  • sort-classes: Add decorators support (cbe3f4b)

❤️ Contributors

  • Chirokas

v2.5.0

compare changes

🚀 Features

  • Add ignore-pattern option for sort-objects rule (ac5b240)

❤️ Contributors

v2.4.2

compare changes

🐞 Bug Fixes

❤️ Contributors

v2.4.1

compare changes

🐞 Bug Fixes

  • Fix output with a large number of groups (6847eaf)

❤️ Contributors

v2.4.0

compare changes

🚀 Features

  • Add side-effect-style import group (32dbef8)

❤️ Contributors

v2.3.0

compare changes

🚀 Features

  • Add max line length option for multiline imports sorting (4b81340)
  • Add partition by new line option to sort-objects rule (8654e44)
  • Add partition by new line option to sort-interfaces rule (48532ef)
  • Add partition by new line option to sort-object-typea rule (563c815)

❤️ Contributors

v2.2.0

compare changes

🚀 Features

  • Add ignore-alias option to sort-named-imports rule (4ad560b)

🐞 Bug Fixes

  • Side-effect import with an internal pattern are defined as internal module in sort-imports rule (b6f4e91)
  • Improve recognition of external modules (a22eaf6)

❤️ Contributors

v2.1.0

compare changes

🚀 Features

  • Add static-private-method group for sort-classes rule (37512c9)
  • Support bun builtin modules in sort-imports rule (37bca14)

🐞 Bug Fixes

  • Allow internal imports starting with a hash character (f35deef)

❤️ Contributors

v2.0.1

compare changes

🐞 Bug Fixes

  • Prefix-only builtin modules are defined as external modules in sort-imports rule (92b7240)

❤️ Contributors

  • Wondermarin

v2.0.0

compare changes

🚀 Features

  • ⚠️ Rename sort-map-elements rule to sort-maps (d371934)
  • ⚠️ Remove read-tsconfig option in sort-imports rule (cccced1)
  • ⚠️ Move callback, multiline and shorthand opts to groups in sort-jsx-props rule (10d357c)
  • Add sort-svelte-attributes rule (409295e)
  • Add sort-astro-attributes rule (036b41d)
  • ⚠️ Move from always-on-top option to groups in sort-objects rule (0bbcb5a)
  • Allow disabling sort-objects rule for styled-components (70f2afc)
  • Add sort-vue-attributes rule (e031275)
  • Add groups option to sort-interfaces rule (903c029)
  • Add groups options in sort-object-types rule (a219f23)
  • Replace is-core-module dependency with builtin module (e190c45)
  • Move to typescript-eslint v6 (9c61238)
  • Add option in sort-union-types rule to put null and undefined types at end (b313ba7)
  • Add index-signature group to sort-classes rule (f857b80)
  • Add get and set methods groups to sort-classes rule (73132e8)

🐞 Bug Fixes

  • Disable sorting enums with implicit values (f4a0e25)
  • Ignore string quotes in sort-array-includes rule (ec2e2f5)
  • Handle more complex expressions in sort-objects (a7d966c)
  • Set alphabetical sorting as default in sort-svelte-attributes rule (b224428)
  • Fix sorting single line union type with comment at end (95560ab)
  • Fix sorting class overloads (c4939b4)
  • Fix loading default options for configs (ef99f44)
  • Disable sort-jsx-props for vue, astro and svelte files (afb6ecc)
  • Improve determinition of static fields in sort-classes rule (c00ac10)
  • Prevent order changes when adding new elements in line-length sorting (c0e2e60)

⚠️ Breaking Changes

  • ⚠️ Rename sort-map-elements rule to sort-maps (d371934)
  • ⚠️ Remove read-tsconfig option in sort-imports rule (cccced1)
  • ⚠️ Move callback, multiline and shorthand opts to groups in sort-jsx-props rule (10d357c)
  • ⚠️ Move from always-on-top option to groups in sort-objects rule (0bbcb5a)

❤️ Contributors

v1.5.1

compare changes

🐞 Bug Fixes

  • Use alphabetical as the default sort type in schemas (3b9366e)
  • Disable sorting side-effect imports (01da88a)

❤️ Contributors

v1.5.0

compare changes

🚀 Features

  • Add external-type import group (47b07cc)

🏎 Performance Improvements

  • Move from foreach to for loops (b648f74)
  • Move from reduce to for loops in sort-imports (16f6361)

🐞 Bug Fixes

  • Don't sort ts call signature declarations in interfactes (5829a65)

❤️ Contributors

v1.4.0

compare changes

🚀 Features

  • Allow separating object properties into logical parts (933b621)

❤️ Contributors

v1.3.0

compare changes

🚀 Features

  • Support custom import groups (0b837d4)

❤️ Contributors

v1.2.1

compare changes

🐞 Bug Fixes

  • Fix removing extra spaces between imports (21bc7a8)

❤️ Contributors

v1.2.0

compare changes

🚀 Features

  • Support stylus file imports (dbef415)
  • Add sort-exports rule (a71eeb3)

❤️ Contributors

v1.1.2

compare changes

🐞 Bug Fixes

  • Fix sorting interfaces and types with comment on same line (03e5508)

❤️ Contributors

v1.1.1

compare changes

🐞 Bug Fixes

  • Fix adding extra lines if import ends with semi (e435f91)
  • Don't sort keys if right value depends on left (3e987ae)
  • Ignore semi at the end of object type member value (623ac67)

❤️ Contributors

v1.1.0

compare changes

🚀 Features

  • Add style group to sort the imports (05bf0f7)
  • Add side-effect group to sort the imports (02f51fb)
  • Add builtin-type group to sort the imports (ca34b5e)

🐞 Bug Fixes

  • Allow to sort destructured objects (65fe6c7)

❤️ Contributors

v1.0.1

compare changes

🐞 Bug Fixes

  • Do not sort enums with implicit values (166edac)

❤️ Contributors

v1.0.0

compare changes

🎉 Stable release

❤️ Contributors

v0.11.6

compare changes

🐞 Bug Fixes

  • Improve sort-imports fix function (e7a39f2)

❤️ Contributors

v0.11.5

compare changes

🐞 Bug Fixes

  • Fix sorting objects with inline comments (37a537d)
  • Split imports if there are other nodes between (b1a8837)

❤️ Contributors

v0.11.4

compare changes

🐞 Bug Fixes

  • Use service comments when sorting imports (b577ac7)
  • Fix sorting nodes with comments on the same line (16887ea)
  • Do not fix objects if last member contains a comment and doesn't contain comma (a9915f1)

❤️ Contributors

v0.11.3

compare changes

🐞 Bug Fixes

  • Fix working sort-map-elements with empty map (de061ff)
  • Disallow to sort default import specifiers (60044c6)
  • Do not sort imports if there are tokens between them (a4fabe9)

❤️ Contributors

v0.11.2

compare changes

🏎 Performance Improvements

  • Do not compute options if rule is not used (4574caa)

🐞 Bug Fixes

  • Fix single line type objects sorting (aaa446a)

❤️ Contributors

v0.11.1

compare changes

🐞 Bug Fixes

  • Fix option names in sort-classes in configs (bf578ed)

❤️ Contributors

v0.11.0

compare changes

🚀 Features

  • Add sort-object-types rule (e3a06cf)
  • Add sort-classes rule (b3a0cb8)

🐞 Bug Fixes

  • Fix multiline option value in sort-jsx-props rule in configs (556690d)
  • Improve error output (c1ad261)
  • Fix internal patter in configs (4be8a74)

❤️ Contributors

v0.10.0

compare changes

🚀 Features

  • Add read-tsconfig option to sort-imports rule (84cfc3d)
  • Allow to ignore interface by pattern (9aaf08a)
  • Add ignore-case option to each rule (e331b9a)
  • Rename spread-last option in sort-array-includes rule to kebab case (fc342d2)
  • Add shorthand position option to sort-jsx-props rule (416ffee)
  • Add callback position option to sort-jsx-props rule (8c6189f)
  • Add multiline position option to sort-jsx-props rule (58e094a)
  • Add always-on-top option to sort-jsx-props rule (57af3a2)
  • Rename sort-object-keys rule to sort-objects (3340a9f)
  • Add always-on-top option to sort-objects rule (464108f)

🏎 Performance Improvements

  • Make reading tsconfig singleton (c748445)
  • Improve sort-imports rule performance (2989539)

🐞 Bug Fixes

  • Fix groups in sort-imports rule in configs (f83c499)
  • Move parentheses when sorting (d09395f)
  • Update peer deps (800c2a3)

❤️ Contributors

v0.9.0

compare changes

🚀 Features

🐞 Bug Fixes

  • Keep code comments when sorting (547f825)
  • Update url to documentation of rules (423b145)

❤️ Contributors

v0.8.0

compare changes

🚀 Features

🐞 Bug Fixes

  • Fix defenition for rule not found error (050d20d)

❤️ Contributors

v0.7.0

compare changes

🐞 Bug Fixes

  • Fix plugin configs creation (559a2ce)

❤️ Contributors

v0.6.0

compare changes

🚀 Features

  • Support flat eslint config (969ae4e)
  • Add sort-object-keys rule (6dcb425)
  • Add recommended-alphabetical config (66c99f0)

❤️ Contributors

v0.5.0

compare changes

🚀 Features

  • Add sort-map-elements rule (049c004)
  • Add sort-array-includes rule (bb7605b)

🐞 Bug Fixes

  • Fix rules descriptions (1d18a26)
  • Add default rules properties (48d2835)
  • Add array constructor support to sort-array-includes rule (d255c22)
  • Fix interface sorting (86e3b56)

❤️ Contributors

v0.4.0

compare changes

🚀 Features

  • Add sort-named-exports rule (b3f4b57)

🐞 Bug Fixes

  • Fix rule configs creation (8a43758)
  • Fix missed sort-union-types rule export (3b02609)

❤️ Contributors

v0.3.0

compare changes

🚀 Features

🐞 Bug Fixes

❤️ Contributors

v0.2.0

compare changes

🚀 Features

  • Add sort-named-imports rule (827ee5a)
  • Add sort-jsx-props rule (656c86b)

🐞 Bug Fixes

❤️ Contributors

v0.1.0

🔥️️ Initial Release