diff --git a/package.json b/package.json index 36eb0ec7..98cd98f1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "firebase": "^9.6.10", "firebaseui": "^6.0.1", "jotai": "^1.6.4", - "lodash": "^4.17.21", "lodash-es": "^4.17.21", "notistack": "^2.0.4", "react": "^18.0.0", @@ -66,6 +65,20 @@ "allowSameFolder": true } ], + "no-restricted-imports": [ + "error", + { + "patterns": [ + { + "group": [ + "lodash", + "lodash/*" + ], + "message": "Use lodash-es instead" + } + ] + } + ], "tsdoc/syntax": "warn" } }, @@ -92,7 +105,6 @@ "@testing-library/user-event": "^14.0.4", "@types/dompurify": "^2.3.3", "@types/jest": "^27.4.1", - "@types/lodash": "^4.14.181", "@types/lodash-es": "^4.17.6", "@types/node": "^17.0.23", "@types/react": "^18.0.5", diff --git a/src/constants/externalLinks.ts b/src/constants/externalLinks.ts index 18de531c..e9cf754c 100644 --- a/src/constants/externalLinks.ts +++ b/src/constants/externalLinks.ts @@ -1,4 +1,4 @@ -import _mapValues from "lodash/mapValues"; +import { mapValues } from "lodash-es"; import meta from "@root/package.json"; export const EXTERNAL_LINKS = { @@ -51,7 +51,7 @@ const WIKI_PATHS = { extensionsTwilioMessage: "/extensions/twilio-message", webhooks: "/webhooks", }; -export const WIKI_LINKS = _mapValues( +export const WIKI_LINKS = mapValues( WIKI_PATHS, (path) => EXTERNAL_LINKS.docs + path ); diff --git a/src/theme/index.tsx b/src/theme/index.tsx index 75ab933c..b1a74b1f 100644 --- a/src/theme/index.tsx +++ b/src/theme/index.tsx @@ -1,5 +1,5 @@ import { createTheme, ThemeOptions } from "@mui/material/styles"; -import _merge from "lodash/merge"; +import { merge } from "lodash-es"; import { typography } from "@src/theme/typography"; import { colorsLight, colorsDark } from "@src/theme/colors"; @@ -7,7 +7,7 @@ import { components } from "@src/theme/components"; export const customizableLightTheme = (customization: ThemeOptions) => { const customizedLightThemeBase = createTheme( - _merge( + merge( {}, typography((customization?.typography as any) ?? {}), colorsLight((customization?.palette?.primary as any)?.main) @@ -15,7 +15,7 @@ export const customizableLightTheme = (customization: ThemeOptions) => { ); return createTheme( - _merge( + merge( {}, customizedLightThemeBase, components(customizedLightThemeBase), @@ -26,7 +26,7 @@ export const customizableLightTheme = (customization: ThemeOptions) => { export const customizableDarkTheme = (customization: ThemeOptions) => { const customizedDarkThemeBase = createTheme( - _merge( + merge( {}, typography((customization?.typography as any) ?? {}), colorsDark( @@ -37,7 +37,7 @@ export const customizableDarkTheme = (customization: ThemeOptions) => { ); return createTheme( - _merge( + merge( {}, customizedDarkThemeBase, components(customizedDarkThemeBase), diff --git a/yarn.lock b/yarn.lock index 8d385e58..56dcd7bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3510,7 +3510,7 @@ dependencies: "@types/lodash" "*" -"@types/lodash@*", "@types/lodash@^4.14.181": +"@types/lodash@*": version "4.14.181" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.181.tgz#d1d3740c379fda17ab175165ba04e2d03389385d" integrity sha512-n3tyKthHJbkiWhDZs3DkhkCzt2MexYHXlX0td5iMplyfwketaOeKboEVBqzceH7juqvEg3q5oUoBFxSLu7zFag==