Skip to content

Commit 0d2c950

Browse files
author
Iryna Vasylenko
committed
Fix build
1 parent ad6dd55 commit 0d2c950

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,17 @@ Any use of third-party trademarks or logos are subject to those third-party's po
116116
| [badge-needs-accessible-name](docs/rules/badge-needs-accessible-name.md) | | ✅ | | 🔧 |
117117
| [breadcrumb-needs-labelling](docs/rules/breadcrumb-needs-labelling.md) | All interactive elements must have an accessible name | ✅ | | |
118118
| [checkbox-needs-labelling](docs/rules/checkbox-needs-labelling.md) | Accessibility: Checkbox without label must have an accessible and visual label: aria-labelledby | ✅ | | |
119+
| [colorswatch-needs-labelling](docs/rules/colorswatch-needs-labelling.md) | Accessibility: ColorSwatch must have an accessible name via aria-label, Tooltip, aria-labelledby, etc.. | ✅ | | |
119120
| [combobox-needs-labelling](docs/rules/combobox-needs-labelling.md) | All interactive elements must have an accessible name | ✅ | | |
120121
| [compound-button-needs-labelling](docs/rules/compound-button-needs-labelling.md) | Accessibility: Compound buttons must have accessible labelling: title, aria-label, aria-labelledby, aria-describedby | ✅ | | |
121122
| [counter-badge-needs-count](docs/rules/counter-badge-needs-count.md) | | ✅ | | 🔧 |
122123
| [dialogbody-needs-title-content-and-actions](docs/rules/dialogbody-needs-title-content-and-actions.md) | A DialogBody should have a header(DialogTitle), content(DialogContent), and footer(DialogActions) | ✅ | | |
123124
| [dialogsurface-needs-aria](docs/rules/dialogsurface-needs-aria.md) | DialogueSurface need accessible labelling: aria-describedby on DialogueSurface and aria-label or aria-labelledby(if DialogueTitle is missing) | ✅ | | |
124125
| [dropdown-needs-labelling](docs/rules/dropdown-needs-labelling.md) | Accessibility: Dropdown menu must have an id and it needs to be linked via htmlFor of a Label | ✅ | | |
126+
| [emptyswatch-needs-labelling](docs/rules/emptyswatch-needs-labelling.md) | Accessibility: EmptySwatch must have an accessible name via aria-label, Tooltip, aria-labelledby, etc.. | ✅ | | |
125127
| [field-needs-labelling](docs/rules/field-needs-labelling.md) | Accessibility: Field must have label | ✅ | | |
126128
| [image-button-missing-aria](docs/rules/image-button-missing-aria.md) | Accessibility: Image buttons must have accessible labelling: title, aria-label, aria-labelledby, aria-describedby | ✅ | | |
129+
| [imageswatch-needs-labelling](docs/rules/imageswatch-needs-labelling.md) | Accessibility: ImageSwatch must have an accessible name via aria-label, Tooltip, aria-labelledby, etc.. | ✅ | | |
127130
| [input-components-require-accessible-name](docs/rules/input-components-require-accessible-name.md) | Accessibility: Input fields must have accessible labelling: aria-label, aria-labelledby or an associated label | ✅ | | |
128131
| [link-missing-labelling](docs/rules/link-missing-labelling.md) | Accessibility: Image links must have an accessible name. Add either text content, labelling to the image or labelling to the link itself. | ✅ | | 🔧 |
129132
| [menu-item-needs-labelling](docs/rules/menu-item-needs-labelling.md) | Accessibility: MenuItem without label must have an accessible and visual label: aria-labelledby | ✅ | | |
@@ -140,7 +143,7 @@ Any use of third-party trademarks or logos are subject to those third-party's po
140143
| [switch-needs-labelling](docs/rules/switch-needs-labelling.md) | Accessibility: Switch must have an accessible label | ✅ | | |
141144
| [tablist-and-tabs-need-labelling](docs/rules/tablist-and-tabs-need-labelling.md) | This rule aims to ensure that Tabs with icons but no text labels have an accessible name and that Tablist is properly labeled. | ✅ | | |
142145
| [tag-dismissible-needs-labelling](docs/rules/tag-dismissible-needs-labelling.md) | This rule aims to ensure that dismissible Tag components have proper accessibility labelling: either aria-label on dismissIcon or aria-label on Tag with role on dismissIcon | ✅ | | |
143-
| [tag-needs-name](docs/rules/tag-needs-name.md) | This rule aims to ensure that Tag component have an accessible name via text content, aria-label, or aria-labelledby. | ✅ | | |
146+
| [tag-needs-name](docs/rules/tag-needs-name.md) | Accessibility: Tag must have an accessible name | ✅ | | |
144147
| [toolbar-missing-aria](docs/rules/toolbar-missing-aria.md) | Accessibility: Toolbars need accessible labelling: aria-label or aria-labelledby | ✅ | | |
145148
| [tooltip-not-recommended](docs/rules/tooltip-not-recommended.md) | Accessibility: Prefer text content or aria over a tooltip for these components MenuItem, SpinButton | ✅ | | |
146149
| [visual-label-better-than-aria-suggestion](docs/rules/visual-label-better-than-aria-suggestion.md) | Visual label is better than an aria-label because sighted users can't read the aria-label text. | | ✅ | |

