@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
8 lines • 317 B
JavaScript
/**
* @param {SourceCode} source The eslint source
* @param {string} path The path specified to find
* @returns {ImportDeclaration}
*/
export const getImportedNodeBySource = (source, path) => {
return source.ast.body.filter(node => node.type === 'ImportDeclaration').find(node => node.source.value === path);
};