Skip to content

Commit

Permalink
Merge branch 'main' into bun
Browse files Browse the repository at this point in the history
  • Loading branch information
nstepien authored Jan 15, 2024
2 parents b837f19 + e396ea8 commit f3060fe
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 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"
}
}
}
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@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",
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 });
});
}
});
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 f3060fe

Please sign in to comment.