@atlaskit/eslint-plugin-ui-styling-standard
Version:
The eslint plugin to enforce and educate on Atlassian's UI Styling Standard
14 lines • 468 B
JavaScript
import { closestOfType } from 'eslint-codemod-utils';
import { isSafeStyleArgument } from './is-safe-style-argument';
export function isSafeCss(css) {
return css.references.every(ref => {
const callExpression = closestOfType(ref.identifier, 'CallExpression');
if (!callExpression) {
return false;
}
if (callExpression.callee !== ref.identifier) {
return false;
}
return callExpression.arguments.every(isSafeStyleArgument);
});
}