Skip to content

Commit 1dbb513

Browse files
committed
style: apply prettier after merge
1 parent 3a0d125 commit 1dbb513

5 files changed

+27
-10
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
2626

2727
[![All Contributors](https://img.shields.io/badge/all_contributors-34-orange.svg?style=flat-square)](#contributors-)
28+
2829
<!-- ALL-CONTRIBUTORS-BADGE:END -->
2930

3031
## Installation
@@ -142,7 +143,7 @@ To enable this configuration use the `extends` property in your
142143
| [no-side-effects-wait-for](docs/rules/no-side-effects-wait-for.md) | Disallow the use of side effects inside `waitFor` | | |
143144
| [no-wait-for-empty-callback](docs/rules/no-wait-for-empty-callback.md) | Disallow empty callbacks for `waitFor` and `waitForElementToBeRemoved` | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | |
144145
| [no-wait-for-snapshot](docs/rules/no-wait-for-snapshot.md) | Ensures no snapshot is generated inside of a `waitFor` call | | |
145-
| [no-wait-for-snapshot](docs/rules/no-wait-for-snapshot.md) | Ensures no snapshot is generated inside of a `waitFor` call | | |
146+
| [no-wait-for-snapshot](docs/rules/no-wait-for-snapshot.md) | Ensures no snapshot is generated inside of a `waitFor` call | | |
146147
| [prefer-explicit-assert](docs/rules/prefer-explicit-assert.md) | Suggest using explicit assertions rather than just `getBy*` queries | | |
147148
| [prefer-find-by](docs/rules/prefer-find-by.md) | Suggest using `findBy*` methods instead of the `waitFor` + `getBy` queries | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | ![fixable-badge][] |
148149
| [prefer-presence-queries](docs/rules/prefer-presence-queries.md) | Enforce specific queries when checking element is present or not | | |

lib/rules/await-async-utils.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
isImportNamespaceSpecifier,
1111
isCallExpression,
1212
isArrayExpression,
13-
isIdentifier
13+
isIdentifier,
1414
} from '../node-utils';
1515

1616
export const RULE_NAME = 'await-async-utils';
@@ -21,13 +21,24 @@ const ASYNC_UTILS_REGEXP = new RegExp(`^(${ASYNC_UTILS.join('|')})$`);
2121

2222
// verifies the CallExpression is Promise.all()
2323
function isPromiseAll(node: TSESTree.CallExpression) {
24-
return isMemberExpression(node.callee) && isIdentifier(node.callee.object) && node.callee.object.name === 'Promise' && isIdentifier(node.callee.property) && node.callee.property.name === 'all'
24+
return (
25+
isMemberExpression(node.callee) &&
26+
isIdentifier(node.callee.object) &&
27+
node.callee.object.name === 'Promise' &&
28+
isIdentifier(node.callee.property) &&
29+
node.callee.property.name === 'all'
30+
);
2531
}
2632

2733
// verifies the node is part of an array used in a CallExpression
2834
function isInPromiseAll(node: TSESTree.Node) {
29-
const parent = node.parent
30-
return isCallExpression(parent) && isArrayExpression(parent.parent) && isCallExpression(parent.parent.parent) && isPromiseAll(parent.parent.parent)
35+
const parent = node.parent;
36+
return (
37+
isCallExpression(parent) &&
38+
isArrayExpression(parent.parent) &&
39+
isCallExpression(parent.parent.parent) &&
40+
isPromiseAll(parent.parent.parent)
41+
);
3142
}
3243

3344
export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({

lib/rules/no-wait-for-snapshot.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({
8181
snapshotUsage.push(node);
8282
},
8383
'Program:exit'() {
84-
const testingLibraryUtilUsage = asyncUtilsUsage.filter(usage => {
84+
const testingLibraryUtilUsage = asyncUtilsUsage.filter((usage) => {
8585
if (isMemberExpression(usage.node)) {
8686
const object = usage.node.object as TSESTree.Identifier;
8787

@@ -109,8 +109,8 @@ export default ESLintUtils.RuleCreator(getDocsUrl)<Options, MessageIds>({
109109
return null;
110110
}
111111

112-
snapshotUsage.forEach(node => {
113-
testingLibraryUtilUsage.forEach(asyncUtilUsage => {
112+
snapshotUsage.forEach((node) => {
113+
testingLibraryUtilUsage.forEach((asyncUtilUsage) => {
114114
const closestAsyncUtil = getClosestAsyncUtil(asyncUtilUsage, node);
115115
if (closestAsyncUtil != null) {
116116
let name;

lib/rules/prefer-presence-queries.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { ESLintUtils, TSESTree } from '@typescript-eslint/experimental-utils';
2-
import { getDocsUrl, ALL_QUERIES_METHODS, PRESENCE_MATCHERS, ABSENCE_MATCHERS } from '../utils';
2+
import {
3+
getDocsUrl,
4+
ALL_QUERIES_METHODS,
5+
PRESENCE_MATCHERS,
6+
ABSENCE_MATCHERS,
7+
} from '../utils';
38
import {
49
findClosestCallNode,
510
isMemberExpression,

lib/rules/prefer-screen-queries.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function usesContainerOrBaseElement(node: TSESTree.CallExpression) {
2424
return (
2525
isObjectExpression(secondArgument) &&
2626
secondArgument.properties.some(
27-
property =>
27+
(property) =>
2828
isProperty(property) &&
2929
isIdentifier(property.key) &&
3030
ALLOWED_RENDER_PROPERTIES_FOR_DESTRUCTURING.includes(property.key.name)

0 commit comments

Comments
 (0)