UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

28 lines 925 B
import { createLintRule } from '../utils/create-lint-rule'; import { JSXElement } from './node-types/jsx-element'; const rule = createLintRule({ meta: { name: 'no-html-radio', type: 'suggestion', hasSuggestions: true, docs: { description: 'Discourage direct usage of HTML radio elements in favor of the Atlassian Design System radio component.', recommended: true, severity: 'warn' }, messages: { noHtmlRadio: `This <{{ name }}> should be replaced with a radio component from the Atlassian Design System. ADS components include event tracking, ensure accessible implementations, and provide access to ADS styling features like design tokens.` } }, create(context) { return { // transforms <input type="radio" css={...}> usages JSXElement(node) { JSXElement.lint(node, { context }); } }; } }); export default rule;