Skip to content

Commit

Permalink
docs: improve plugin usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Jun 4, 2023
1 parent f0993e3 commit a10370c
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/rules/sort-array-includes.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ When `true` enforce spread elements in array to be last.
```json
// .eslintrc
{
"plugins": ["perfectionist"],
"rules": {
"perfectionist/sort-array-includes": [
"error",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-jsx-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-map-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-named-exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-named-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-object-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs/rules/sort-union-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
Expand All @@ -78,12 +77,11 @@ export default [
perfectionist,
},
rules: {
'perfectionist/sort-array-includes': [
'perfectionist/sort-objects': [
'error',
{
type: 'line-length',
order: 'desc',
'spread-last': true,
},
],
},
Expand Down

0 comments on commit a10370c

Please sign in to comment.