Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/content/rules/sort-array-includes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ This feature is only applicable when [`partitionByNewLine`](#partitionbynewline)
</sub>
<sub>default: `[]`</sub>

Defines custom groups to match specific object type members.
Defines custom groups to match specific array elements.

A custom group definition may follow one of the two following interfaces:

Expand Down Expand Up @@ -523,11 +523,12 @@ Custom groups have a higher priority than any predefined group.
fallbackSort: { type: 'unsorted' },
ignoreCase: true,
specialCharacters: 'keep',
partitionByComment: false,
partitionByNewLine: false,
newlinesBetween: 'ignore',
newlinesInside: 'ignore',
useConfigurationIf: {},
groups: ["literal"],
groups: ['literal'],
customGroups: [],
},
],
Expand All @@ -554,11 +555,12 @@ Custom groups have a higher priority than any predefined group.
fallbackSort: { type: 'unsorted' },
ignoreCase: true,
specialCharacters: 'keep',
partitionByComment: false,
partitionByNewLine: false,
newlinesBetween: 'ignore',
newlinesInside: 'ignore',
useConfigurationIf: {},
groups: ["literal"],
groups: ['literal'],
customGroups: [],
},
],
Expand Down
4 changes: 2 additions & 2 deletions docs/content/rules/sort-classes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ Without `ignoreCallbackDependenciesPatterns: ['^computed$']`, `role` and `userna
</sub>
<sub>default: `{}`</sub>

Specifies filters to match a particular options configuration for a given object.
Specifies filters to match a particular options configuration for a given class.

The first matching options configuration will be used. If no configuration matches, the default options configuration will be used.

Expand Down Expand Up @@ -553,7 +553,7 @@ The `private` modifier will currently match any of the following:
Elements that are not `protected` nor `private` will be matched with the `public` modifier, even if the keyword is not present.

##### The `unknown` group
Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
the members will remain in their original order.

##### Behavior when multiple groups match an element
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-decorators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ Specifies a list of decorator groups for sorting.

Predefined groups:

- `'unknown'` — Decorators that dont fit into any group specified in the `groups` option.
- `'unknown'` — Decorators that don't fit into any group specified in the `groups` option.

If the `unknown` group is not specified in the `groups` option, it will automatically be added to the end of the list.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-enums.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Within a given group, members will be sorted according to the `type`, `order`, `
Individual groups can be combined together by placing them in an array. The order of groups in that array does not matter.
All members of the groups in the array will be sorted together as if they were part of a single group.

##### Group with overridden settings
#### Group with overridden settings

You may directly override options for a specific group by using an object with the `group` property and other option overrides.

Expand Down
5 changes: 2 additions & 3 deletions docs/content/rules/sort-exports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Example: enforce alphabetical sort between two elements with the same length.

