Skip to content

Commit 6f2e993

Browse files
committed
disabled array-bracket-spacing rule to match prettier config, fix lint exception by using Fragment
1 parent facc679 commit 6f2e993

File tree

3 files changed

+70
-86
lines changed

3 files changed

+70
-86
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@typescript-eslint/unified-signatures": "error",
5353
"@typescript-eslint/no-var-requires": "off",
5454
"arrow-body-style": "error",
55-
"array-bracket-spacing": ["error", "always"],
55+
"array-bracket-spacing": "off",
5656
"camelcase": [
5757
"error",
5858
{

package-lock.json

Lines changed: 62 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/module/src/DataViewTh/DataViewTh.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
ReactNode,
88
useCallback,
99
useRef,
10-
useEffect
10+
useEffect,
11+
Fragment
1112
} from 'react';
1213
import { Th, ThProps } from '@patternfly/react-table';
1314
import { Button, getLanguageDirection } from '@patternfly/react-core';
@@ -90,7 +91,7 @@ export const DataViewTh: FC<DataViewThProps> = ({
9091
}: DataViewThProps) => {
9192
const thRef = useRef<HTMLTableCellElement>(null);
9293

93-
const [ width, setWidth ] = useState(resizableProps?.width ? resizableProps.width : 0);
94+
const [width, setWidth] = useState(resizableProps?.width ? resizableProps.width : 0);
9495
// Tracks the current column width for the onResize callback, because the width state is not updated until after the resize is complete
9596
const trackedWidth = useRef(0);
9697
const classes = useStyles();
@@ -123,7 +124,7 @@ export const DataViewTh: FC<DataViewThProps> = ({
123124

124125
const observed = resizeButtonRef.current;
125126
const observer = new IntersectionObserver(
126-
([ entry ]) => {
127+
([entry]) => {
127128
isInView.current = entry.isIntersecting;
128129
},
129130
{ threshold: 0.3 }
@@ -145,7 +146,7 @@ export const DataViewTh: FC<DataViewThProps> = ({
145146
setWidth(thRef.current?.getBoundingClientRect().width || 0);
146147
setInitialVals.current = false;
147148
}
148-
}, [ isResizable, hasResizableColumns, setInitialVals ]);
149+
}, [isResizable, hasResizableColumns, setInitialVals]);
149150

150151
const setDragOffset = (e: ReactMouseEvent | ReactTouchEvent) => {
151152
const isRTL = getLanguageDirection(thRef.current as HTMLElement) === 'rtl';
@@ -305,7 +306,7 @@ export const DataViewTh: FC<DataViewThProps> = ({
305306
};
306307

307308
const resizableContent = (
308-
<>
309+
<Fragment>
309310
<div aria-live="polite" className="pf-v6-screen-reader">
310311
{screenReaderText}
311312
</div>
@@ -320,7 +321,7 @@ export const DataViewTh: FC<DataViewThProps> = ({
320321
aria-label={resizeButtonAriaLabel}
321322
className={classes.dataViewResizableButton}
322323
/>
323-
</>
324+
</Fragment>
324325
);
325326

326327
return (

0 commit comments

Comments
 (0)