Skip to content

Commit 19f22ab

Browse files
committed
Autofixed prettier issues
1 parent 142f844 commit 19f22ab

File tree

6 files changed

+12
-20
lines changed

6 files changed

+12
-20
lines changed

lib/rules/accordion-item-needs-header-and-panel.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({
2525
create(context) {
2626
return {
2727
JSXOpeningElement(node: TSESTree.JSXOpeningElement) {
28-
const isAccordionItem =
29-
node.name.type === AST_NODE_TYPES.JSXIdentifier &&
30-
node.name.name === "AccordionItem";
28+
const isAccordionItem = node.name.type === AST_NODE_TYPES.JSXIdentifier && node.name.name === "AccordionItem";
3129

3230
if (!isAccordionItem) return;
3331

lib/rules/counter-badge-needs-count.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,3 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({
8989
});
9090

9191
export default rule;
92-

lib/rules/dialogbody-needs-title-content-and-actions.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({
2525
create(context) {
2626
return {
2727
JSXOpeningElement(node: TSESTree.JSXOpeningElement) {
28-
const isDialogBody =
29-
node.name.type === AST_NODE_TYPES.JSXIdentifier &&
30-
node.name.name === "DialogBody";
28+
const isDialogBody = node.name.type === AST_NODE_TYPES.JSXIdentifier && node.name.name === "DialogBody";
3129

3230
if (!isDialogBody) {
3331
return;

lib/rules/rating-needs-name.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({
1414
meta: {
1515
// possible error messages for the rule
1616
messages: {
17-
missingAriaLabel: 'Accessibility - ratings must have an accessible name or an itemLabel that generates an aria label'
17+
missingAriaLabel: "Accessibility - ratings must have an accessible name or an itemLabel that generates an aria label"
1818
},
1919
// "problem" means the rule is identifying code that either will cause an error or may cause a confusing behavior: https://eslint.org/docs/latest/developer-guide/working-with-rules
2020
type: "problem",
2121
// docs for the rule
2222
docs: {
23-
description: "Accessibility: Ratings must have accessible labelling: name, aria-label, aria-labelledby or itemLabel which generates aria-label",
23+
description:
24+
"Accessibility: Ratings must have accessible labelling: name, aria-label, aria-labelledby or itemLabel which generates aria-label",
2425
recommended: "strict",
2526
url: "https://www.w3.org/TR/html-aria/" // URL to the documentation page for this rule
2627
},
@@ -32,9 +33,7 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({
3233
// visitor functions for different types of nodes
3334
JSXOpeningElement(node: TSESTree.JSXOpeningElement) {
3435
// if it is not a listed component, return
35-
if (
36-
elementType(node as JSXOpeningElement) !== "Rating"
37-
) {
36+
if (elementType(node as JSXOpeningElement) !== "Rating") {
3837
return;
3938
}
4039

lib/rules/tooltip-not-recommended.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import {ESLintUtils, TSESTree} from '@typescript-eslint/utils';
4+
import { ESLintUtils, TSESTree } from "@typescript-eslint/utils";
55
import { elementType } from "jsx-ast-utils";
66
import { hasToolTipParent } from "../util/hasTooltipParent";
7-
import { JSXOpeningElement } from 'estree-jsx';
7+
import { JSXOpeningElement } from "estree-jsx";
88

99
//------------------------------------------------------------------------------
1010
// Rule Definition
@@ -22,7 +22,7 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({
2222
type: "suggestion", // `problem`, `suggestion`, or `layout`
2323
docs: {
2424
description: `Accessibility: Prefer text content or aria over a tooltip for these components ${allowedComponents.join(", ")}`,
25-
recommended: 'strict',
25+
recommended: "strict"
2626
},
2727
schema: [] // Add a schema if the rule has options
2828
},
@@ -50,6 +50,4 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({
5050
}
5151
});
5252

53-
54-
55-
export default rule;
53+
export default rule;

tests/lib/rules/rating-needs-name.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import rule from "../../../lib/rules/rating-needs-name";
1818
ruleTester.run("rating-needs-name", rule as unknown as Rule.RuleModule, {
1919
valid: [
2020
// give me some code that won't trigger a warning
21-
'<Rating itemLabel={itemLabel} />',
21+
"<Rating itemLabel={itemLabel} />",
2222
'<Rating name="Rating" />',
2323
'<Rating aria-label="Rating" />',
2424
'<><Label id="label-id">Rating</Label><Rating aria-labelledby="label-id" /></>',
25-
'<Rating itemLabel={itemLabel}></Rating>',
25+
"<Rating itemLabel={itemLabel}></Rating>",
2626
'<Rating name="Rating"></Rating>',
2727
'<Rating aria-label="Rating"></Rating>',
2828
'<><Label id="label-id">Rating</Label><Rating aria-labelledby="label-id"></Rating></>'

0 commit comments

Comments
 (0)