Skip to content

Commit

Permalink
Add sort-destructure-keys plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arnautov-anton committed Jan 24, 2025
1 parent a4b338b commit 15ef32f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
11 changes: 6 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';

import sortDestructureKeysPlugin from 'eslint-plugin-sort-destructure-keys';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import reactPlugin from 'eslint-plugin-react';
import importPlugin from 'eslint-plugin-import';
Expand All @@ -27,6 +28,7 @@ export default tseslint.config(
plugins: {
'react-hooks': reactHooksPlugin,
import: importPlugin,
'sort-destructure-keys': sortDestructureKeysPlugin,
},
settings: {
react: {
Expand Down Expand Up @@ -55,11 +57,10 @@ export default tseslint.config(
'object-shorthand': 'warn',
'prefer-const': 'warn',
'require-await': 'error',
// TODO: find appropriate plugin for this rule
// "sort-destructure-keys/sort-destructure-keys": [
// "error",
// { caseSensitive: false },
// ],
"sort-destructure-keys/sort-destructure-keys": [
"error",
{ caseSensitive: false },
],
'sort-imports': [
'error',
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"globals": "^15.13.0",
"husky": "^8.0.3",
"i18next-parser": "^6.0.0",
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5826,6 +5826,13 @@ eslint-plugin-react@^7.37.2:
string.prototype.matchall "^4.0.11"
string.prototype.repeat "^1.0.0"

eslint-plugin-sort-destructure-keys@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-sort-destructure-keys/-/eslint-plugin-sort-destructure-keys-2.0.0.tgz#23d26e3db4a8fb73fcd0dfceb2de4c517e6d603f"
integrity sha512-4w1UQCa3o/YdfWaLr9jY8LfGowwjwjmwClyFLxIsToiyIdZMq3x9Ti44nDn34DtTPP7PWg96tUONKVmATKhYGQ==
dependencies:
natural-compare-lite "^1.4.0"

eslint-scope@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.2.0.tgz#377aa6f1cb5dc7592cfd0b7f892fd0cf352ce442"
Expand Down Expand Up @@ -9963,6 +9970,11 @@ nanomatch@^1.2.9:
snapdragon "^0.8.1"
to-regex "^3.0.1"

natural-compare-lite@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4"
integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==

natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
Expand Down

0 comments on commit 15ef32f

Please sign in to comment.