UNPKG

eslint-plugin-styled-components-a11y

Version:

This plugin adds the ability to lint styled components according to the rules outlined in eslint-plugin-jsx-a11y.

12 lines (11 loc) 691 B
"use strict"; var _require = require('./constants'), __UNKNOWN_IDENTIFER__ = _require.__UNKNOWN_IDENTIFER__; module.exports = function (_ref) { var key = _ref.key, value = _ref.value; return (// we set all attributes which are variable identifiers as '__UNKNOWN_IDENTIFER__' just so there can be some value for the kv pair since we have no way of knowing the real value. // thus, here we want to just plug that string in without any quotes so the linter treats it just like a variable would have been handled normally "".concat(key, "=").concat(typeof value !== 'string' || value === __UNKNOWN_IDENTIFER__ ? "{".concat(value, "}") : "\"".concat(value, "\""), " ") ); };