@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
30 lines (29 loc) • 1.06 kB
TypeScript
import type { Rule } from 'eslint';
import { type JSXAttribute } from 'eslint-codemod-utils';
declare const HelperJSXAttribute: {
getName(node: JSXAttribute): string;
updateName(node: JSXAttribute, name: string, fixer: Rule.RuleFixer): Rule.Fix;
/**
* A JSXAttribute value can be many things:
* - css='myStyles'
* - css={myStyles}
* - css={[styles1, styles2]}
* - header={<></>}
* - css={styleMap.header}
* - css={...styles}
*
* Currently, `getValue` has only implemented strategies for when the value is a string, or an ExpressionStatement
* If you need additional functionality add it, and set the correct `type` on the returned object
*/
getValue(node: JSXAttribute): {
type: 'ExpressionStatement';
value: string;
} | {
type: 'ExpressionStatement Literal';
value: string | number | bigint | boolean | RegExp | null | undefined;
} | {
type: 'Literal';
value: string;
} | undefined;
};
export { HelperJSXAttribute as JSXAttribute };