mirror of
https://github.com/outline/outline.git
synced 2026-08-03 13:27:25 +03:00
chore: Address 11 lint warnings (#13092)
This commit is contained in:
@@ -213,7 +213,7 @@ function DocumentBreadcrumb(
|
||||
...(collectionLabel ? [collectionLabel] : []),
|
||||
...(omitted.length
|
||||
? [
|
||||
<Tooltip content={omitted.join(" / ")}>
|
||||
<Tooltip key="ellipsis" content={omitted.join(" / ")}>
|
||||
<Ellipsis>…</Ellipsis>
|
||||
</Tooltip>,
|
||||
]
|
||||
|
||||
@@ -311,9 +311,9 @@ function Placeholder({
|
||||
return (
|
||||
<DelayedMount>
|
||||
<TBody $height={150}>
|
||||
{new Array(rows).fill(1).map((_r, row) => (
|
||||
{Array.from({ length: rows }).map((_r, row) => (
|
||||
<TR key={row} $columns={gridColumns}>
|
||||
{new Array(columns).fill(1).map((_c, col) => (
|
||||
{Array.from({ length: columns }).map((_c, col) => (
|
||||
<TD key={col}>
|
||||
<PlaceholderText minWidth={25} maxWidth={75} />
|
||||
</TD>
|
||||
|
||||
@@ -163,15 +163,13 @@ export default function tableColMenuItems(ctx: SelectionContext): MenuItem[] {
|
||||
<PaletteIcon />
|
||||
),
|
||||
children: [
|
||||
...[
|
||||
{
|
||||
name: "toggleColumnBackgroundAndCollapseSelection",
|
||||
label: t("None"),
|
||||
icon: <DottedCircleIcon color="transparent" />,
|
||||
active: () => (hasBackground ? false : true),
|
||||
attrs: { color: null },
|
||||
},
|
||||
],
|
||||
{
|
||||
name: "toggleColumnBackgroundAndCollapseSelection",
|
||||
label: t("None"),
|
||||
icon: <DottedCircleIcon color="transparent" />,
|
||||
active: () => (hasBackground ? false : true),
|
||||
attrs: { color: null },
|
||||
},
|
||||
...TableCell.presetColors.map((preset) => ({
|
||||
name: "toggleColumnBackgroundAndCollapseSelection",
|
||||
label: preset.name,
|
||||
|
||||
@@ -150,15 +150,13 @@ export default function tableRowMenuItems(ctx: SelectionContext): MenuItem[] {
|
||||
<PaletteIcon />
|
||||
),
|
||||
children: [
|
||||
...[
|
||||
{
|
||||
name: "toggleRowBackgroundAndCollapseSelection",
|
||||
label: t("None"),
|
||||
icon: <DottedCircleIcon color="transparent" />,
|
||||
active: () => (hasBackground ? false : true),
|
||||
attrs: { color: null },
|
||||
},
|
||||
],
|
||||
{
|
||||
name: "toggleRowBackgroundAndCollapseSelection",
|
||||
label: t("None"),
|
||||
icon: <DottedCircleIcon color="transparent" />,
|
||||
active: () => (hasBackground ? false : true),
|
||||
attrs: { color: null },
|
||||
},
|
||||
...TableCell.presetColors.map((preset) => ({
|
||||
name: "toggleRowBackgroundAndCollapseSelection",
|
||||
label: preset.name,
|
||||
|
||||
@@ -143,11 +143,9 @@ function PresentationMode({ title, icon, iconColor, data, onClose }: Props) {
|
||||
const slides = React.useMemo(() => {
|
||||
const result = splitIntoSlides(strippedData, title, icon, iconColor);
|
||||
const contentSlides = result.filter((s) => s.type === "content");
|
||||
const hasContent =
|
||||
contentSlides.length > 0 &&
|
||||
contentSlides.some(
|
||||
(s) => s.type === "content" && !isContentEmpty(s.content)
|
||||
);
|
||||
const hasContent = contentSlides.some(
|
||||
(s) => s.type === "content" && !isContentEmpty(s.content)
|
||||
);
|
||||
|
||||
if (!hasContent) {
|
||||
return [result[0], { type: "instructions" as const }];
|
||||
|
||||
@@ -24,7 +24,7 @@ export default class Queue {
|
||||
return;
|
||||
}
|
||||
|
||||
this.handler(job, this.done);
|
||||
this.handler(job, () => this.done());
|
||||
}
|
||||
|
||||
process(handler: (job: unknown, done: () => void) => void) {
|
||||
|
||||
@@ -122,7 +122,7 @@ router.post(
|
||||
where = {
|
||||
...where,
|
||||
id: {
|
||||
...((where.id as object) ?? {}),
|
||||
...(where.id as object),
|
||||
[source === "manual" ? Op.notIn : Op.in]: sourceGroupIds,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -499,7 +499,7 @@ describe("#users.invite", () => {
|
||||
const user = await buildUser();
|
||||
const res = await server.post("/api/users.invite", user, {
|
||||
body: {
|
||||
invites: new Array(21).fill({
|
||||
invites: Array.from({ length: 21 }).fill({
|
||||
email: "test@example.com",
|
||||
name: "Test",
|
||||
role: "viewer",
|
||||
|
||||
@@ -84,7 +84,7 @@ export class AnchorPlugin extends Plugin {
|
||||
const anchors = ProsemirrorHelper.getAnchors(state.doc);
|
||||
return DecorationSet.create(
|
||||
state.doc,
|
||||
anchors.map(this.createAnchorDecoration)
|
||||
anchors.map((anchor) => this.createAnchorDecoration(anchor))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,8 +114,7 @@ function getDecorations({
|
||||
(block.node.textContent.match(/\n/g) || []).length + 1;
|
||||
const gutterWidth = String(lineCount).length;
|
||||
|
||||
const lineCountText = new Array(lineCount)
|
||||
.fill(0)
|
||||
const lineCountText = Array.from({ length: lineCount })
|
||||
.map((_, i) => padStart(`${i + 1}`, gutterWidth, " "))
|
||||
.join("\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user