UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

28 lines • 950 B
import { createLintRule } from '../utils/create-lint-rule'; import { JSXElement as _JSXElement } from './node-types/jsx-element'; var 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: 'Replace <{{ name }}> with Checkbox from @atlaskit/checkbox/checkbox. Map checked and disabled to isChecked and isDisabled, and preserve its label, name, value and change behavior.' } }, create: function create(context) { return { // transforms <input type="checkbox" css={...}> usages JSXElement: function JSXElement(node) { _JSXElement.lint(node, { context: context }); } }; } }); export default rule;