UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

34 lines (33 loc) • 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _createLintRule = require("../utils/create-lint-rule"); var _jsxElement = require("./node-types/jsx-element"); var rule = (0, _createLintRule.createLintRule)({ meta: { name: 'no-html-text-input', type: 'suggestion', hasSuggestions: true, docs: { description: 'Discourage direct usage of HTML text input elements in favor of the Atlassian Design System textfield component.', recommended: true, severity: 'warn' }, messages: { noHtmlTextInput: 'Replace <{{ name }}> with Textfield from @atlaskit/textfield/text-field. Preserve type, name, id, value and handlers, and associate its visible label with the same id.' } }, create: function create(context) { return { // transforms <input type="range" css={...}> usages JSXElement: function JSXElement(node) { _jsxElement.JSXElement.lint(node, { context: context }); } }; } }); var _default = exports.default = rule;