UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

12 lines 396 B
/** * @param {SourceCode} source The eslint source * @param {string} path The path specified to find * @returns {ImportDeclaration} */ export var getImportedNodeBySource = function getImportedNodeBySource(source, path) { return source.ast.body.filter(function (node) { return node.type === 'ImportDeclaration'; }).find(function (node) { return node.source.value === path; }); };