Skip to content

Commit ba4b8df

Browse files
committed
refactor: rename variable to be consistent
1 parent 25c0179 commit ba4b8df

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/rules/no-focused-tests.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ export default createRule({
2424
CallExpression(node) {
2525
const scope = context.getScope();
2626

27-
const parsed = parseJestFnCall(node, scope);
27+
const jestFnCall = parseJestFnCall(node, scope);
2828

29-
if (parsed?.type !== 'test' && parsed?.type !== 'describe') {
29+
if (jestFnCall?.type !== 'test' && jestFnCall?.type !== 'describe') {
3030
return;
3131
}
3232

33-
if (parsed.name.startsWith('f')) {
33+
if (jestFnCall.name.startsWith('f')) {
3434
context.report({
3535
messageId: 'focusedTest',
3636
node,
@@ -40,8 +40,8 @@ export default createRule({
4040
fix(fixer) {
4141
// don't apply the fixer if we're an aliased import
4242
if (
43-
parsed.head.type === 'import' &&
44-
parsed.name !== parsed.head.local
43+
jestFnCall.head.type === 'import' &&
44+
jestFnCall.name !== jestFnCall.head.local
4545
) {
4646
return null;
4747
}
@@ -55,7 +55,7 @@ export default createRule({
5555
return;
5656
}
5757

58-
const onlyNode = parsed.members.find(
58+
const onlyNode = jestFnCall.members.find(
5959
s => getAccessorValue(s) === 'only',
6060
);
6161

src/rules/utils/parseJestFnCall.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export const isTypeOfJestFnCall = (
1616
scope: TSESLint.Scope.Scope,
1717
types: JestFnType[],
1818
): boolean => {
19-
const parsed = parseJestFnCall(node, scope);
19+
const jestFnCall = parseJestFnCall(node, scope);
2020

21-
return parsed !== null && types.includes(parsed.type);
21+
return jestFnCall !== null && types.includes(jestFnCall.type);
2222
};
2323

2424
export function getNodeChain(node: TSESTree.Node): AccessorNode[] {

0 commit comments

Comments
 (0)