@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
11 lines • 613 B
JavaScript
export const hasImportOfName = (node, name) => {
return node.specifiers.some(
// This should not be an `any`. This is an array of `ImportSpecifier |
// ImportDefaultSpecifier`. For some reason, filtering this way still
// results in an error of `specifier.imported` doesn't exist on
// ImportDefaultSpecifier, which is exactly what I'm filtering for
specifier => {
var _specifier$imported;
return (specifier === null || specifier === void 0 ? void 0 : (_specifier$imported = specifier.imported) === null || _specifier$imported === void 0 ? void 0 : _specifier$imported.name) === name;
});
};