docs/rules/tag-needs-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This rule aims to ensure that Tag component have an accessible name via text content, aria-label, or aria-labelledby (`@microsoft/fluentui-jsx-a11y/tag-needs-name`)
1+
# Accessibility: Tag must have an accessible name (`@microsoft/fluentui-jsx-a11y/tag-needs-name`)
22

33
💼 This rule is enabled in the ✅ `recommended` config.
44

lib/rules/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export { default as swatchpickerNeedsLabelling } from "./swatchpicker-needs-labe
3636
export { default as switchNeedsLabelling } from "./switch-needs-labelling";
3737
export { default as tablistAndTabsNeedLabelling } from "./tablist-and-tabs-need-labelling";
3838
export { default as tagDismissibleNeedsLabelling } from "./tag-dismissible-needs-labelling";
39-
export { default as tagNeedsName } from "./tag-needs-name";
39+
export { default as tagNeedsName } from "./tag-needs-labelling";
4040
export { default as toolbarMissingAria } from "./toolbar-missing-aria";
4141
export { default as tooltipNotRecommended } from "./tooltip-not-recommended";
4242
export { default as visualLabelBetterThanAriaSuggestion } from "./visual-label-better-than-aria-suggestion";
File renamed without changes.

lib/util/hasValidNestedProp.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const isNonEmptyString = (value: any): boolean => {
1313
};
1414

1515
/**
16-
* Validates nested properties within a complex prop (object prop).
17-
* This is useful for props like dismissIcon={{ "aria-label": "close", role: "button" }}
18-
* where you need to check specific properties within the object.
16+
* Validates if a component has a specific nested property with a non-empty string value.
1917
*/
2018
export const hasValidNestedProp = (openingElement: TSESTree.JSXOpeningElement, propName: string, nestedKey: string): boolean => {
2119
const prop = getProp(openingElement.attributes as JSXAttribute[], propName);

lib/util/ruleFactory.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ export type LabeledControlConfig = {
3535
allowDescribedBy: boolean;
3636
allowLabeledChild: boolean; // Accept labeled child elements to provide the label e.g. <Button><img alt="..." /></Button>
3737
allowTextContentChild?: boolean; // Accept text children to provide the label e.g. <Button>Click me</Button>
38-
/** Only apply rule when this trigger prop is present (e.g., "dismissible", "disabled") */
39-
triggerProp?: string;
40-
/** Custom validation function for complex scenarios */
41-
customValidator?: Function;
38+
triggerProp?: string; // Only apply rule when this trigger prop is present (e.g., "dismissible", "disabled")
39+
customValidator?: Function; // Custom validation logic
4240
};
4341

4442
/**

tests/lib/rules/tag-needs-name.test.ts renamed to tests/lib/rules/tag-needs-labelling.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { Rule } from "eslint";
55
import ruleTester from "./helper/ruleTester";
6-
import rule from "../../../lib/rules/tag-needs-name";
6+
import rule from "../../../lib/rules/tag-needs-labelling";
77

88
//------------------------------------------------------------------------------
99
// Requirements

0 commit comments

Comments
 (0)