You can also sort by subgroup order (nested groups in the [`groups`](#groups) option) using `subgroup-order`.

Example: When two exports tie on the primary sort key, sort type exports before value exports inside a subgroup.
Example: when two exports tie on the primary sort key, sort type exports before value exports inside a subgroup.
```ts
{
groups: [['type-export', 'value-export']],
Expand Down Expand Up @@ -302,7 +302,7 @@ Example: `type-export`.

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
it will automatically be added to the end of the list.

##### Group with overridden settings
Expand Down Expand Up @@ -483,7 +483,6 @@ Custom groups have a higher priority than any predefined group.
lang="tsx"
/>


## Version

This rule was introduced in [v1.2.0](https://github.com/azat-io/eslint-plugin-perfectionist/releases/tag/v1.2.0).
Expand Down
4 changes: 2 additions & 2 deletions docs/content/rules/sort-heritage-clauses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Example configuration: don't sort heritage clauses of classes (only interfaces).

<sub>default: `false`</sub>

Enables the use of comments to separate class decorators into logical groups.
Enables the use of comments to separate heritage clauses into logical groups.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down Expand Up @@ -308,7 +308,7 @@ Specifies a list of heritage clause groups for sorting.

Predefined groups:

- `'unknown'` — Heritage Clauses that dont fit into any group specified in the `groups` option.
- `'unknown'` — Heritage Clauses that don't fit into any group specified in the `groups` option.

If the `unknown` group is not specified in the `groups` option, it will automatically be added to the end of the list.

Expand Down
4 changes: 2 additions & 2 deletions docs/content/rules/sort-imports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ The list of modifiers is sorted from most to least important:

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
the members will remain in their original order.

##### Behavior when multiple groups match an element
Expand Down Expand Up @@ -713,7 +713,7 @@ you must write a custom group definition that does the same as what the predefin

<sub>default: `'node'`</sub>

Specifies which environments built-in modules should be recognized. If you are using [Bun](https://bun.sh), change the value to `'bun'`.
Specifies which environment's built-in modules should be recognized. If you are using [Bun](https://bun.sh), change the value to `'bun'`.

### useExperimentalDependencyDetection

Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-interfaces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ Elements that are not `optional` will be matched with the `required` modifier, e

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
it will automatically be added to the end of the list.

##### Behavior when multiple groups match an element
Expand Down
37 changes: 19 additions & 18 deletions docs/content/rules/sort-intersection-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ keywords:
- typescript linting
- intersection types sorting
- typescript types
- typescript linting
- typescript-eslint
---

Expand Down Expand Up @@ -315,6 +314,8 @@ To avoid unexpected behavior, do not use `:exit` or `:enter` pseudo-selectors.
</sub>
<sub>default: `[]`</sub>

Specifies a list of intersection type groups for sorting. Groups help organize types into categories, making your type definitions more readable and maintainable.

Each member will be assigned a single group specified in the `groups` option (or the `unknown` group if no match is found).
The order of items in the `groups` option determines how groups are ordered.

Expand All @@ -327,23 +328,23 @@ Predefined groups are characterized by a single selector.

##### Selectors

- `'conditional`' — Conditional types.
- `'function`' — Function types.
- `'import`' — Imported types.
- `'intersection`' — Intersection types.
- `'keyword`' — Keyword types.
- `'literal`' — Literal types.
- `'named`' — Named types.
- `'object`' — Object types.
- `'operator`' — Operator types.
- `'tuple`' — Tuple types.
- `'union`' — Union types.
- `'nullish`' — Nullish types (`null` or `undefined`).
- `'unknown`' — Types that dont fit into any group specified in the `groups` option.
- `'conditional'` — Conditional types.
- `'function'` — Function types.
- `'import'` — Imported types.
- `'intersection'` — Intersection types.
- `'keyword'` — Keyword types.
- `'literal'` — Literal types.
- `'named'` — Named types.
- `'object'` — Object types.
- `'operator'` — Operator types.
- `'tuple'` — Tuple types.
- `'union'` — Union types.
- `'nullish'` — Nullish types (`null` or `undefined`).
- `'unknown'` — Types that don't fit into any group specified in the `groups` option.

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
it will automatically be added to the end of the list.

#### Example 1
Expand Down Expand Up @@ -473,7 +474,7 @@ This feature is only applicable when [`partitionByNewLine`](#partitionbynewline)
</sub>
<sub>default: `[]`</sub>

Defines custom groups to match specific object type members.
Defines custom groups to match specific intersection type members.

A custom group definition may follow one of the two following interfaces:

Expand All @@ -489,7 +490,7 @@ interface CustomGroupDefinition {
}
```

An type member will match a `CustomGroupDefinition` group if it matches all the filters of the custom group's definition.
A type member will match a `CustomGroupDefinition` group if it matches all the filters of the custom group's definition.

or:

Expand All @@ -507,7 +508,7 @@ interface CustomGroupAnyOfDefinition {
}
```

An type member will match a `CustomGroupAnyOfDefinition` group if it matches all the filters of at least one of the `anyOf` items.
A type member will match a `CustomGroupAnyOfDefinition` group if it matches all the filters of at least one of the `anyOf` items.

#### Attributes

Expand Down
4 changes: 2 additions & 2 deletions docs/content/rules/sort-jsx-props.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ All members of the groups in the array will be sorted together as if they were p

Predefined groups are characterized by a single selector and potentially multiple modifiers. You may enter modifiers in any order, but the selector must always come at the end.

##### Selectors
#### Selectors

The only selector possible for this rule is `'prop'`.

Expand Down Expand Up @@ -485,7 +485,7 @@ Current API:
</sub>
<sub>default: `[]`</sub>

Defines custom groups to match specific JSX prop.
Defines custom groups to match specific JSX props.

A custom group definition may follow one of the two following interfaces:

Expand Down
4 changes: 2 additions & 2 deletions docs/content/rules/sort-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Enables the use of comments to separate the module members into logical groups.

<sub>default: `false`</sub>

When `true`, the rule will not sort the members of a class if there is an empty line between them. This helps maintain the defined order of logically separated groups of members.
When `true`, the rule will not sort the members of a module if there is an empty line between them. This helps maintain the defined order of logically separated groups of members.

```ts
// Group 1
Expand Down Expand Up @@ -440,7 +440,7 @@ Predefined groups are characterized by a single selector and potentially multipl

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
the members will remain in their original order.

##### Behavior when multiple groups match an element
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-named-exports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ Example: `type-export`.

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
it will automatically be added to the end of the list.

##### Group with overridden settings
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-named-imports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ Example: `type-import`.

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
it will automatically be added to the end of the list.

##### Group with overridden settings
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-object-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ Elements that are not `optional` will be matched with the `required` modifier, e

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
it will automatically be added to the end of the list.

##### Behavior when multiple groups match an element
Expand Down
4 changes: 2 additions & 2 deletions docs/content/rules/sort-objects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ Enables the use of comments to separate the keys of objects into logical groups.

<sub>default: `false`</sub>

When `true`, the rule will not sort the objects keys if there is an empty line between them. This helps maintain the defined order of logically separated groups of keys.
When `true`, the rule will not sort the object's keys if there is an empty line between them. This helps maintain the defined order of logically separated groups of keys.

```ts
const user = {
Expand Down Expand Up @@ -626,7 +626,7 @@ let user = {

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
it will automatically be added to the end of the list.

#### Important notes
Expand Down
6 changes: 4 additions & 2 deletions docs/content/rules/sort-sets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ By keeping sets sorted, developers can quickly scan and verify the values, makin
return 'Unknown'
}
`}
client:load
lang="tsx"
initial={dedent`
const getProductCategories = (product) => {
let electronics = new Set([
Expand Down Expand Up @@ -118,6 +116,8 @@ By keeping sets sorted, developers can quickly scan and verify the values, makin
return 'Unknown'
}
`}
client:load
lang="tsx"
/>

## Options
Expand Down Expand Up @@ -528,6 +528,7 @@ Custom groups have a higher priority than any predefined group.
fallbackSort: { type: 'unsorted' },
ignoreCase: true,
specialCharacters: 'keep',
partitionByComment: false,
partitionByNewLine: false,
newlinesBetween: 'ignore',
newlinesInside: 'ignore',
Expand Down Expand Up @@ -559,6 +560,7 @@ Custom groups have a higher priority than any predefined group.
fallbackSort: { type: 'unsorted' },
ignoreCase: true,
specialCharacters: 'keep',
partitionByComment: false,
partitionByNewLine: false,
newlinesBetween: 'ignore',
newlinesInside: 'ignore',
Expand Down
12 changes: 5 additions & 7 deletions docs/content/rules/sort-union-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ keywords:
- typescript linting
- union types sorting
- typescript types
- typescript linting
- typescript-eslint
- typescript union types
- typescript union type sorting
- typescript union type members
- typescript union type sorting
- typescript union type members sorting
---

Expand Down Expand Up @@ -361,11 +359,11 @@ Predefined groups are characterized by a single selector.
- `'tuple'` — Tuple types.
- `'union'` — Union types.
- `'nullish'` — Nullish types (`null` or `undefined`).
- `'unknown'` — Types that dont fit into any group entered by the user.
- `'unknown'` — Types that don't fit into any group entered by the user.

##### The `unknown` group

Members that dont fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
Members that don't fit into any group specified in the `groups` option will be placed in the `unknown` group. If the `unknown` group is not specified in the `groups` option,
it will automatically be added to the end of the list.

#### Example 1
Expand Down Expand Up @@ -495,7 +493,7 @@ This feature is only applicable when [`partitionByNewLine`](#partitionbynewline)
</sub>
<sub>default: `[]`</sub>

Defines custom groups to match specific object type members.
Defines custom groups to match specific union type members.

A custom group definition may follow one of the two following interfaces:

Expand All @@ -511,7 +509,7 @@ interface CustomGroupDefinition {
}
```

An type member will match a `CustomGroupDefinition` group if it matches all the filters of the custom group's definition.
A type member will match a `CustomGroupDefinition` group if it matches all the filters of the custom group's definition.

or:

Expand All @@ -529,7 +527,7 @@ interface CustomGroupAnyOfDefinition {
}
```

An type member will match a `CustomGroupAnyOfDefinition` group if it matches all the filters of at least one of the `anyOf` items.
A type member will match a `CustomGroupAnyOfDefinition` group if it matches all the filters of at least one of the `anyOf` items.

#### Attributes

Expand Down
Loading
Loading