From a10370c4c93f8b68140562dfbb4ff36b3a1e4894 Mon Sep 17 00:00:00 2001 From: Azat S Date: Mon, 5 Jun 2023 00:56:33 +0300 Subject: [PATCH] docs: improve plugin usage examples --- docs/rules/sort-array-includes.md | 1 + docs/rules/sort-classes.md | 1 + docs/rules/sort-enums.md | 1 + docs/rules/sort-imports.md | 1 + docs/rules/sort-interfaces.md | 1 + docs/rules/sort-jsx-props.md | 1 + docs/rules/sort-map-elements.md | 1 + docs/rules/sort-named-exports.md | 1 + docs/rules/sort-named-imports.md | 1 + docs/rules/sort-object-types.md | 1 + docs/rules/sort-objects.md | 1 + docs/rules/sort-union-types.md | 1 + readme.md | 8 +++----- 13 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/rules/sort-array-includes.md b/docs/rules/sort-array-includes.md index afd12ca9..cb1123b8 100644 --- a/docs/rules/sort-array-includes.md +++ b/docs/rules/sort-array-includes.md @@ -114,6 +114,7 @@ When `true` enforce spread elements in array to be last. ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-array-includes": [ "error", diff --git a/docs/rules/sort-classes.md b/docs/rules/sort-classes.md index a04ba749..f1418875 100644 --- a/docs/rules/sort-classes.md +++ b/docs/rules/sort-classes.md @@ -181,6 +181,7 @@ If you use [one of the configs](/configs/) exported by this plugin, you get the ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-classes": [ "error", diff --git a/docs/rules/sort-enums.md b/docs/rules/sort-enums.md index 979a3d45..604c1ad1 100644 --- a/docs/rules/sort-enums.md +++ b/docs/rules/sort-enums.md @@ -101,6 +101,7 @@ Only affects alphabetical and natural sorting. When `true` the rule ignores the ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-enums": [ "error", diff --git a/docs/rules/sort-imports.md b/docs/rules/sort-imports.md index 8b603458..f820e639 100644 --- a/docs/rules/sort-imports.md +++ b/docs/rules/sort-imports.md @@ -267,6 +267,7 @@ If your project is written in TypeScript, you can read `tsconfig.json` and use ` ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-imports": [ "error", diff --git a/docs/rules/sort-interfaces.md b/docs/rules/sort-interfaces.md index 381d497d..99a034b4 100644 --- a/docs/rules/sort-interfaces.md +++ b/docs/rules/sort-interfaces.md @@ -118,6 +118,7 @@ The [minimatch](https://github.com/isaacs/minimatch) library is used for pattern ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-interfaces": [ "error", diff --git a/docs/rules/sort-jsx-props.md b/docs/rules/sort-jsx-props.md index e38b2a8c..a3fdde53 100644 --- a/docs/rules/sort-jsx-props.md +++ b/docs/rules/sort-jsx-props.md @@ -151,6 +151,7 @@ You can set a list of property names that will always go at the beginning of the ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-jsx-props": [ "error", diff --git a/docs/rules/sort-map-elements.md b/docs/rules/sort-map-elements.md index 05d6d224..179105d7 100644 --- a/docs/rules/sort-map-elements.md +++ b/docs/rules/sort-map-elements.md @@ -105,6 +105,7 @@ Only affects alphabetical and natural sorting. When `true` the rule ignores the ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-map-elements": [ "error", diff --git a/docs/rules/sort-named-exports.md b/docs/rules/sort-named-exports.md index 460b68bb..72dc8a93 100644 --- a/docs/rules/sort-named-exports.md +++ b/docs/rules/sort-named-exports.md @@ -105,6 +105,7 @@ Only affects alphabetical and natural sorting. When `true` the rule ignores the ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-named-exports": [ "error", diff --git a/docs/rules/sort-named-imports.md b/docs/rules/sort-named-imports.md index 252c5944..ff9c3fc1 100644 --- a/docs/rules/sort-named-imports.md +++ b/docs/rules/sort-named-imports.md @@ -109,6 +109,7 @@ Only affects alphabetical and natural sorting. When `true` the rule ignores the ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-named-imports": [ "error", diff --git a/docs/rules/sort-object-types.md b/docs/rules/sort-object-types.md index f7dc2f13..0f76944d 100644 --- a/docs/rules/sort-object-types.md +++ b/docs/rules/sort-object-types.md @@ -101,6 +101,7 @@ Only affects alphabetical and natural sorting. When `true` the rule ignores the ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-object-types": [ "error", diff --git a/docs/rules/sort-objects.md b/docs/rules/sort-objects.md index 029356b3..5cbb8131 100644 --- a/docs/rules/sort-objects.md +++ b/docs/rules/sort-objects.md @@ -110,6 +110,7 @@ You can set a list of key names that will always go at the beginning of the obje ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-objects": [ "error", diff --git a/docs/rules/sort-union-types.md b/docs/rules/sort-union-types.md index 05b1feb5..8ae04c43 100644 --- a/docs/rules/sort-union-types.md +++ b/docs/rules/sort-union-types.md @@ -105,6 +105,7 @@ Only affects alphabetical and natural sorting. When `true` the rule ignores the ```json // .eslintrc { + "plugins": ["perfectionist"], "rules": { "perfectionist/sort-union-types": [ "error", diff --git a/readme.md b/readme.md index ad5c6208..fb375193 100644 --- a/readme.md +++ b/readme.md @@ -55,12 +55,11 @@ Add `eslint-plugin-perfectionist` to the plugins section of the ESLint configura { "plugins": ["perfectionist"], "rules": { - "perfectionist/sort-array-includes": [ + "perfectionist/sort-objects": [ "error", { "type": "line-length", - "order": "desc", - "spread-last": true + "order": "desc" } ] } @@ -78,12 +77,11 @@ export default [ perfectionist, }, rules: { - 'perfectionist/sort-array-includes': [ + 'perfectionist/sort-objects': [ 'error', { type: 'line-length', order: 'desc', - 'spread-last': true, }, ], },