Skip to content

Commit

Permalink
feat!: rename sort-map-elements rule to sort-maps
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Jul 20, 2023
1 parent 3e5ef3a commit 528b9ab
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ description: ESLint Plugin Perfectionist list of rules
| [sort-imports](/rules/sort-imports) | enforce sorted imports | 🔧 |
| [sort-interfaces](/rules/sort-interfaces) | enforce sorted interface properties | 🔧 |
| [sort-jsx-props](/rules/sort-jsx-props) | enforce sorted JSX props | 🔧 |
| [sort-map-elements](/rules/sort-map-elements) | enforce sorted Map elements | 🔧 |
| [sort-maps](/rules/sort-maps) | enforce sorted Map elements | 🔧 |
| [sort-named-exports](/rules/sort-named-exports) | enforce sorted named exports | 🔧 |
| [sort-named-imports](/rules/sort-named-imports) | enforce sorted named imports | 🔧 |
| [sort-object-types](/rules/sort-object-types) | enforce sorted object types | 🔧 |
Expand Down
12 changes: 6 additions & 6 deletions docs/rules/sort-map-elements.md → docs/rules/sort-maps.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: sort-map-elements
title: sort-maps
description: ESLint Plugin Perfectionist rule which enforce sorted element within JavaScript Map object
---

# sort-map-elements
# sort-maps

💼 This rule is enabled in the following [configs](/configs/): `recommended-alphabetical`, `recommended-line-length`, `recommended-natural`.

Expand Down Expand Up @@ -112,7 +112,7 @@ Only affects alphabetical and natural sorting. When `true` the rule ignores the
{
"plugins": ["perfectionist"],
"rules": {
"perfectionist/sort-map-elements": [
"perfectionist/sort-maps": [
"error",
{
"type": "natural",
Expand All @@ -133,7 +133,7 @@ export default [
perfectionist,
},
rules: {
'perfectionist/sort-map-elements': [
'perfectionist/sort-maps': [
'error',
{
type: 'natural',
Expand All @@ -153,5 +153,5 @@ This rule was introduced in v0.5.0.

## 📚 Resources

- [Rule source](https://github.com/azat-io/eslint-plugin-perfectionist/blob/main/rules/sort-map-elements.ts)
- [Test source](https://github.com/azat-io/eslint-plugin-perfectionist/blob/main/test/sort-map-elements.test.ts)
- [Rule source](https://github.com/azat-io/eslint-plugin-perfectionist/blob/main/rules/sort-maps.ts)
- [Test source](https://github.com/azat-io/eslint-plugin-perfectionist/blob/main/test/sort-maps.test.ts)
14 changes: 7 additions & 7 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import sortArrayIncludes, { RULE_NAME as sortArrayIncludesName } from './rules/sort-array-includes'
import sortNamedExports, { RULE_NAME as sortNamedExportsName } from './rules/sort-named-exports'
import sortNamedImports, { RULE_NAME as sortNamedImportsName } from './rules/sort-named-imports'
import sortNamedExports, { RULE_NAME as sortNamedExportsName } from './rules/sort-named-exports'
import sortObjectTypes, { RULE_NAME as sortObjectTypesName } from './rules/sort-object-types'
import sortMapElements, { RULE_NAME as sortMapElementsName } from './rules/sort-map-elements'
import sortUnionTypes, { RULE_NAME as sortUnionTypesName } from './rules/sort-union-types'
import sortInterfaces, { RULE_NAME as sortInterfacesName } from './rules/sort-interfaces'
import sortJsxProps, { RULE_NAME as sortJsxPropsName } from './rules/sort-jsx-props'
import sortObjects, { RULE_NAME as sortObjectsName } from './rules/sort-objects'
import sortImports, { RULE_NAME as sortImportsName } from './rules/sort-imports'
import sortClasses, { RULE_NAME as sortClassesName } from './rules/sort-classes'
import sortObjects, { RULE_NAME as sortObjectsName } from './rules/sort-objects'
import sortExports, { RULE_NAME as sortExportsName } from './rules/sort-exports'
import sortEnums, { RULE_NAME as sortEnumsName } from './rules/sort-enums'
import sortMaps, { RULE_NAME as sortMapsName } from './rules/sort-maps'
import { SortOrder, SortType } from './typings'
import { name } from './package.json'

Expand Down Expand Up @@ -90,14 +90,14 @@ let createConfigWithOptions = (options: {
'spread-last': true,
},
],
[sortNamedExportsName]: ['error'],
[sortNamedImportsName]: ['error'],
[sortMapElementsName]: ['error'],
[sortNamedExportsName]: ['error'],
[sortObjectTypesName]: ['error'],
[sortInterfacesName]: ['error'],
[sortUnionTypesName]: ['error'],
[sortInterfacesName]: ['error'],
[sortExportsName]: ['error'],
[sortEnumsName]: ['error'],
[sortMapsName]: ['error'],
}
return {
rules: Object.fromEntries(
Expand All @@ -120,7 +120,7 @@ export default {
[sortImportsName]: sortImports,
[sortInterfacesName]: sortInterfaces,
[sortJsxPropsName]: sortJsxProps,
[sortMapElementsName]: sortMapElements,
[sortMapsName]: sortMaps,
[sortNamedExportsName]: sortNamedExports,
[sortNamedImportsName]: sortNamedImports,
[sortObjectTypesName]: sortObjectTypes,
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default [
| [sort-imports](https://eslint-plugin-perfectionist.azat.io/rules/sort-imports) | enforce sorted imports | 🔧 |
| [sort-interfaces](https://eslint-plugin-perfectionist.azat.io/rules/sort-interfaces) | enforce sorted interface properties | 🔧 |
| [sort-jsx-props](https://eslint-plugin-perfectionist.azat.io/rules/sort-jsx-props) | enforce sorted JSX props | 🔧 |
| [sort-map-elements](https://eslint-plugin-perfectionist.azat.io/rules/sort-map-elements) | enforce sorted Map elements | 🔧 |
| [sort-maps](https://eslint-plugin-perfectionist.azat.io/rules/sort-maps) | enforce sorted Map elements | 🔧 |
| [sort-named-exports](https://eslint-plugin-perfectionist.azat.io/rules/sort-named-exports) | enforce sorted named exports | 🔧 |
| [sort-named-imports](https://eslint-plugin-perfectionist.azat.io/rules/sort-named-imports) | enforce sorted named imports | 🔧 |
| [sort-object-types](https://eslint-plugin-perfectionist.azat.io/rules/sort-object-types) | enforce sorted object types | 🔧 |
Expand Down
2 changes: 1 addition & 1 deletion rules/sort-map-elements.ts → rules/sort-maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Options = [
}>,
]

export const RULE_NAME = 'sort-map-elements'
export const RULE_NAME = 'sort-maps'

export default createEslintRule<Options, MESSAGE_ID>({
name: RULE_NAME,
Expand Down
2 changes: 1 addition & 1 deletion test/sort-map-elements.test.ts → test/sort-maps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ESLintUtils } from '@typescript-eslint/utils'
import { describe, it } from 'vitest'
import { dedent } from 'ts-dedent'

import rule, { RULE_NAME } from '../rules/sort-map-elements'
import rule, { RULE_NAME } from '../rules/sort-maps'
import { SortOrder, SortType } from '../typings'

describe(RULE_NAME, () => {
Expand Down

0 comments on commit 528b9ab

Please sign in to comment.