mirror of
https://github.com/outline/outline.git
synced 2025-12-19 09:39:39 -06:00
chore: Make no-unused-vars rule strict (#9950)
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
"import/no-named-as-default": "off",
|
||||
"import/no-named-as-default-member": "off",
|
||||
"no-unused-vars": [
|
||||
"warn",
|
||||
"error",
|
||||
{
|
||||
"argsIgnorePattern": "^_",
|
||||
"caughtErrorsIgnorePattern": "^_",
|
||||
|
||||
@@ -15,7 +15,7 @@ import scrollIntoView from "scroll-into-view-if-needed";
|
||||
import styled, { useTheme } from "styled-components";
|
||||
import breakpoint from "styled-components-breakpoint";
|
||||
import Icon from "@shared/components/Icon";
|
||||
import { NavigationNode, NavigationNodeType } from "@shared/types";
|
||||
import { NavigationNode } from "@shared/types";
|
||||
import { isModKey } from "@shared/utils/keyboard";
|
||||
import DocumentExplorerNode from "~/components/DocumentExplorerNode";
|
||||
import DocumentExplorerSearchResult from "~/components/DocumentExplorerSearchResult";
|
||||
|
||||
@@ -25,7 +25,7 @@ import HistoryNavigation from "./components/HistoryNavigation";
|
||||
import Section from "./components/Section";
|
||||
import SharedWithMe from "./components/SharedWithMe";
|
||||
import SidebarAction from "./components/SidebarAction";
|
||||
import SidebarButton, { SidebarButtonProps } from "./components/SidebarButton";
|
||||
import SidebarButton from "./components/SidebarButton";
|
||||
import SidebarLink from "./components/SidebarLink";
|
||||
import Starred from "./components/Starred";
|
||||
import ToggleButton from "./components/ToggleButton";
|
||||
|
||||
@@ -44,7 +44,7 @@ export const useLocaleTime = ({
|
||||
"MMMM do, yyyy h:mm a";
|
||||
// @ts-expect-error fallback to formatLocaleLong
|
||||
const formatLocale = format?.[userLocale] ?? formatLocaleLong;
|
||||
const [_, setMinutesMounted] = useState(0);
|
||||
const [, setMinutesMounted] = useState(0);
|
||||
const callback = useRef<() => void>();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { observer } from "mobx-react";
|
||||
import { MoreIcon, PlusIcon } from "outline-icons";
|
||||
import { PlusIcon } from "outline-icons";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
import Collection from "~/models/Collection";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { observer, useObserver } from "mobx-react";
|
||||
import { CommentIcon } from "outline-icons";
|
||||
import { useRef, Fragment } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link, useRouteMatch } from "react-router-dom";
|
||||
import { Link } from "react-router-dom";
|
||||
import styled from "styled-components";
|
||||
import { TeamPreference } from "@shared/types";
|
||||
import Document from "~/models/Document";
|
||||
@@ -29,7 +29,6 @@ type Props = {
|
||||
function TitleDocumentMeta({ to, document, revision, ...rest }: Props) {
|
||||
const { views, comments, ui } = useStores();
|
||||
const { t } = useTranslation();
|
||||
const match = useRouteMatch();
|
||||
const sidebarContext = useLocationSidebarContext();
|
||||
const team = useCurrentTeam();
|
||||
const documentViews = useObserver(() => views.inDocument(document.id));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { observer } from "mobx-react";
|
||||
import { TableOfContentsIcon, EditIcon, MoreIcon } from "outline-icons";
|
||||
import { TableOfContentsIcon, EditIcon } from "outline-icons";
|
||||
import { useState, useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import compact from "lodash/compact";
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { unicodeCLDRtoBCP47 } from "@shared/utils/date";
|
||||
import Share from "~/models/Share";
|
||||
import { Avatar, AvatarSize } from "~/components/Avatar";
|
||||
import Badge from "~/components/Badge";
|
||||
|
||||
@@ -8,8 +8,6 @@ import { observable, action, computed, runInAction } from "mobx";
|
||||
import {
|
||||
SubscriptionType,
|
||||
type DateFilter,
|
||||
type NavigationNode,
|
||||
type PublicTeam,
|
||||
type StatusFilter,
|
||||
} from "@shared/types";
|
||||
import { subtractDate } from "@shared/utils/date";
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { i18n } from "i18next";
|
||||
import { locales, unicodeCLDRtoBCP47 } from "@shared/utils/date";
|
||||
import Desktop from "./Desktop";
|
||||
import User from "~/models/User";
|
||||
import useUserLocale from "~/hooks/useUserLocale";
|
||||
|
||||
/**
|
||||
* Formats a number using the user's locale where possible. Use `useFormatNumber` hook
|
||||
|
||||
@@ -61,7 +61,6 @@ import {
|
||||
presentDocument,
|
||||
presentPolicies,
|
||||
presentMembership,
|
||||
presentPublicTeam,
|
||||
presentUser,
|
||||
presentGroupMembership,
|
||||
presentGroup,
|
||||
@@ -75,7 +74,6 @@ import { APIContext } from "@server/types";
|
||||
import { RateLimiterStrategy } from "@server/utils/RateLimiter";
|
||||
import ZipHelper from "@server/utils/ZipHelper";
|
||||
import { getTeamFromContext } from "@server/utils/passport";
|
||||
import { navigationNodeToSitemap } from "@server/utils/sitemap";
|
||||
import { assertPresent } from "@server/validation";
|
||||
import pagination from "../middlewares/pagination";
|
||||
import * as T from "./schema";
|
||||
|
||||
@@ -2,7 +2,7 @@ import Router from "koa-router";
|
||||
import auth from "@server/middlewares/authentication";
|
||||
import validate from "@server/middlewares/validate";
|
||||
import { Document, Relationship } from "@server/models";
|
||||
import { authorize, can } from "@server/policies";
|
||||
import { authorize } from "@server/policies";
|
||||
import {
|
||||
presentRelationship,
|
||||
presentDocument,
|
||||
|
||||
Reference in New Issue
Block a user