UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

28 lines 943 B
import { createLintRule } from '../utils/create-lint-rule'; import { JSXElement } from './node-types/jsx-element'; const rule = createLintRule({ meta: { name: 'no-html-checkbox', type: 'suggestion', hasSuggestions: true, docs: { description: 'Discourage direct usage of HTML checkbox elements in favor of the Atlassian Design System checkbox component.', recommended: true, severity: 'warn' }, messages: { noHtmlCheckbox: `This <{{ name }}> should be replaced with a checkbox 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="checkbox" css={...}> usages JSXElement(node) { JSXElement.lint(node, { context }); } }; } }); export default rule;