Skip to content

Commit

Permalink
Merge branch 'main' into feat/use-column-frozen-prop-for-tree-data-grid
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasilgeo authored Jan 17, 2024
2 parents a213ad4 + e396ea8 commit c2e0f19
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 22 deletions.
27 changes: 22 additions & 5 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"recommended": false,
"a11y": {
"noAccessKey": "warn",
"noAriaHiddenOnFocusable": "warn",
"noAriaUnsupportedElements": "warn",
"noAutofocus": "off",
"noBlankTarget": "warn",
Expand All @@ -49,14 +50,15 @@
"useMediaCaption": "off",
"useValidAnchor": "off",
"useValidAriaProps": "warn",
"useValidAriaRole": "warn",
"useValidAriaValues": "warn",
"useValidLang": "warn"
},
"complexity": {
"noBannedTypes": "warn",
"noExcessiveCognitiveComplexity": "off",
"noExtraBooleanCast": "warn",
"noForEach": "off",
"noForEach": "warn",
"noMultipleSpacesInRegularExpressionLiterals": "warn",
"noStaticOnlyClass": "warn",
"noThisInStatic": "warn",
Expand All @@ -75,6 +77,7 @@
"useFlatMap": "warn",
"useLiteralKeys": "warn",
"useOptionalChain": "warn",
"useRegexLiterals": "warn",
"useSimpleNumberKeys": "warn",
"useSimplifiedLogicExpression": "off"
},
Expand Down Expand Up @@ -107,8 +110,8 @@
"noUnusedVariables": "warn",
"noVoidElementsWithChildren": "warn",
"noVoidTypeReturn": "warn",
"useExhaustiveDependencies": "off",
"useHookAtTopLevel": "off",
"useExhaustiveDependencies": "warn",
"useHookAtTopLevel": "warn",
"useIsNan": "warn",
"useValidForDirection": "warn",
"useYield": "warn"
Expand All @@ -124,6 +127,7 @@
"style": {
"noArguments": "warn",
"noCommaOperator": "warn",
"noDefaultExport": "off",
"noImplicitBoolean": "off",
"noInferrableTypes": "warn",
"noNamespace": "warn",
Expand All @@ -134,7 +138,7 @@
"noRestrictedGlobals": "warn",
"noShoutyConstants": "warn",
"noUnusedTemplateLiteral": "warn",
"noUselessElse": "off",
"noUselessElse": "warn",
"noVar": "warn",
"useAsConstAssertion": "warn",
"useBlockStatements": "off",
Expand Down Expand Up @@ -183,6 +187,7 @@
"noFunctionAssign": "warn",
"noGlobalIsFinite": "warn",
"noGlobalIsNan": "warn",
"noImplicitAnyLet": "off",
"noImportAssign": "warn",
"noLabelVar": "warn",
"noMisleadingInstantiator": "warn",
Expand All @@ -205,5 +210,17 @@
},
"organizeImports": {
"enabled": false
}
},
"overrides": [
{
"include": ["**/*.js"],
"linter": {
"rules": {
"suspicious": {
"noConsoleLog": "off"
}
}
}
}
]
}
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.21.5",
"@biomejs/biome": "1.4.1",
"@biomejs/biome": "1.5.2",
"@faker-js/faker": "^8.0.0",
"@ianvs/prettier-plugin-sort-imports": "^4.0.2",
"@linaria/core": "^6.0.0",
"@microsoft/api-extractor": "^7.23.0",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.1.1",
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
"@types/lodash-es": "^4.17.7",
"@types/node": "^20.10.3",
"@types/react": "^18.2.35",
"@types/react-dom": "^18.2.4",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"@vitejs/plugin-react": "^4.0.2",
"@vitest/coverage-v8": "^1.0.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.2.0",
"@wyw-in-js/rollup": "^0.2.2",
"@wyw-in-js/vite": "^0.2.2",
"babel-plugin-optimize-clsx": "^2.6.2",
Expand All @@ -91,12 +91,12 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-sonarjs": "^0.23.0",
"eslint-plugin-testing-library": "^6.2.0",
"jsdom": "^23.0.1",
"jsdom": "23.1.0",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.23",
"lodash-es": "^4.17.21",
"postcss": "^8.4.25",
"prettier": "3.1.1",
"prettier": "3.2.2",
"react": "^18.1.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
Expand All @@ -105,8 +105,8 @@
"rollup": "^4.0.2",
"rollup-plugin-postcss": "^4.0.2",
"typescript": "~5.3.2",
"vite": "^5.0.0",
"vitest": "^1.0.0"
"vite": "^5.0.11",
"vitest": "^1.2.0"
},
"peerDependencies": {
"react": "^18.0",
Expand Down
4 changes: 2 additions & 2 deletions src/TreeDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ function TreeDataGrid<R, SR, K extends Key>(
if (!onRowsChange) return;
const updatedRawRows = [...rawRows];
const rawIndexes: number[] = [];
indexes.forEach((index) => {
for (const index of indexes) {
const rawIndex = rawRows.indexOf(rows[index] as R);
updatedRawRows[rawIndex] = updatedRows[index];
rawIndexes.push(rawIndex);
});
}
onRowsChange(updatedRawRows, {
indexes: rawIndexes,
column
Expand Down
8 changes: 4 additions & 4 deletions test/column/summaryCellClass.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ test('summaryCellClass is a string', () => {
];
setup({ columns, topSummaryRows, bottomSummaryRows, rows: [] });
const cells = getCells();
cells.forEach((cell) => {
for (const cell of cells) {
expect(cell).toHaveClass(`${cellClassname} my-cell`, { exact: true });
});
}
});

test('summaryCellClass returns a string', () => {
Expand Down Expand Up @@ -65,7 +65,7 @@ test('summaryCellClass returns undefined', () => {
];
setup({ columns, topSummaryRows, bottomSummaryRows, rows: [] });
const cells = getCells();
cells.forEach((cell) => {
for (const cell of cells) {
expect(cell).toHaveClass(cellClassname, { exact: true });
});
}
});
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export default defineConfig({
test: {
root: '.',
environment: 'jsdom',
pool: 'vmThreads',
globals: true,
coverage: {
provider: 'v8',
enabled: isCI,
include: ['src/**/*.{ts,tsx}', '!src/types.ts'],
reporter: ['text', 'json']
},
pool: 'vmThreads',
poolOptions: {
vmThreads: {
useAtomics: true
Expand Down
1 change: 1 addition & 0 deletions website/demos/CommonFeatures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ export default function CommonFeatures({ direction }: Props) {
const [sortColumns, setSortColumns] = useState<readonly SortColumn[]>([]);
const [selectedRows, setSelectedRows] = useState((): ReadonlySet<number> => new Set());

// biome-ignore lint/correctness/useExhaustiveDependencies: countries won't change
const countries = useMemo((): readonly string[] => {
return [...new Set(rows.map((r) => r.country))].sort(new Intl.Collator().compare);
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down

0 comments on commit c2e0f19

Please sign in to comment.