Skip to content

Commit 7f861b5

Browse files
committed
feat(config): add typescript-sort-keys
1 parent 705ba7d commit 7f861b5

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = {
4444
],
4545
files: ["*.ts", "*.tsx"],
4646
parser: "@typescript-eslint/parser",
47-
plugins: ["@typescript-eslint/eslint-plugin"],
47+
plugins: ["@typescript-eslint/eslint-plugin", "typescript-sort-keys"],
4848
rules: {
4949
"@typescript-eslint/explicit-function-return-type": [
5050
1,
@@ -53,7 +53,17 @@ module.exports = {
5353
"@typescript-eslint/no-empty-interface": 1,
5454
"@typescript-eslint/no-unused-vars": [2, { argsIgnorePattern: "^_" }],
5555
"@typescript-eslint/no-use-before-define": 0,
56-
"no-unused-vars": 0
56+
"no-unused-vars": 0,
57+
"typescript-sort-keys/interface": [
58+
2,
59+
"asc",
60+
{ caseSensitive: false, natural: true }
61+
],
62+
"typescript-sort-keys/string-enum": [
63+
2,
64+
"asc",
65+
{ caseSensitive: false, natural: true }
66+
]
5767
}
5868
}
5969
]

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"eslint-plugin-import": "^2.20.1",
3232
"eslint-plugin-import-order-alphabetical": "^1.0.0",
3333
"eslint-plugin-prettier": "^3.1.2",
34-
"eslint-plugin-react-native-a11y": "^1.3.1"
34+
"eslint-plugin-react-native-a11y": "^1.3.1",
35+
"eslint-plugin-typescript-sort-keys": "^0.5.0"
3536
}
3637
}

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,14 @@ eslint-plugin-react@7.19.0:
520520
string.prototype.matchall "^4.0.2"
521521
xregexp "^4.3.0"
522522

523+
eslint-plugin-typescript-sort-keys@^0.5.0:
524+
version "0.5.0"
525+
resolved "https://registry.yarnpkg.com/eslint-plugin-typescript-sort-keys/-/eslint-plugin-typescript-sort-keys-0.5.0.tgz#dea8d5d4d3305010e23c7132d909e0cd474b96a4"
526+
integrity sha512-TZ5i5UqtUfASpi86RkpYisv+MZUuac2X4FgUJ/e6wHpkvCCGk8tw77cBP0vzuNEtkaec6HfJ6kuflnOgmtMRyA==
527+
dependencies:
528+
natural-compare-lite "~1.4.0"
529+
requireindex "~1.2.0"
530+
523531
eslint-scope@^5.0.0:
524532
version "5.0.0"
525533
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9"
@@ -793,6 +801,11 @@ ms@^2.1.1:
793801
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
794802
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
795803

804+
natural-compare-lite@~1.4.0:
805+
version "1.4.0"
806+
resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4"
807+
integrity sha1-F7CVgZiJef3a/gIB6TG6kzyWy7Q=
808+
796809
normalize-package-data@^2.3.2:
797810
version "2.5.0"
798811
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
@@ -1006,6 +1019,11 @@ regexpp@^3.0.0:
10061019
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.0.0.tgz#dd63982ee3300e67b41c1956f850aa680d9d330e"
10071020
integrity sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==
10081021

1022+
requireindex@~1.2.0:
1023+
version "1.2.0"
1024+
resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef"
1025+
integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==
1026+
10091027
resolve@^1.10.0, resolve@^1.5.0:
10101028
version "1.12.0"
10111029
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"

0 commit comments

Comments
 (0)