diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33588f4c09..9541b67bdf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - name: Lint # Continue on error so, we can see lint issues but not fail the build, we should fix them incrementally continue-on-error: true - run: yarn run lint + run: yarn biome ci --reporter=github - name: Prettier run: yarn run prettier:ci - name: Stylelint diff --git a/biome.json b/biome.json index f846b7c68f..32e25f0ee7 100644 --- a/biome.json +++ b/biome.json @@ -7,7 +7,7 @@ "defaultBranch": "main" }, "files": { - "ignore": [".next", "mockServiceWorker.js", "*-props.json"] + "ignore": [".next", "mockServiceWorker.js", "*-props.json", ".tmp"] }, "organizeImports": { "enabled": true @@ -45,8 +45,8 @@ "level": "error", "fix": "safe" }, - "noNonNullAssertion": "warn", - "noParameterAssign": "warn" + "noParameterAssign": "warn", + "noNonNullAssertion": "warn" }, "nursery": { "noUselessStringConcat": { "level": "error", "fix": "safe" } @@ -60,10 +60,26 @@ "noAutofocus": "off", "noNoninteractiveElementToInteractiveRole": "off", "noNoninteractiveTabindex": "off", - "noSvgWithoutTitle": "off" + "noSvgWithoutTitle": "off", + "useAriaPropsForRole": "warn" }, "correctness": { - "useExhaustiveDependencies": "warn", + "useExhaustiveDependencies": { + "level": "warn", + "options": { + "hooks": [ + { + "name": "useIsomorphicLayoutEffect", + "closureIndex": 0, + "dependenciesIndex": 1 + }, + { + "name": "useControlled", + "stableResult": [1] + } + ] + } + }, "noSwitchDeclarations": { "level": "error", "fix": "safe" @@ -74,7 +90,8 @@ "noGlobalIsNan": { "level": "error", "fix": "safe" - } + }, + "noExplicitAny": "warn" } } }, @@ -100,6 +117,9 @@ }, "complexity": { "noForEach": "off" + }, + "suspicious": { + "noImplicitAnyLet": "off" } } } @@ -130,6 +150,29 @@ } } } + }, + { + "include": [ + "packages/*/stories/*-layout/**", + "site/src/examples/*-layout/**" + ], + "linter": { + "rules": { + "suspicious": { + "noArrayIndexKey": "off" + } + } + } + }, + { + "include": ["site/src/examples/**", "packages/*/stories/**"], + "linter": { + "rules": { + "suspicious": { + "noShadowRestrictedNames": "off" + } + } + } } ] } diff --git a/docs/components/QAContainer.tsx b/docs/components/QAContainer.tsx index 4bfe9845aa..499b34e843 100644 --- a/docs/components/QAContainer.tsx +++ b/docs/components/QAContainer.tsx @@ -66,8 +66,8 @@ const DensityBlock = ({ return ( - {DensityValues.map((d, i) => ( - + {DensityValues.map((d) => ( +
{children}
))} @@ -125,8 +125,8 @@ export const QAContainer = ({ ))} ) : ( - DensityValues.map((d, i) => ( - + DensityValues.map((d) => ( + { useEffect(() => { if (isGridReady) { - api!.sizeColumnsToFit(); + api?.sizeColumnsToFit(); - api!.setGridOption("datasource", { + api?.setGridOption("datasource", { getRows: ({ startRow, endRow, successCallback }) => { setTimeout(() => { successCallback( @@ -39,7 +39,7 @@ const InfiniteScroll = (props: AgGridReactProps) => { }, }); } - }, [isGridReady]); + }, [isGridReady, api]); return (
diff --git a/packages/ag-grid-theme/src/examples/MasterDetail.tsx b/packages/ag-grid-theme/src/examples/MasterDetail.tsx index 772e95bbce..07c001f664 100644 --- a/packages/ag-grid-theme/src/examples/MasterDetail.tsx +++ b/packages/ag-grid-theme/src/examples/MasterDetail.tsx @@ -35,7 +35,9 @@ const MasterDetail = (props: AgGridReactProps) => { detailCellRenderer={detailCellRenderer} detailCellRendererParams={{ detailGridOptions: { columnDefs }, - getDetailRowData: (params: any) => params.successCallback(rowData), + getDetailRowData: (params: { + successCallback: (data: typeof rowData) => void; + }) => params.successCallback(rowData), }} masterDetail={true} detailRowHeight={300} diff --git a/packages/ag-grid-theme/src/examples/Pagination.tsx b/packages/ag-grid-theme/src/examples/Pagination.tsx index 0266510cea..d3733be797 100644 --- a/packages/ag-grid-theme/src/examples/Pagination.tsx +++ b/packages/ag-grid-theme/src/examples/Pagination.tsx @@ -11,7 +11,7 @@ const generateData = (states: typeof dataGridExampleData) => for (let i = 0; i < 20; i++) { data.push({ ...row, name: `${row.name} ${i}` }); } - return [...result, ...data]; + return result.concat(data); }, [] as typeof dataGridExampleData, ); diff --git a/packages/ag-grid-theme/src/examples/RangeSelection.tsx b/packages/ag-grid-theme/src/examples/RangeSelection.tsx index 9f69b29860..291c670103 100644 --- a/packages/ag-grid-theme/src/examples/RangeSelection.tsx +++ b/packages/ag-grid-theme/src/examples/RangeSelection.tsx @@ -16,7 +16,7 @@ export const RangeSelection = (props: AgGridReactProps) => { columnEnd: "population", }); } - }, [isGridReady]); + }, [isGridReady, api]); return (
diff --git a/packages/ag-grid-theme/src/examples/SortAndFilter.tsx b/packages/ag-grid-theme/src/examples/SortAndFilter.tsx index 56b69c6813..36cf1938e6 100644 --- a/packages/ag-grid-theme/src/examples/SortAndFilter.tsx +++ b/packages/ag-grid-theme/src/examples/SortAndFilter.tsx @@ -48,7 +48,7 @@ const SortAndFilter = (props: AgGridReactProps) => { } void setFilter(); - }, [isGridReady]); + }, [isGridReady, api]); return (
diff --git a/packages/core/src/__tests__/__e2e__/aria-announcer/useAriaAnnounce.cy.tsx b/packages/core/src/__tests__/__e2e__/aria-announcer/useAriaAnnounce.cy.tsx index 6f7616b6e8..4ad68bad32 100644 --- a/packages/core/src/__tests__/__e2e__/aria-announcer/useAriaAnnounce.cy.tsx +++ b/packages/core/src/__tests__/__e2e__/aria-announcer/useAriaAnnounce.cy.tsx @@ -19,7 +19,7 @@ interface SimpleTestContentProps { announcement?: string; delay?: number; debounce?: number; - getAnnouncement?: Function; + getAnnouncement?: () => string; } const SimpleTestContent = ({ @@ -36,14 +36,16 @@ const SimpleTestContent = ({ <>