diff --git a/.eslintrc b/.eslintrc
index 4357f69461..e02b839b6d 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -21,7 +21,7 @@
"eslint-plugin-import",
"eslint-plugin-node",
"eslint-plugin-react",
- "import"
+ "eslint-plugin-lodash"
],
"rules": {
"eqeqeq": 2,
@@ -55,6 +55,7 @@
],
"padding-line-between-statements": ["error", { "blankLine": "always", "prev": "*", "next": "export" }],
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
+ "lodash/import-scope": ["warn", "method"],
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"import/newline-after-import": 2,
diff --git a/app/actions/index.ts b/app/actions/index.ts
index 82064dd1d6..e0762a5b99 100644
--- a/app/actions/index.ts
+++ b/app/actions/index.ts
@@ -1,4 +1,4 @@
-import { flattenDeep } from "lodash";
+import flattenDeep from "lodash/flattenDeep";
import * as React from "react";
import { Optional } from "utility-types";
import { v4 as uuidv4 } from "uuid";
diff --git a/app/components/Analytics.tsx b/app/components/Analytics.tsx
index b1da7e3c0c..4d6f56cb6d 100644
--- a/app/components/Analytics.tsx
+++ b/app/components/Analytics.tsx
@@ -1,6 +1,6 @@
/* eslint-disable prefer-rest-params */
/* global ga */
-import { escape } from "lodash";
+import escape from "lodash/escape";
import * as React from "react";
import { IntegrationService } from "@shared/types";
import env from "~/env";
diff --git a/app/components/Collaborators.tsx b/app/components/Collaborators.tsx
index 7075ce1aee..b49aabd67d 100644
--- a/app/components/Collaborators.tsx
+++ b/app/components/Collaborators.tsx
@@ -1,4 +1,7 @@
-import { sortBy, filter, uniq, isEqual } from "lodash";
+import filter from "lodash/filter";
+import isEqual from "lodash/isEqual";
+import sortBy from "lodash/sortBy";
+import uniq from "lodash/uniq";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
diff --git a/app/components/DocumentExplorer.tsx b/app/components/DocumentExplorer.tsx
index 54a4377e98..06069dfd86 100644
--- a/app/components/DocumentExplorer.tsx
+++ b/app/components/DocumentExplorer.tsx
@@ -1,5 +1,10 @@
import FuzzySearch from "fuzzy-search";
-import { includes, difference, concat, filter, map, fill } from "lodash";
+import concat from "lodash/concat";
+import difference from "lodash/difference";
+import fill from "lodash/fill";
+import filter from "lodash/filter";
+import includes from "lodash/includes";
+import map from "lodash/map";
import { observer } from "mobx-react";
import { StarredIcon, DocumentIcon } from "outline-icons";
import * as React from "react";
diff --git a/app/components/DocumentViews.tsx b/app/components/DocumentViews.tsx
index 20d3068151..15377291c5 100644
--- a/app/components/DocumentViews.tsx
+++ b/app/components/DocumentViews.tsx
@@ -1,4 +1,4 @@
-import { sortBy } from "lodash";
+import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
diff --git a/app/components/Editor.tsx b/app/components/Editor.tsx
index 1445d6de0f..d537450214 100644
--- a/app/components/Editor.tsx
+++ b/app/components/Editor.tsx
@@ -1,4 +1,6 @@
-import { deburr, difference, sortBy } from "lodash";
+import deburr from "lodash/deburr";
+import difference from "lodash/difference";
+import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import { DOMParser as ProsemirrorDOMParser } from "prosemirror-model";
import { TextSelection } from "prosemirror-state";
diff --git a/app/components/Header.tsx b/app/components/Header.tsx
index 330f0000ae..0ffc82cc79 100644
--- a/app/components/Header.tsx
+++ b/app/components/Header.tsx
@@ -1,4 +1,4 @@
-import { throttle } from "lodash";
+import throttle from "lodash/throttle";
import { observer } from "mobx-react";
import { MenuIcon } from "outline-icons";
import { transparentize } from "polished";
diff --git a/app/components/Highlight.tsx b/app/components/Highlight.tsx
index f65ff125a5..f57e7135f5 100644
--- a/app/components/Highlight.tsx
+++ b/app/components/Highlight.tsx
@@ -1,4 +1,4 @@
-import { escapeRegExp } from "lodash";
+import escapeRegExp from "lodash/escapeRegExp";
import * as React from "react";
import replace from "string-replace-to-array";
import styled from "styled-components";
diff --git a/app/components/LanguagePrompt.tsx b/app/components/LanguagePrompt.tsx
index f062d3a647..73425f4ed5 100644
--- a/app/components/LanguagePrompt.tsx
+++ b/app/components/LanguagePrompt.tsx
@@ -1,4 +1,4 @@
-import { find } from "lodash";
+import find from "lodash/find";
import * as React from "react";
import { Trans, useTranslation } from "react-i18next";
import styled from "styled-components";
diff --git a/app/components/List/Placeholder.tsx b/app/components/List/Placeholder.tsx
index 9f7fe76af3..780dc50431 100644
--- a/app/components/List/Placeholder.tsx
+++ b/app/components/List/Placeholder.tsx
@@ -1,4 +1,4 @@
-import { times } from "lodash";
+import times from "lodash/times";
import * as React from "react";
import styled from "styled-components";
import Fade from "~/components/Fade";
diff --git a/app/components/PaginatedList.tsx b/app/components/PaginatedList.tsx
index ac2bb9d7a0..4e30ec5303 100644
--- a/app/components/PaginatedList.tsx
+++ b/app/components/PaginatedList.tsx
@@ -1,4 +1,4 @@
-import { isEqual } from "lodash";
+import isEqual from "lodash/isEqual";
import { observable, action } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";
diff --git a/app/components/SearchPopover.tsx b/app/components/SearchPopover.tsx
index c02b42f6c1..ad696a9a0c 100644
--- a/app/components/SearchPopover.tsx
+++ b/app/components/SearchPopover.tsx
@@ -1,4 +1,4 @@
-import { debounce } from "lodash";
+import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
diff --git a/app/components/Sidebar/Settings.tsx b/app/components/Sidebar/Settings.tsx
index 71c33d9d76..573340fecb 100644
--- a/app/components/Sidebar/Settings.tsx
+++ b/app/components/Sidebar/Settings.tsx
@@ -1,4 +1,4 @@
-import { groupBy } from "lodash";
+import groupBy from "lodash/groupBy";
import { observer } from "mobx-react";
import { BackIcon } from "outline-icons";
import * as React from "react";
diff --git a/app/components/Table.tsx b/app/components/Table.tsx
index c7f6f1f308..66b00b7775 100644
--- a/app/components/Table.tsx
+++ b/app/components/Table.tsx
@@ -1,4 +1,4 @@
-import { isEqual } from "lodash";
+import isEqual from "lodash/isEqual";
import { observer } from "mobx-react";
import { CollapsedIcon } from "outline-icons";
import * as React from "react";
diff --git a/app/components/WebsocketProvider.tsx b/app/components/WebsocketProvider.tsx
index cac3201653..6c19b0629e 100644
--- a/app/components/WebsocketProvider.tsx
+++ b/app/components/WebsocketProvider.tsx
@@ -1,5 +1,5 @@
import invariant from "invariant";
-import { find } from "lodash";
+import find from "lodash/find";
import { action, observable } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";
diff --git a/app/editor/components/SelectionToolbar.tsx b/app/editor/components/SelectionToolbar.tsx
index 2ade810d01..90c77a182b 100644
--- a/app/editor/components/SelectionToolbar.tsx
+++ b/app/editor/components/SelectionToolbar.tsx
@@ -1,4 +1,4 @@
-import { some } from "lodash";
+import some from "lodash/some";
import { EditorState, NodeSelection, TextSelection } from "prosemirror-state";
import * as React from "react";
import createAndInsertLink from "@shared/editor/commands/createAndInsertLink";
diff --git a/app/editor/components/SuggestionsMenu.tsx b/app/editor/components/SuggestionsMenu.tsx
index 4e4b4dcffd..86f756bdb1 100644
--- a/app/editor/components/SuggestionsMenu.tsx
+++ b/app/editor/components/SuggestionsMenu.tsx
@@ -1,5 +1,5 @@
import commandScore from "command-score";
-import { capitalize } from "lodash";
+import capitalize from "lodash/capitalize";
import * as React from "react";
import { Trans } from "react-i18next";
import { VisuallyHidden } from "reakit/VisuallyHidden";
diff --git a/app/hooks/useCommandBarActions.ts b/app/hooks/useCommandBarActions.ts
index 9722f73a6c..48dcd11ef6 100644
--- a/app/hooks/useCommandBarActions.ts
+++ b/app/hooks/useCommandBarActions.ts
@@ -1,5 +1,5 @@
import { useRegisterActions } from "kbar";
-import { flattenDeep } from "lodash";
+import flattenDeep from "lodash/flattenDeep";
import { useLocation } from "react-router-dom";
import { actionToKBar } from "~/actions";
import { Action } from "~/types";
diff --git a/app/hooks/useEmbeds.ts b/app/hooks/useEmbeds.ts
index 5c55668eb2..5526b93696 100644
--- a/app/hooks/useEmbeds.ts
+++ b/app/hooks/useEmbeds.ts
@@ -1,4 +1,4 @@
-import { find } from "lodash";
+import find from "lodash/find";
import * as React from "react";
import embeds, { EmbedDescriptor } from "@shared/editor/embeds";
import { IntegrationType } from "@shared/types";
diff --git a/app/hooks/useIdle.ts b/app/hooks/useIdle.ts
index 90847c98fc..a1452962f0 100644
--- a/app/hooks/useIdle.ts
+++ b/app/hooks/useIdle.ts
@@ -1,4 +1,4 @@
-import { throttle } from "lodash";
+import throttle from "lodash/throttle";
import * as React from "react";
import { Minute } from "@shared/utils/time";
diff --git a/app/hooks/useMenuContext.tsx b/app/hooks/useMenuContext.tsx
index cb7cb1b974..eb408f7a5d 100644
--- a/app/hooks/useMenuContext.tsx
+++ b/app/hooks/useMenuContext.tsx
@@ -1,4 +1,4 @@
-import { noop } from "lodash";
+import noop from "lodash/noop";
import React from "react";
type MenuContextType = {
diff --git a/app/hooks/useMousePosition.ts b/app/hooks/useMousePosition.ts
index 55041bc6d1..46effdfc7f 100644
--- a/app/hooks/useMousePosition.ts
+++ b/app/hooks/useMousePosition.ts
@@ -1,4 +1,4 @@
-import { throttle } from "lodash";
+import throttle from "lodash/throttle";
import * as React from "react";
import useEventListener from "./useEventListener";
import useIsMounted from "./useIsMounted";
diff --git a/app/hooks/useWindowScrollPosition.ts b/app/hooks/useWindowScrollPosition.ts
index d48ef11495..e006413096 100644
--- a/app/hooks/useWindowScrollPosition.ts
+++ b/app/hooks/useWindowScrollPosition.ts
@@ -1,6 +1,6 @@
// Based on https://github.com/rehooks/window-scroll-position which is no longer
// maintained.
-import { throttle } from "lodash";
+import throttle from "lodash/throttle";
import { useState, useEffect } from "react";
import { supportsPassiveListener } from "~/utils/browser";
diff --git a/app/models/BaseModel.ts b/app/models/BaseModel.ts
index 265644c8db..5c1c70e909 100644
--- a/app/models/BaseModel.ts
+++ b/app/models/BaseModel.ts
@@ -1,4 +1,4 @@
-import { pick } from "lodash";
+import pick from "lodash/pick";
import { set, observable } from "mobx";
import Logger from "~/utils/Logger";
import { getFieldsForModel } from "./decorators/Field";
diff --git a/app/models/Collection.ts b/app/models/Collection.ts
index dc4350d353..b7c43099d9 100644
--- a/app/models/Collection.ts
+++ b/app/models/Collection.ts
@@ -1,4 +1,4 @@
-import { trim } from "lodash";
+import trim from "lodash/trim";
import { action, computed, observable, reaction, runInAction } from "mobx";
import {
CollectionPermission,
diff --git a/app/models/Document.ts b/app/models/Document.ts
index a501700fcf..56a1b09ccb 100644
--- a/app/models/Document.ts
+++ b/app/models/Document.ts
@@ -1,5 +1,5 @@
import { addDays, differenceInDays } from "date-fns";
-import { floor } from "lodash";
+import floor from "lodash/floor";
import { action, autorun, computed, observable, set } from "mobx";
import { ExportContentType } from "@shared/types";
import type { NavigationNode } from "@shared/types";
diff --git a/app/scenes/Collection/MembershipPreview.tsx b/app/scenes/Collection/MembershipPreview.tsx
index 8276ddaed1..881487df8c 100644
--- a/app/scenes/Collection/MembershipPreview.tsx
+++ b/app/scenes/Collection/MembershipPreview.tsx
@@ -1,4 +1,4 @@
-import { sortBy } from "lodash";
+import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
diff --git a/app/scenes/CollectionNew.tsx b/app/scenes/CollectionNew.tsx
index c78ff588ad..bdbc8181e8 100644
--- a/app/scenes/CollectionNew.tsx
+++ b/app/scenes/CollectionNew.tsx
@@ -1,4 +1,4 @@
-import { intersection } from "lodash";
+import intersection from "lodash/intersection";
import { observable } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";
diff --git a/app/scenes/CollectionPermissions/AddGroupsToCollection.tsx b/app/scenes/CollectionPermissions/AddGroupsToCollection.tsx
index f9a875f16a..d78947d416 100644
--- a/app/scenes/CollectionPermissions/AddGroupsToCollection.tsx
+++ b/app/scenes/CollectionPermissions/AddGroupsToCollection.tsx
@@ -1,4 +1,4 @@
-import { debounce } from "lodash";
+import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
diff --git a/app/scenes/Document/components/CommentThread.tsx b/app/scenes/Document/components/CommentThread.tsx
index d34aa40435..ab00a50ebb 100644
--- a/app/scenes/Document/components/CommentThread.tsx
+++ b/app/scenes/Document/components/CommentThread.tsx
@@ -1,4 +1,4 @@
-import { throttle } from "lodash";
+import throttle from "lodash/throttle";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
diff --git a/app/scenes/Document/components/Document.tsx b/app/scenes/Document/components/Document.tsx
index a826b40779..ee0e7f10dd 100644
--- a/app/scenes/Document/components/Document.tsx
+++ b/app/scenes/Document/components/Document.tsx
@@ -1,4 +1,4 @@
-import { debounce } from "lodash";
+import debounce from "lodash/debounce";
import { action, observable } from "mobx";
import { observer } from "mobx-react";
import { AllSelection } from "prosemirror-state";
diff --git a/app/scenes/Document/components/MultiplayerEditor.tsx b/app/scenes/Document/components/MultiplayerEditor.tsx
index 83341155f9..8660ccff9d 100644
--- a/app/scenes/Document/components/MultiplayerEditor.tsx
+++ b/app/scenes/Document/components/MultiplayerEditor.tsx
@@ -1,5 +1,5 @@
import { HocuspocusProvider, WebSocketStatus } from "@hocuspocus/provider";
-import { throttle } from "lodash";
+import throttle from "lodash/throttle";
import * as React from "react";
import { useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom";
diff --git a/app/scenes/Document/components/SharePopover.tsx b/app/scenes/Document/components/SharePopover.tsx
index a20775f364..a4ca2fd80c 100644
--- a/app/scenes/Document/components/SharePopover.tsx
+++ b/app/scenes/Document/components/SharePopover.tsx
@@ -1,5 +1,6 @@
import invariant from "invariant";
-import { debounce, isEmpty } from "lodash";
+import debounce from "lodash/debounce";
+import isEmpty from "lodash/isEmpty";
import { observer } from "mobx-react";
import { ExpandedIcon, GlobeIcon, PadlockIcon } from "outline-icons";
import * as React from "react";
diff --git a/app/scenes/DocumentMove.tsx b/app/scenes/DocumentMove.tsx
index 85f38c0077..abd05775a0 100644
--- a/app/scenes/DocumentMove.tsx
+++ b/app/scenes/DocumentMove.tsx
@@ -1,4 +1,4 @@
-import { flatten } from "lodash";
+import flatten from "lodash/flatten";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation, Trans } from "react-i18next";
diff --git a/app/scenes/DocumentPublish.tsx b/app/scenes/DocumentPublish.tsx
index 90e19ff63e..36a2083d49 100644
--- a/app/scenes/DocumentPublish.tsx
+++ b/app/scenes/DocumentPublish.tsx
@@ -1,4 +1,4 @@
-import { flatten } from "lodash";
+import flatten from "lodash/flatten";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation, Trans } from "react-i18next";
diff --git a/app/scenes/GroupMembers/AddPeopleToGroup.tsx b/app/scenes/GroupMembers/AddPeopleToGroup.tsx
index b6a3e15829..1b673678a4 100644
--- a/app/scenes/GroupMembers/AddPeopleToGroup.tsx
+++ b/app/scenes/GroupMembers/AddPeopleToGroup.tsx
@@ -1,4 +1,4 @@
-import { debounce } from "lodash";
+import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
diff --git a/app/scenes/Login/index.tsx b/app/scenes/Login/index.tsx
index e62cb6dfa9..ca9500614e 100644
--- a/app/scenes/Login/index.tsx
+++ b/app/scenes/Login/index.tsx
@@ -1,4 +1,4 @@
-import { find } from "lodash";
+import find from "lodash/find";
import { observer } from "mobx-react";
import { BackIcon, EmailIcon } from "outline-icons";
import * as React from "react";
diff --git a/app/scenes/Search/Search.tsx b/app/scenes/Search/Search.tsx
index 304e96175b..74965370e8 100644
--- a/app/scenes/Search/Search.tsx
+++ b/app/scenes/Search/Search.tsx
@@ -1,4 +1,4 @@
-import { isEqual } from "lodash";
+import isEqual from "lodash/isEqual";
import { observable, action } from "mobx";
import { observer } from "mobx-react";
import queryString from "query-string";
diff --git a/app/scenes/Settings/Details.tsx b/app/scenes/Settings/Details.tsx
index 7ffa010d65..1caa6620ad 100644
--- a/app/scenes/Settings/Details.tsx
+++ b/app/scenes/Settings/Details.tsx
@@ -1,5 +1,5 @@
import { isHexColor } from "class-validator";
-import { pickBy } from "lodash";
+import pickBy from "lodash/pickBy";
import { observer } from "mobx-react";
import { TeamIcon } from "outline-icons";
import { useRef, useState } from "react";
diff --git a/app/scenes/Settings/GoogleAnalytics.tsx b/app/scenes/Settings/GoogleAnalytics.tsx
index b1fc641224..22e6a3c318 100644
--- a/app/scenes/Settings/GoogleAnalytics.tsx
+++ b/app/scenes/Settings/GoogleAnalytics.tsx
@@ -1,4 +1,4 @@
-import { find } from "lodash";
+import find from "lodash/find";
import { observer } from "mobx-react";
import * as React from "react";
import { useForm } from "react-hook-form";
diff --git a/app/scenes/Settings/Members.tsx b/app/scenes/Settings/Members.tsx
index 5697601c7f..da970d8be1 100644
--- a/app/scenes/Settings/Members.tsx
+++ b/app/scenes/Settings/Members.tsx
@@ -1,4 +1,4 @@
-import { sortBy } from "lodash";
+import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import { PlusIcon, UserIcon } from "outline-icons";
import * as React from "react";
diff --git a/app/scenes/Settings/Notifications.tsx b/app/scenes/Settings/Notifications.tsx
index 91e1378984..76287e63de 100644
--- a/app/scenes/Settings/Notifications.tsx
+++ b/app/scenes/Settings/Notifications.tsx
@@ -1,4 +1,4 @@
-import { debounce } from "lodash";
+import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import {
AcademicCapIcon,
diff --git a/app/scenes/Settings/Security.tsx b/app/scenes/Settings/Security.tsx
index d8b242f567..78e0acc9fd 100644
--- a/app/scenes/Settings/Security.tsx
+++ b/app/scenes/Settings/Security.tsx
@@ -1,4 +1,4 @@
-import { debounce } from "lodash";
+import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import { CheckboxIcon, EmailIcon, PadlockIcon } from "outline-icons";
import { useState } from "react";
diff --git a/app/scenes/Settings/SelfHosted.tsx b/app/scenes/Settings/SelfHosted.tsx
index 41fd079262..45c8cb38f7 100644
--- a/app/scenes/Settings/SelfHosted.tsx
+++ b/app/scenes/Settings/SelfHosted.tsx
@@ -1,4 +1,4 @@
-import { find } from "lodash";
+import find from "lodash/find";
import { observer } from "mobx-react";
import { BuildingBlocksIcon } from "outline-icons";
import * as React from "react";
diff --git a/app/scenes/Settings/Shares.tsx b/app/scenes/Settings/Shares.tsx
index df29e09d01..63396ce110 100644
--- a/app/scenes/Settings/Shares.tsx
+++ b/app/scenes/Settings/Shares.tsx
@@ -1,4 +1,4 @@
-import { sortBy } from "lodash";
+import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import { LinkIcon, WarningIcon } from "outline-icons";
import * as React from "react";
diff --git a/app/scenes/Settings/components/UserStatusFilter.tsx b/app/scenes/Settings/components/UserStatusFilter.tsx
index 6aa89f5af0..53717073e4 100644
--- a/app/scenes/Settings/components/UserStatusFilter.tsx
+++ b/app/scenes/Settings/components/UserStatusFilter.tsx
@@ -1,4 +1,4 @@
-import { compact } from "lodash";
+import compact from "lodash/compact";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
diff --git a/app/stores/BaseStore.ts b/app/stores/BaseStore.ts
index 70fd6ec5db..96c96f5a27 100644
--- a/app/stores/BaseStore.ts
+++ b/app/stores/BaseStore.ts
@@ -1,5 +1,6 @@
import invariant from "invariant";
-import { lowerFirst, orderBy } from "lodash";
+import lowerFirst from "lodash/lowerFirst";
+import orderBy from "lodash/orderBy";
import { observable, action, computed, runInAction } from "mobx";
import { Class } from "utility-types";
import RootStore from "~/stores/RootStore";
diff --git a/app/stores/CollectionsStore.ts b/app/stores/CollectionsStore.ts
index 3b80d0b66a..908d633f24 100644
--- a/app/stores/CollectionsStore.ts
+++ b/app/stores/CollectionsStore.ts
@@ -1,5 +1,8 @@
import invariant from "invariant";
-import { concat, find, last, sortBy } from "lodash";
+import concat from "lodash/concat";
+import find from "lodash/find";
+import last from "lodash/last";
+import sortBy from "lodash/sortBy";
import { computed, action } from "mobx";
import {
CollectionPermission,
diff --git a/app/stores/CommentsStore.ts b/app/stores/CommentsStore.ts
index 275ecb78a8..fd88d508b6 100644
--- a/app/stores/CommentsStore.ts
+++ b/app/stores/CommentsStore.ts
@@ -1,5 +1,6 @@
import invariant from "invariant";
-import { filter, orderBy } from "lodash";
+import filter from "lodash/filter";
+import orderBy from "lodash/orderBy";
import { action, runInAction, computed } from "mobx";
import Comment from "~/models/Comment";
import Document from "~/models/Document";
diff --git a/app/stores/DocumentsStore.ts b/app/stores/DocumentsStore.ts
index e630bbf39e..fed26338d8 100644
--- a/app/stores/DocumentsStore.ts
+++ b/app/stores/DocumentsStore.ts
@@ -1,5 +1,9 @@
import invariant from "invariant";
-import { find, orderBy, filter, compact, omitBy } from "lodash";
+import compact from "lodash/compact";
+import filter from "lodash/filter";
+import find from "lodash/find";
+import omitBy from "lodash/omitBy";
+import orderBy from "lodash/orderBy";
import { observable, action, computed, runInAction } from "mobx";
import { DateFilter, NavigationNode, PublicTeam } from "@shared/types";
import { subtractDate } from "@shared/utils/date";
diff --git a/app/stores/EventsStore.ts b/app/stores/EventsStore.ts
index d8c17c89d6..5c9f1c3565 100644
--- a/app/stores/EventsStore.ts
+++ b/app/stores/EventsStore.ts
@@ -1,4 +1,5 @@
-import { sortBy, filter } from "lodash";
+import filter from "lodash/filter";
+import sortBy from "lodash/sortBy";
import { computed } from "mobx";
import Event from "~/models/Event";
import BaseStore, { RPCAction } from "./BaseStore";
diff --git a/app/stores/FileOperationsStore.ts b/app/stores/FileOperationsStore.ts
index 18133a9221..d4ec7feb3c 100644
--- a/app/stores/FileOperationsStore.ts
+++ b/app/stores/FileOperationsStore.ts
@@ -1,4 +1,4 @@
-import { orderBy } from "lodash";
+import orderBy from "lodash/orderBy";
import { computed } from "mobx";
import { FileOperationType } from "@shared/types";
import FileOperation from "~/models/FileOperation";
diff --git a/app/stores/GroupMembershipsStore.ts b/app/stores/GroupMembershipsStore.ts
index 8681ac907a..992e3163ae 100644
--- a/app/stores/GroupMembershipsStore.ts
+++ b/app/stores/GroupMembershipsStore.ts
@@ -1,5 +1,5 @@
import invariant from "invariant";
-import { filter } from "lodash";
+import filter from "lodash/filter";
import { action, runInAction } from "mobx";
import GroupMembership from "~/models/GroupMembership";
import { PaginationParams } from "~/types";
diff --git a/app/stores/GroupsStore.ts b/app/stores/GroupsStore.ts
index 8da97a1ba7..8dc9e7b28c 100644
--- a/app/stores/GroupsStore.ts
+++ b/app/stores/GroupsStore.ts
@@ -1,5 +1,5 @@
import invariant from "invariant";
-import { filter } from "lodash";
+import filter from "lodash/filter";
import { action, runInAction, computed } from "mobx";
import naturalSort from "@shared/utils/naturalSort";
import Group from "~/models/Group";
diff --git a/app/stores/IntegrationsStore.ts b/app/stores/IntegrationsStore.ts
index ceb36795f1..2460bcda59 100644
--- a/app/stores/IntegrationsStore.ts
+++ b/app/stores/IntegrationsStore.ts
@@ -1,4 +1,4 @@
-import { filter } from "lodash";
+import filter from "lodash/filter";
import { computed } from "mobx";
import { IntegrationService } from "@shared/types";
import naturalSort from "@shared/utils/naturalSort";
diff --git a/app/stores/NotificationsStore.ts b/app/stores/NotificationsStore.ts
index 9eee1e542a..7470f0df09 100644
--- a/app/stores/NotificationsStore.ts
+++ b/app/stores/NotificationsStore.ts
@@ -1,5 +1,6 @@
import invariant from "invariant";
-import { orderBy, sortBy } from "lodash";
+import orderBy from "lodash/orderBy";
+import sortBy from "lodash/sortBy";
import { action, computed, runInAction } from "mobx";
import Notification from "~/models/Notification";
import { PaginationParams } from "~/types";
diff --git a/app/stores/RevisionsStore.ts b/app/stores/RevisionsStore.ts
index 53ad62af05..dcac76b663 100644
--- a/app/stores/RevisionsStore.ts
+++ b/app/stores/RevisionsStore.ts
@@ -1,5 +1,5 @@
import invariant from "invariant";
-import { filter } from "lodash";
+import filter from "lodash/filter";
import { action, runInAction } from "mobx";
import BaseStore, { RPCAction } from "~/stores/BaseStore";
import RootStore from "~/stores/RootStore";
diff --git a/app/stores/SearchesStore.ts b/app/stores/SearchesStore.ts
index 3f41b31fe2..5498db2a34 100644
--- a/app/stores/SearchesStore.ts
+++ b/app/stores/SearchesStore.ts
@@ -1,4 +1,4 @@
-import { uniqBy } from "lodash";
+import uniqBy from "lodash/uniqBy";
import { computed } from "mobx";
import SearchQuery from "~/models/SearchQuery";
import BaseStore, { RPCAction } from "./BaseStore";
diff --git a/app/stores/SharesStore.ts b/app/stores/SharesStore.ts
index c244ed2832..23ee81b8c4 100644
--- a/app/stores/SharesStore.ts
+++ b/app/stores/SharesStore.ts
@@ -1,5 +1,8 @@
import invariant from "invariant";
-import { sortBy, filter, find, isUndefined } from "lodash";
+import filter from "lodash/filter";
+import find from "lodash/find";
+import isUndefined from "lodash/isUndefined";
+import sortBy from "lodash/sortBy";
import { action, computed } from "mobx";
import Share from "~/models/Share";
import { client } from "~/utils/ApiClient";
diff --git a/app/stores/ToastsStore.ts b/app/stores/ToastsStore.ts
index 81dc347a57..ce3d16a4aa 100644
--- a/app/stores/ToastsStore.ts
+++ b/app/stores/ToastsStore.ts
@@ -1,4 +1,4 @@
-import { orderBy } from "lodash";
+import orderBy from "lodash/orderBy";
import { observable, action, computed } from "mobx";
import { v4 as uuidv4 } from "uuid";
import { Toast, ToastOptions } from "~/types";
diff --git a/app/stores/UsersStore.ts b/app/stores/UsersStore.ts
index 8d7ed923f3..727c9232b8 100644
--- a/app/stores/UsersStore.ts
+++ b/app/stores/UsersStore.ts
@@ -1,5 +1,6 @@
import invariant from "invariant";
-import { filter, orderBy } from "lodash";
+import filter from "lodash/filter";
+import orderBy from "lodash/orderBy";
import { observable, computed, action, runInAction } from "mobx";
import { Role } from "@shared/types";
import User from "~/models/User";
diff --git a/app/stores/ViewsStore.ts b/app/stores/ViewsStore.ts
index 05a2d28559..7c098db198 100644
--- a/app/stores/ViewsStore.ts
+++ b/app/stores/ViewsStore.ts
@@ -1,4 +1,7 @@
-import { reduce, filter, find, orderBy } from "lodash";
+import filter from "lodash/filter";
+import find from "lodash/find";
+import orderBy from "lodash/orderBy";
+import reduce from "lodash/reduce";
import View from "~/models/View";
import BaseStore, { RPCAction } from "./BaseStore";
import RootStore from "./RootStore";
diff --git a/app/utils/ApiClient.ts b/app/utils/ApiClient.ts
index 39a66d61f7..810869c520 100644
--- a/app/utils/ApiClient.ts
+++ b/app/utils/ApiClient.ts
@@ -1,5 +1,5 @@
import retry from "fetch-retry";
-import { trim } from "lodash";
+import trim from "lodash/trim";
import queryString from "query-string";
import EDITOR_VERSION from "@shared/editor/version";
import stores from "~/stores";
diff --git a/app/utils/date.ts b/app/utils/date.ts
index dd1a01023a..e94357146f 100644
--- a/app/utils/date.ts
+++ b/app/utils/date.ts
@@ -7,7 +7,7 @@ import {
format as formatDate,
} from "date-fns";
import { TFunction } from "i18next";
-import { startCase } from "lodash";
+import startCase from "lodash/startCase";
import {
getCurrentDateAsString,
getCurrentDateTimeAsString,
diff --git a/package.json b/package.json
index e1c3840f22..5e1ea31dab 100644
--- a/package.json
+++ b/package.json
@@ -229,7 +229,6 @@
"@babel/cli": "^7.21.5",
"@babel/preset-typescript": "^7.21.4",
"@getoutline/jest-runner-serial": "^2.0.0",
- "@optimize-lodash/rollup-plugin": "4.0.3",
"@relative-ci/agent": "^4.1.3",
"@types/addressparser": "^1.0.1",
"@types/body-scroll-lock": "^3.1.0",
@@ -308,6 +307,7 @@
"eslint-plugin-es": "^4.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.1.0",
+ "eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.20.0",
diff --git a/plugins/google/server/auth/google.ts b/plugins/google/server/auth/google.ts
index 040f188902..7bf8c2edcd 100644
--- a/plugins/google/server/auth/google.ts
+++ b/plugins/google/server/auth/google.ts
@@ -1,7 +1,7 @@
import passport from "@outlinewiki/koa-passport";
import type { Context } from "koa";
import Router from "koa-router";
-import { capitalize } from "lodash";
+import capitalize from "lodash/capitalize";
import { Profile } from "passport";
import { Strategy as GoogleStrategy } from "passport-google-oauth2";
import { slugifyDomain } from "@shared/utils/domains";
diff --git a/plugins/oidc/server/auth/oidc.ts b/plugins/oidc/server/auth/oidc.ts
index cda07f4f5b..d9167216af 100644
--- a/plugins/oidc/server/auth/oidc.ts
+++ b/plugins/oidc/server/auth/oidc.ts
@@ -1,7 +1,7 @@
import passport from "@outlinewiki/koa-passport";
import type { Context } from "koa";
import Router from "koa-router";
-import { get } from "lodash";
+import get from "lodash/get";
import { Strategy } from "passport-oauth2";
import { slugifyDomain } from "@shared/utils/domains";
import accountProvisioner from "@server/commands/accountProvisioner";
diff --git a/plugins/slack/client/Settings.tsx b/plugins/slack/client/Settings.tsx
index 11d3da8445..9476880644 100644
--- a/plugins/slack/client/Settings.tsx
+++ b/plugins/slack/client/Settings.tsx
@@ -1,4 +1,4 @@
-import { find } from "lodash";
+import find from "lodash/find";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation, Trans } from "react-i18next";
diff --git a/plugins/slack/client/components/SlackListItem.tsx b/plugins/slack/client/components/SlackListItem.tsx
index dd93c4e545..096fcc7c67 100644
--- a/plugins/slack/client/components/SlackListItem.tsx
+++ b/plugins/slack/client/components/SlackListItem.tsx
@@ -1,4 +1,4 @@
-import { uniq } from "lodash";
+import uniq from "lodash/uniq";
import { observer } from "mobx-react";
import * as React from "react";
import { Trans, useTranslation } from "react-i18next";
diff --git a/plugins/slack/server/api/hooks.ts b/plugins/slack/server/api/hooks.ts
index 30bb69f3d7..afa7865810 100644
--- a/plugins/slack/server/api/hooks.ts
+++ b/plugins/slack/server/api/hooks.ts
@@ -1,6 +1,6 @@
import { t } from "i18next";
import Router from "koa-router";
-import { escapeRegExp } from "lodash";
+import escapeRegExp from "lodash/escapeRegExp";
import { Op } from "sequelize";
import { IntegrationService } from "@shared/types";
import env from "@server/env";
diff --git a/plugins/webhooks/client/components/WebhookSubscriptionForm.tsx b/plugins/webhooks/client/components/WebhookSubscriptionForm.tsx
index dfe4f98ce4..1bc0e5f2b3 100644
--- a/plugins/webhooks/client/components/WebhookSubscriptionForm.tsx
+++ b/plugins/webhooks/client/components/WebhookSubscriptionForm.tsx
@@ -1,4 +1,6 @@
-import { isEqual, filter, includes } from "lodash";
+import filter from "lodash/filter";
+import includes from "lodash/includes";
+import isEqual from "lodash/isEqual";
import randomstring from "randomstring";
import * as React from "react";
import { useEffect } from "react";
@@ -269,9 +271,7 @@ function WebhookSubscriptionForm({ handleSubmit, webhookSubscription }: Props) {
needs to function.
-
-