Skip to content

Commit

Permalink
chore(deps): eslint-config-airbnb v19 (qlik-oss#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbt1 authored May 11, 2022
1 parent 4a4e2a9 commit 22243d9
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 108 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@typescript-eslint/parser": "5.22.0",
"babel-eslint": "10.1.0",
"eslint": "8.15.0",
"eslint-config-airbnb": "18.2.1",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-prettier": "8.5.0",
"eslint-import-resolver-typescript": "2.7.1",
Expand Down
6 changes: 3 additions & 3 deletions src/pivot-table/components/PivotTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ const DEFAULT_ROW_HEIGHT = 28;

const rowHightCallback = () => DEFAULT_ROW_HEIGHT;

export const StickyPivotTable = ({
export function StickyPivotTable({
model,
rect,
constraints,
viewService,
layoutService,
qPivotDataPages,
}: PivotTableProps): JSX.Element => {
}: PivotTableProps): JSX.Element {
const { qHyperCube } = layoutService.layout;
const scrollableContainerRef = useRef<HTMLDivElement>(null);
const topGridRef = useRef<VariableSizeList[]>([]);
Expand Down Expand Up @@ -194,5 +194,5 @@ export const StickyPivotTable = ({
</FullSizeContainer>
</ScrollableContainer>
);
};
}

6 changes: 2 additions & 4 deletions src/pivot-table/components/cells/DataCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const containerStyle: React.CSSProperties = {

export const testId = 'measure-cell';

const MeasureCell = ({ columnIndex, rowIndex, style, data }: MeasureCellProps): JSX.Element | null => {
export default function MeasureCell({ columnIndex, rowIndex, style, data }: MeasureCellProps): JSX.Element | null {
const { grid, layoutService } = data;
const cell = grid[rowIndex]?.[columnIndex];

Expand All @@ -59,6 +59,4 @@ const MeasureCell = ({ columnIndex, rowIndex, style, data }: MeasureCellProps):
</div>
</div>
);
};

export default MeasureCell;
}
8 changes: 3 additions & 5 deletions src/pivot-table/components/cells/DimensionCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ const createOnCollapse = ({ dataModel, isLeftColumn, rowIndex, colIndex, constra
};
};

const DimensionCell = ({
export default function DimensionCell({
cell,
rowIndex,
colIndex,
style,
isLeftColumn,
data
}: DimensionCellProps): JSX.Element => {
}: DimensionCellProps): JSX.Element {
const { qText, qCanCollapse, qCanExpand, qType } = cell.ref;
const {
constraints = { active: false, passive: false, select: false },
Expand Down Expand Up @@ -171,6 +171,4 @@ const DimensionCell = ({
</div>
</div>
);
};

export default DimensionCell;
}
14 changes: 7 additions & 7 deletions src/pivot-table/components/cells/DimensionTitleCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const labelTextStyle: React.CSSProperties = {

export const testId = 'title-cell';

const DimensionTitleCell = ({ cell, style }: LabelCellProps): JSX.Element => (
<div title={cell as string} style={{ ...style, ...borderStyle }} data-testid={testId}>
<div style={labelTextStyle}>{cell as string}</div>
</div>
);

export default DimensionTitleCell;
export default function DimensionTitleCell({ cell, style }: LabelCellProps): JSX.Element {
return (
<div title={cell as string} style={{ ...style, ...borderStyle }} data-testid={testId}>
<div style={labelTextStyle}>{cell as string}</div>
</div>
);
}
8 changes: 3 additions & 5 deletions src/pivot-table/components/cells/EmptyCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ interface EmptyCellProps {

export const testId = 'empty-cell';

const EmptyCell = ({ style }: EmptyCellProps): JSX.Element => (
<div style={{ ...style, ...borderStyle }} data-testid={testId} />
);

export default EmptyCell;
export default function EmptyCell({ style }: EmptyCellProps): JSX.Element {
return <div style={{ ...style, ...borderStyle }} data-testid={testId} />;
}
6 changes: 2 additions & 4 deletions src/pivot-table/components/cells/ListCellFactory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface ListCallbackProps {
data: ListItemData;
}

const ListCellFactory = ({ index, style, data}: ListCallbackProps): JSX.Element | null => {
export default function ListCellFactory({ index, style, data}: ListCallbackProps): JSX.Element | null {
const { list, isLeftColumn = false } = data;
const cell = list[index];
// useDebug('CellFactory', { columnIndex, rowIndex, style, data, cell }, { columnIndex, rowIndex, value: cell.value });
Expand Down Expand Up @@ -43,6 +43,4 @@ const ListCellFactory = ({ index, style, data}: ListCallbackProps): JSX.Element
style={style}
isLeftColumn={isLeftColumn}
/>;
};

export default ListCellFactory;
}
14 changes: 7 additions & 7 deletions src/pivot-table/components/cells/PseudoDimensionCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const leftContainerStyle: React.CSSProperties = {

export const testId = 'pseudo-dimension-cell';

const PseudoDimensionCell = ({ cell, style, isLeftColumn }: LabelCellProps): JSX.Element => (
<div style={{ ...style, ...borderStyle, ...(isLeftColumn ? leftContainerStyle : topContainerStyle) }} data-testid={testId}>
<div style={labelTextStyle}>{cell.ref.qText}</div>
</div>
);

export default PseudoDimensionCell;
export default function PseudoDimensionCell({ cell, style, isLeftColumn }: LabelCellProps): JSX.Element {
return (
<div style={{ ...style, ...borderStyle, ...(isLeftColumn ? leftContainerStyle : topContainerStyle) }} data-testid={testId}>
<div style={labelTextStyle}>{cell.ref.qText}</div>
</div>
);
}
14 changes: 7 additions & 7 deletions src/pivot-table/components/cells/TotalsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const labelTextStyle: React.CSSProperties = {

export const testId = 'totals-cell';

const TotalsCell = ({ cell, style }: LabelCellProps): JSX.Element => (
<div style={{ ...style, ...borderStyle }} data-testid={testId}>
<div style={labelTextStyle}>{cell.ref.qText}</div>
</div>
);

export default TotalsCell;
export default function TotalsCell({ cell, style }: LabelCellProps): JSX.Element {
return (
<div style={{ ...style, ...borderStyle }} data-testid={testId}>
<div style={labelTextStyle}>{cell.ref.qText}</div>
</div>
);
}
28 changes: 14 additions & 14 deletions src/pivot-table/components/containers/FullSizeContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ interface FullSizeContainerProps {
children: JSX.Element;
}

const FullSizeContainer = ({ width, height, children }: FullSizeContainerProps): JSX.Element => (
<div
data-testid="full-size-container"
style={{
display: 'block',
width,
height,
}}
>
{children}
</div>
);

export default FullSizeContainer;
export default function FullSizeContainer({ width, height, children }: FullSizeContainerProps): JSX.Element {
return (
<div
data-testid="full-size-container"
style={{
display: 'block',
width,
height,
}}
>
{children}
</div>
);
}
4 changes: 2 additions & 2 deletions src/pivot-table/components/containers/ScrollableContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface ScrollableContainerProps {
onScroll: (e: React.SyntheticEvent) => void;
}

const ScrollableContainer = (props: ScrollableContainerProps, ref: React.LegacyRef<HTMLDivElement>): JSX.Element => {
function ScrollableContainer(props: ScrollableContainerProps, ref: React.LegacyRef<HTMLDivElement>): JSX.Element {
const { rect, children, onScroll, constraints } = props;

return (
Expand All @@ -29,6 +29,6 @@ const ScrollableContainer = (props: ScrollableContainerProps, ref: React.LegacyR
{children}
</div>
);
};
}

export default React.forwardRef(ScrollableContainer);
46 changes: 22 additions & 24 deletions src/pivot-table/components/containers/StickyContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,32 @@ interface StickyContainerProps {
bottomRowsHeight: number;
}

const StickyContainer = (
{
export default function StickyContainer({
rect,
children,
leftColumnsWidth,
rightColumnsWidth,
topRowsHeight,
bottomRowsHeight
}:
StickyContainerProps
): JSX.Element => (
<div
data-testid="sticky-container"
style={{
display: 'grid',
position: 'sticky',
top: 0,
left: 0,
gridTemplateColumns: leftColumnsWidth // If leftColumnsWidth is 0, this means no data exist for "headers" or "left"
? `${leftColumnsWidth}px ${rightColumnsWidth}px`
: `${rightColumnsWidth}px`,
gridTemplateRows: `${topRowsHeight}px ${bottomRowsHeight}px`,
width: rect.width,
height: rect.height
}}
>
{children}
</div>
);

export default StickyContainer;
StickyContainerProps): JSX.Element {
return (
<div
data-testid="sticky-container"
style={{
display: 'grid',
position: 'sticky',
top: 0,
left: 0,
gridTemplateColumns: leftColumnsWidth // If leftColumnsWidth is 0, this means no data exist for "headers" or "left"
? `${leftColumnsWidth}px ${rightColumnsWidth}px`
: `${rightColumnsWidth}px`,
gridTemplateRows: `${topRowsHeight}px ${bottomRowsHeight}px`,
width: rect.width,
height: rect.height
}}
>
{children}
</div>
);
}
4 changes: 2 additions & 2 deletions src/pivot-table/components/grids/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const debouncedFetchMoreData: FetchModeData = debouncer((
}
}, 150);

const DataGrid = ({
function DataGrid({
dataModel,
dataGridRef,
getMeasureInfoWidth,
Expand All @@ -96,7 +96,7 @@ const DataGrid = ({
measureData,
hasMoreRows,
hasMoreColumns,
}: DataGridProps): JSX.Element | null => {
}: DataGridProps): JSX.Element | null {
if (measureData.size.x === 0) {
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/pivot-table/components/grids/HeaderGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const gridStyle: React.CSSProperties = {
...gridBorderStyle
};

const HeaderCellFactory = ({ columnIndex, rowIndex, style, data }: GridCallbackProps): JSX.Element | null => {
function HeaderCellFactory({ columnIndex, rowIndex, style, data }: GridCallbackProps): JSX.Element | null {
const cell = data.matrix[columnIndex][rowIndex];

if (typeof cell === 'string') {
Expand All @@ -42,13 +42,13 @@ const HeaderCellFactory = ({ columnIndex, rowIndex, style, data }: GridCallbackP
return null;
};

const HeaderGrid = ({
function HeaderGrid({
columnWidthCallback,
height,
rowHightCallback,
width,
headersData,
}: HeaderGridProps): JSX.Element | null => {
}: HeaderGridProps): JSX.Element | null {
if (headersData.size.x === 0) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/pivot-table/components/grids/LeftGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const getItemSizeCallback = (list: Cell[]) => (rowIndex: number) => {
return DEFAULT_ROW_HEIGHT;
};

const LeftGrid = ({
function LeftGrid({
dataModel,
leftGridRef,
getLeftColumnWidth,
Expand All @@ -57,7 +57,7 @@ const LeftGrid = ({
getScrollTop,
layoutService,
leftDimensionData
}: LeftGridProps): JSX.Element | null => {
}: LeftGridProps): JSX.Element | null {
if (leftDimensionData.size.x === 0) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/pivot-table/components/grids/TopGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const bottomListStyle: React.CSSProperties = {
...gridBorderStyle
};

const TopGrid = ({
function TopGrid({
dataModel,
topGridRef,
getMeasureInfoWidth,
Expand All @@ -42,7 +42,7 @@ const TopGrid = ({
getScrollLeft,
layoutService,
topDimensionData,
}: TopGridProps): JSX.Element | null => {
}: TopGridProps): JSX.Element | null {
if (topDimensionData.size.y === 0) {
// An empty top grid needs to occupy space to properly render headers given there is no top data
return <div style={{ width, height, ...bottomListStyle }} />;
Expand Down
23 changes: 7 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4925,15 +4925,6 @@ escodegen@^2.0.0:
optionalDependencies:
source-map "~0.6.1"

eslint-config-airbnb-base@^14.2.1:
version "14.2.1"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e"
integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==
dependencies:
confusing-browser-globals "^1.0.10"
object.assign "^4.1.2"
object.entries "^1.1.2"

eslint-config-airbnb-base@^15.0.0:
version "15.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236"
Expand All @@ -4951,14 +4942,14 @@ eslint-config-airbnb-typescript@17.0.0:
dependencies:
eslint-config-airbnb-base "^15.0.0"

eslint-config-airbnb@18.2.1:
version "18.2.1"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz#b7fe2b42f9f8173e825b73c8014b592e449c98d9"
integrity sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg==
eslint-config-airbnb@19.0.4:
version "19.0.4"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-19.0.4.tgz#84d4c3490ad70a0ffa571138ebcdea6ab085fdc3"
integrity sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew==
dependencies:
eslint-config-airbnb-base "^14.2.1"
eslint-config-airbnb-base "^15.0.0"
object.assign "^4.1.2"
object.entries "^1.1.2"
object.entries "^1.1.5"

eslint-config-prettier@8.5.0:
version "8.5.0"
Expand Down Expand Up @@ -7905,7 +7896,7 @@ object.assign@^4.1.0, object.assign@^4.1.2:
has-symbols "^1.0.1"
object-keys "^1.1.1"

object.entries@^1.1.2, object.entries@^1.1.5:
object.entries@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861"
integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==
Expand Down

0 comments on commit 22243d9

Please sign in to comment.