@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
12 lines (11 loc) • 407 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isImportFromPackage = isImportFromPackage;
/**
* Returns true when an import source is either the package root or one of its subpath entrypoints.
*/
function isImportFromPackage(source, packageName) {
return typeof source === 'string' && (source === packageName || source.startsWith("".concat(packageName, "/")));
}