Skip to content

Commit

Permalink
chore: fix lint warnings for @fluentui/react (microsoft#28888)
Browse files Browse the repository at this point in the history
Resolves all lints warnings for @fluentui/react package.
  • Loading branch information
spmonahan committed Aug 17, 2023
1 parent 8696dd1 commit 669c13c
Show file tree
Hide file tree
Showing 48 changed files with 105 additions and 112 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: fix all lint warnings for @fluentui/react",
"packageName": "@fluentui/react",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export const CalendarDayBase: React.FunctionComponent<ICalendarDayProps> = props

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
className,
headerIsClickable: !!onHeaderSelect,
showWeekNumbers: showWeekNumbers,
animationDirection: animationDirection,
showWeekNumbers,
animationDirection,
});

const monthAndYear = dateTimeFormatter.formatMonthYear(navigatedDate, strings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ export const styles = (props: ICalendarDayStyleProps): ICalendarDayStyles => {
},
},
],
disabledStyle: disabledStyle,
disabledStyle,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ export const CalendarMonthBase: React.FunctionComponent<ICalendarMonthProps> = p

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
className,
hasHeaderClickCallback: !!props.onHeaderSelect || !yearPickerHidden,
highlightCurrent: highlightCurrentMonth,
highlightSelected: highlightSelectedMonth,
animateBackwards: animateBackwards,
animationDirection: animationDirection,
animateBackwards,
animationDirection,
});

if (isYearPickerVisible) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const CalendarYearGridCell: React.FunctionComponent<ICalendarYearGridCellProps>

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
className,
highlightCurrent: highlightCurrentYear,
highlightSelected: highlightSelectedYear,
});
Expand Down Expand Up @@ -163,9 +163,9 @@ const CalendarYearGrid: React.FunctionComponent<ICalendarYearGridProps> = props

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
animateBackwards: animateBackwards,
animationDirection: animationDirection,
className,
animateBackwards,
animationDirection,
});

const onRenderYear = (value: number) => {
Expand Down Expand Up @@ -228,7 +228,7 @@ const CalendarYearNavArrow: React.FunctionComponent<ICalendarYearNavArrowProps>

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
className,
});

const ariaLabel =
Expand Down Expand Up @@ -279,7 +279,7 @@ const CalendarYearNav: React.FunctionComponent<ICalendarYearHeaderProps> = props

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
className,
});

return (
Expand Down Expand Up @@ -320,10 +320,10 @@ const CalendarYearTitle: React.FunctionComponent<ICalendarYearHeaderProps> = pro

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
className,
hasHeaderClickCallback: !!props.onHeaderSelect,
animateBackwards: animateBackwards,
animationDirection: animationDirection,
animateBackwards,
animationDirection,
});

if (props.onHeaderSelect) {
Expand Down Expand Up @@ -368,10 +368,10 @@ const CalendarYearHeader: React.FunctionComponent<ICalendarYearHeaderProps> = pr

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
className,
hasHeaderClickCallback: !!props.onHeaderSelect,
animateBackwards: animateBackwards,
animationDirection: animationDirection,
animateBackwards,
animationDirection,
});

