Skip to content

Commit

Permalink
Merge pull request #207 from fvsch/fvsch/import-lodash-functions-expl…
Browse files Browse the repository at this point in the history
…icitly

Import lodash/kebabCase instead of lodash in OptionalBlueprint.tsx
  • Loading branch information
nomcopter authored Apr 24, 2023
2 parents c074f90 + 1da3e7c commit 163181d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/OptionalBlueprint.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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)}`;
}
}
1 change: 1 addition & 0 deletions tslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 163181d

Please sign in to comment.