From fdfbc10ae5989a08cfa73dba0758b34cb5508c83 Mon Sep 17 00:00:00 2001 From: Florens Verschelde Date: Mon, 24 Apr 2023 17:21:31 +0200 Subject: [PATCH 1/2] Add tslint rule forbidding lodash bare import --- tslint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tslint.yml b/tslint.yml index ac18571..e582cf6 100644 --- a/tslint.yml +++ b/tslint.yml @@ -20,6 +20,7 @@ rules: import-sources-order: case-insensitive module-source-path: full named-imports-order: case-insensitive + import-blacklist: [true, "lodash"] prettier: true no-namespace: false variable-name: From 1da3e7c37d685841856f159ed0e86727bd43f026 Mon Sep 17 00:00:00 2001 From: Florens Verschelde Date: Mon, 24 Apr 2023 17:22:22 +0200 Subject: [PATCH 2/2] Fix lodash bare import in OptionalBlueprint.tsx --- src/util/OptionalBlueprint.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/OptionalBlueprint.tsx b/src/util/OptionalBlueprint.tsx index b99afd5..2ea1939 100644 --- a/src/util/OptionalBlueprint.tsx +++ b/src/util/OptionalBlueprint.tsx @@ -1,7 +1,7 @@ import type { Classes } from '@blueprintjs/core'; import type { IconNames } from '@blueprintjs/icons'; import classNames from 'classnames'; -import _ from 'lodash'; +import kebabCase from 'lodash/kebabCase'; import * as React from 'react'; import { MosaicContext } from '../contextTypes'; @@ -28,10 +28,10 @@ export namespace OptionalBlueprint { }[keyof typeof Classes]; export function getClasses(blueprintNamespace: string, ...names: BlueprintClass[]): string { - return names.map((name) => `${blueprintNamespace}-${_.kebabCase(name)}`).join(' '); + return names.map((name) => `${blueprintNamespace}-${kebabCase(name)}`).join(' '); } export function getIconClass(blueprintNamespace: string, iconName: keyof typeof IconNames): string { - return `${blueprintNamespace}-icon-${_.kebabCase(iconName)}`; + return `${blueprintNamespace}-icon-${kebabCase(iconName)}`; } }