Skip to content

Commit 44cc98d

Browse files
committed
refactor: replace local isPrivateProperty with the implementation in eslint-etc
1 parent 7b54829 commit 44cc98d

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"@typescript-eslint/experimental-utils": "^5.0.0",
88
"common-tags": "^1.8.0",
9-
"eslint-etc": "^5.0.0",
9+
"eslint-etc": "^5.2.0",
1010
"requireindex": "~1.2.0",
1111
"tslib": "^2.0.0"
1212
},

source/rules/prefer-composition.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import {
1111
isAssignmentExpression,
1212
isCallExpression,
1313
isIdentifier,
14+
isPrivateIdentifier,
1415
isMemberExpression,
1516
isVariableDeclarator,
1617
} from "eslint-etc";
17-
import { ruleCreator, isPrivateIdentifier } from "../utils";
18+
import { ruleCreator } from "../utils";
1819

1920
const defaultOptions: readonly {
2021
checkDecorators?: string[];

source/utils.ts

-8
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,8 @@
44
*/
55

66
import { ESLintUtils } from "@typescript-eslint/experimental-utils";
7-
import { TSESTree as es } from "@typescript-eslint/experimental-utils";
87

98
export const ruleCreator = ESLintUtils.RuleCreator(
109
(name) =>
1110
`https://github.com/cartant/eslint-plugin-rxjs-angular/tree/main/docs/rules/${name}.md`
1211
);
13-
14-
// TODO: Remove when eslint-etc supports isPrivateIdentifier
15-
export function isPrivateIdentifier(
16-
node: es.Node
17-
): node is es.PrivateIdentifier {
18-
return node.type === "PrivateIdentifier";
19-
}

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ [email protected], escape-string-regexp@^4.0.0:
699699
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
700700
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
701701

702-
eslint-etc@^5.0.0:
702+
eslint-etc@^5.2.0:
703703
version "5.2.0"
704704
resolved "https://registry.yarnpkg.com/eslint-etc/-/eslint-etc-5.2.0.tgz#c51c19a2ffb6447af76a1c5ffd13b9a212db859b"
705705
integrity sha512-Gcm/NMa349FOXb1PEEfNMMyIANuorIc2/mI5Vfu1zENNsz+FBVhF62uY6gPUCigm/xDOc8JOnl+71WGnlzlDag==

0 commit comments

Comments
 (0)