mirror of
https://github.com/apache/superset.git
synced 2026-04-14 05:34:38 +00:00
chore(lint): upgrade array creation, effect, and TypeScript rules (#37885)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,16 +49,16 @@ export function generatePageItems(
|
||||
throw new Error(`Must allow odd number of page items`);
|
||||
}
|
||||
if (total < width) {
|
||||
return [...new Array(total).keys()];
|
||||
return Array.from({ length: total }, (_, i) => i);
|
||||
}
|
||||
const left = Math.max(
|
||||
0,
|
||||
Math.min(total - width, current - Math.floor(width / 2)),
|
||||
);
|
||||
const items: (string | number)[] = new Array(width);
|
||||
for (let i = 0; i < width; i += 1) {
|
||||
items[i] = i + left;
|
||||
}
|
||||
const items: (string | number)[] = Array.from(
|
||||
{ length: width },
|
||||
(_, i) => i + left,
|
||||
);
|
||||
// replace non-ending items with placeholders
|
||||
if (typeof items[0] === 'number' && items[0] > 0) {
|
||||
items[0] = 0;
|
||||
|
||||
Reference in New Issue
Block a user