return (
Expand Down Expand Up @@ -438,7 +438,7 @@ export const CalendarYearBase: React.FunctionComponent<ICalendarYearProps> = pro

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
className,
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ export const CalendarDayGridBase: React.FunctionComponent<ICalendarDayGridProps>

const classNames = getClassNames(styles, {
theme: theme!,
className: className,
dateRangeType: dateRangeType,
showWeekNumbers: showWeekNumbers,
className,
dateRangeType,
showWeekNumbers,
lightenDaysOutsideNavigatedMonth:
lightenDaysOutsideNavigatedMonth === undefined ? true : lightenDaysOutsideNavigatedMonth,
animationDirection: animationDirection,
animateBackwards: animateBackwards,
animationDirection,
animateBackwards,
});

// When the month is highlighted get the corner dates so that styles can be added to them
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Check/Check.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getStyles = (props: ICheckStyleProps): ICheckStyles => {
left: 0,
top: 0,
width: height,
height: height,
height,
textAlign: 'center',
// inline-flex prevents the check from shifting with custom line height styles
display: 'inline-flex',
Expand All @@ -43,7 +43,7 @@ export const getStyles = (props: ICheckStyleProps): ICheckStyles => {
// lineHeight currently needs to be a string to output without 'px'
lineHeight: '1',
width: height,
height: height,
height,
verticalAlign: 'top',
position: 'relative',
userSelect: 'none',
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Coachmark/Beak/Beak.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const Beak: React.FunctionComponent<IBeakProps> = React.forwardRef<HTMLDi
right,
height: `${svgHeight}px`,
width: `${svgWidth}px`,
transform: transform,
transform,
color,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export function getStyles(props: ICoachmarkStyleProps): ICoachmarkStyles {
entityInnerHost: [
{
transition: 'transform 500ms cubic-bezier(0.5, 0, 0, 1)',
transformOrigin: transformOrigin,
transformOrigin,
transform: 'scale(0)',
},
!isCollapsed && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const getDetailsColumnStyles = (props: IDetailsColumnStyleProps): IDetail

accessibleLabel: hiddenContentStyle,

borderWhileDragging: borderWhileDragging,
borderWhileDragging,

noBorderWhileDragging: [borderAfterDragOrDrop, { transition: `outline ${transitionDurationDrag}ms ease` }],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const getDetailsRowCheckStyles = (props: IDetailsRowCheckStyleProps): IDe
backgroundColor: 'transparent',
border: 'none',
opacity: isCheckVisible ? 1 : 0,
height: height,
height,
width: CHECK_CELL_WIDTH,
padding: 0,
margin: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const VerticalDividerBase: React.FunctionComponent<IVerticalDividerProps>
>((props, ref) => {
// eslint-disable-next-line deprecation/deprecation
const { styles, theme, getClassNames: deprecatedGetClassNames, className } = props;
const classNames = getClassNames(styles, { theme: theme, getClassNames: deprecatedGetClassNames, className });
const classNames = getClassNames(styles, { theme, getClassNames: deprecatedGetClassNames, className });
return (
<span className={classNames.wrapper} ref={ref}>
<span className={classNames.divider} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ export class DocumentCardPreviewBase extends React.Component<IDocumentCardPrevie

if (previewIconProps) {
return (
<div
className={css(this._classNames.previewIcon, previewIconContainerClass)}
style={{ width: width, height: height }}
>
<div className={css(this._classNames.previewIcon, previewIconContainerClass)} style={{ width, height }}>
<Icon {...previewIconProps} />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const basicRenderSelectedItemsList = (props: IBaseSelectedItemsListProps<ISimple
};

const floatingPickerProps = {
onResolveSuggestions: onResolveSuggestions,
onResolveSuggestions,
onRenderSuggestionsItem: basicSuggestionRenderer,
suggestionsStore: new SuggestionsStore<ISimple>(),
};
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Fabric/Fabric.base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const FabricBase: React.FunctionComponent<IFabricProps> = React.forwardRe

const classNames = getClassNames(styles, {
theme: theme!,
applyTheme: applyTheme,
applyTheme,
className,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function createItem(name: string, isValid: boolean): ISuggestionModel<IPe
key: name,
primaryText: name,
imageInitials: '!',
isValid: isValid,
isValid,
};

if (!isValid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class GroupedListBase extends React.Component<IGroupedListProps, IGrouped
this._classNames = getClassNames(styles, {
theme: theme!,
className,
compact: compact,
compact,
});

const { shouldEnterInnerZone = this._isInnerZoneKeystroke } = focusZoneProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export const CardCallout = (props: ICardCalloutProps) => {

const mergedCalloutProps: ICalloutProps = {
...getNativeProps(props, divProperties),
className: className,
className,
target: targetElement,
isBeakVisible: false,
directionalHint: directionalHint,
directionalHintFixed: directionalHintFixed,
finalHeight: finalHeight,
directionalHint,
directionalHintFixed,
finalHeight,
minPagePadding: 24,
onDismiss: onLeave,
gapSpace: gapSpace,
gapSpace,
...calloutProps,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class ExpandingCardBase extends React.Component<IExpandingCardProps, IExp
compactCardHeight,
className,
expandedCardHeight,
needsScroll: needsScroll,
needsScroll,
expandedCardFirstFrameRendered: mode === ExpandingCardMode.expanded && firstFrameRendered,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Image/Image.base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const ImageBase: React.FunctionComponent<IImageProps> = React.forwardRef<

// If image dimensions aren't specified, the natural size of the image is used.
return (
<div className={classNames.root} style={{ width: width, height: height }} ref={frameElement}>
<div className={classNames.root} style={{ width, height }} ref={frameElement}>
<img
{...imageProps}
onLoad={onImageLoaded}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export class KeytipLayerBase extends React.Component<IKeytipLayerProps, IKeytipL
* @param inKeytipMode - Boolean so set whether we are in keytip mode or not
*/
private _setInKeytipMode = (inKeytipMode: boolean): void => {
this.setState({ inKeytipMode: inKeytipMode });
this.setState({ inKeytipMode });
this._keytipManager.inKeytipMode = inKeytipMode;
};

Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/components/MessageBar/MessageBar.base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ export const MessageBarBase: React.FunctionComponent<IMessageBarProps> = React.f
messageBarType: messageBarType || MessageBarType.info,
onDismiss: onDismiss !== undefined,
actions: actions !== undefined,
truncated: truncated,
isMultiline: isMultiline,
expandSingleLine: expandSingleLine,
truncated,
isMultiline,
expandSingleLine,
className,
});

Expand Down
3 changes: 0 additions & 3 deletions packages/react/src/components/Nav/Nav.base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export class NavBase extends React.Component<INavProps, INavState> implements IN
initializeComponentRef(this);
this.state = {
isGroupCollapsed: {},
// TODO: consider removing
// eslint-disable-next-line react/no-unused-state
isLinkExpandStateChanged: false,
selectedKey: props.initialSelectedKey || props.selectedKey,
};
Expand Down Expand Up @@ -309,7 +307,6 @@ export class NavBase extends React.Component<INavProps, INavState> implements IN

if (!ev.defaultPrevented) {
link.isExpanded = !link.isExpanded;
// eslint-disable-next-line react/no-unused-state
this.setState({ isLinkExpandStateChanged: true });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class ProgressIndicatorBase extends React.Component<IProgressIndicatorPro
? onRenderProgress(
{
...(this.props as IProgressIndicatorProps),
percentComplete: percentComplete,
percentComplete,
},
this._onRenderProgress,
)
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Rating/Rating.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const GlobalClassNames = {

function _getColorWithHighContrast(color: string, highContrastColor: string) {
return {
color: color,
color,
selectors: {
[HighContrastSelector]: {
color: highContrastColor,
Expand Down
Loading

0 comments on commit 669c13c

Please sign in to comment.