Skip to content

Commit

Permalink
docs: fix invalid examples
Browse files Browse the repository at this point in the history
  • Loading branch information
hugop95 authored and azat-io committed Nov 24, 2024
1 parent 710cc24 commit aa6675a
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion docs/content/rules/sort-array-includes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Allows you to group array elements by their kind, determining whether spread val

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

Allows you to use comments to separate the members of arrays into logical groups. This can help in organizing and maintaining large arrays by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of arrays into logical groups. This can help in organizing and maintaining large arrays by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-classes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the class members into logical groups. This can help in organizing and maintaining large classes by creating partitions within the enum based on comments.
Allows you to use comments to separate the class members into logical groups. This can help in organizing and maintaining large classes by creating partitions within the class based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-exports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the exports into logical groups. This can help in organizing and maintaining large export blocks by creating partitions within the enum based on comments.
Allows you to use comments to separate the exports into logical groups. This can help in organizing and maintaining large export blocks by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-intersection-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the members of intersection types into logical groups. This can help in organizing and maintaining large intersection types by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of intersection types into logical groups. This can help in organizing and maintaining large intersection types by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-maps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the members of maps into logical groups. This can help in organizing and maintaining large maps by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of maps into logical groups. This can help in organizing and maintaining large maps by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
60 changes: 30 additions & 30 deletions docs/content/rules/sort-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,44 +30,44 @@ By sorting module members systematically, confusion is minimized, and the code b

<CodeExample
alphabetical={dedent`
export interface FindUserInput {
id: string
cache: CacheType
}
enum CacheType {
ALWAYS = 'ALWAYS',
NEVER = 'NEVER',
}
export type FindAllUsersInput = {
ids: string[]
cache: CacheType
}
export type FindAllUsersOutput = FindUserOutput[]
export interface FindUserInput {
id: string
cache: CacheType
}
export type FindUserOutput = {
id: string
name: string
age: number
}
function assertInputIsCorrect(input: FindUserInput | FindAllUsersInput): void {
class Cache {
// Some logic
}
export function findUser(input: FindUserInput): FindUserOutput {
export function findAllUsers(input: FindAllUsersInput): FindAllUsersOutput {
assertInputIsCorrect(input)
return _findUserByIds([input.id])[0]
}
export type FindAllUsersInput = {
ids: string[]
cache: CacheType
return _findUserByIds(input.ids)
}
export type FindAllUsersOutput = FindUserOutput[]
export function findAllUsers(input: FindAllUsersInput): FindAllUsersOutput {
export function findUser(input: FindUserInput): FindUserOutput {
assertInputIsCorrect(input)
return _findUserByIds(input.ids)
return _findUserByIds([input.id])[0]
}
class Cache {
function assertInputIsCorrect(input: FindUserInput | FindAllUsersInput): void {
// Some logic
}
`}
Expand All @@ -77,36 +77,36 @@ By sorting module members systematically, confusion is minimized, and the code b
NEVER = 'NEVER',
}
export type FindUserOutput = {
export type FindAllUsersOutput = FindUserOutput[]
export interface FindUserInput {
id: string
name: string
age: number
cache: CacheType
}
export type FindAllUsersInput = {
ids: string[]
cache: CacheType
}
export interface FindUserInput {
export type FindUserOutput = {
id: string
cache: CacheType
name: string
age: number
}
export type FindAllUsersOutput = FindUserOutput[]
class Cache {
// Some logic
}
export function findAllUsers(input: FindAllUsersInput): FindAllUsersOutput {
export function findUser(input: FindUserInput): FindUserOutput {
assertInputIsCorrect(input)
return _findUserByIds(input.ids)
return _findUserByIds([input.id])[0]
}
export function findUser(input: FindUserInput): FindUserOutput {
export function findAllUsers(input: FindAllUsersInput): FindAllUsersOutput {
assertInputIsCorrect(input)
return _findUserByIds([input.id])[0]
return _findUserByIds(input.ids)
}
function assertInputIsCorrect(input: FindUserInput | FindAllUsersInput): void {
Expand Down Expand Up @@ -228,7 +228,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the module members into logical groups. This can help in organizing and maintaining large modules by creating partitions within the enum based on comments.
Allows you to use comments to separate the module members into logical groups. This can help in organizing and maintaining large modules by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
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 @@ -158,7 +158,7 @@ Allows you to group named exports by their kind, determining whether value expor

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

Allows you to use comments to separate the members of named exports into logical groups. This can help in organizing and maintaining large named exports by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of named exports into logical groups. This can help in organizing and maintaining large named exports by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
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 @@ -168,7 +168,7 @@ Allows you to group named imports by their kind, determining whether value impor

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

Allows you to use comments to separate the members of named imports into logical groups. This can help in organizing and maintaining large named imports by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of named imports into logical groups. This can help in organizing and maintaining large named imports by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
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 @@ -146,7 +146,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the members of types into logical groups. This can help in organizing and maintaining large object types by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of types into logical groups. This can help in organizing and maintaining large object types by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-objects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the keys of objects into logical groups. This can help in organizing and maintaining large objects by creating partitions within the enum based on comments.
Allows you to use comments to separate the keys of objects into logical groups. This can help in organizing and maintaining large objects by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-sets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Allows you to group set elements by their kind, determining whether spread value

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

Allows you to use comments to separate the members of sets into logical groups. This can help in organizing and maintaining large sets by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of sets into logical groups. This can help in organizing and maintaining large sets by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-union-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the members of union types into logical groups. This can help in organizing and maintaining large union types by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of union types into logical groups. This can help in organizing and maintaining large union types by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/rules/sort-variable-declarations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Specifies the sorting locales. See [String.prototype.localeCompare() - locales](

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

Allows you to use comments to separate the members of variable declarations into logical groups. This can help in organizing and maintaining large variable declaration blocks by creating partitions within the enum based on comments.
Allows you to use comments to separate the members of variable declarations into logical groups. This can help in organizing and maintaining large variable declaration blocks by creating partitions based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
Expand Down

0 comments on commit aa6675a

Please sign in to comment.