@hero-design/snowflake-guard
Version:
A hero-design bot detecting snowflake usage
26 lines (25 loc) • 885 B
TypeScript
import * as recast from 'recast';
import type { CompoundComponentName } from './types';
export type InlineStyleProps = 'style' | 'sx';
export declare const INLINE_STYLE_PROPERTIES: string[];
export declare const ADDITIONAL_PROPERTIES: string[];
export type ViolatingAttribute = {
attributeName: string;
attributeValue: string | null;
inlineStyleProps: InlineStyleProps;
componentName: CompoundComponentName;
loc: number | undefined;
};
export type AdditionalProp = {
propName: string;
propValue: string | null;
};
declare const reportInlineStyle: (ast: recast.types.ASTNode, attributes: recast.types.namedTypes.JSXAttribute[], componentName: CompoundComponentName) => {
locs: {
style?: number;
sx?: number;
};
violatingAttributes: ViolatingAttribute[];
additionalProps: AdditionalProp[];
};
export default reportInlineStyle;