UNPKG

@atlaskit/eslint-plugin-ui-styling-standard

Version:

The eslint plugin to enforce and educate on Atlassian's UI Styling Standard

24 lines (23 loc) • 3.52 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.messages = void 0; var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _outdent = _interopRequireDefault(require("outdent")); var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0; var whereToGetHelp = "If you think this should be allowed, or if you're running into issues, reach out in #help-ui-styling-standard"; var messages = exports.messages = { 'no-array-values': (0, _outdent.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n Arrays are not allowed in style objects. Support is inconsistent between styling libraries.\n\n Compose styles with the css prop instead.\n\n ", "\n "])), whereToGetHelp), 'no-conditional-values': (0, _outdent.default)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n Conditional expressions are not allowed in style objects.\n\n Conditionally apply styles with the css prop instead.\n\n ", "\n "])), whereToGetHelp), 'no-dynamic-keys': (0, _outdent.default)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n Dynamic keys are not allowed in style objects.\n\n ", "\n "])), whereToGetHelp), 'no-function-calls': (0, _outdent.default)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n Function calls are not allowed in style objects.\n\n ", "\n "])), whereToGetHelp), 'no-identifier-arguments': (0, _outdent.default)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n Variable arguments are not allowed.\n\n Inline the object value, or compose styles with the css prop instead.\n\n ", "\n "])), whereToGetHelp), 'no-object-access': (0, _outdent.default)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n Accessing object values is not allowed in style objects.\n\n If you are accessing the component's props, use the style prop to apply dynamic values instead.\n\n ", "\n "])), whereToGetHelp), 'no-object-references': (0, _outdent.default)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n Referencing objects is not allowed in style objects.\n\n Inline the object value instead.\n\n ", "\n "])), whereToGetHelp), 'no-spread-elements': (0, _outdent.default)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n Spread elements are not allowed in style objects.\n\n Compose styles with the css prop instead.\n\n ", "\n "])), whereToGetHelp), // Fallback case if a more specific message is not applicable 'no-unsafe-values': (0, _outdent.default)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n Unsafe values are not allowed in style objects.\n\n ", "\n "])), whereToGetHelp), 'no-variables': (0, _outdent.default)(_templateObject0 || (_templateObject0 = (0, _taggedTemplateLiteral2.default)(["\n Variables are not allowed in style objects, unless they:\n\n - Have a simple, static value.\n - Are defined in the same file.\n\n Use the style prop to apply dynamic values instead.\n\n ", "\n "])), whereToGetHelp) };