@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
22 lines • 1.14 kB
JavaScript
import { isCss } from '@atlaskit/eslint-utils/is-supported-import';
import { createLintRule } from '../utils/create-lint-rule';
import { createNoTaggedTemplateExpressionRule } from '../utils/create-no-tagged-template-expression-rule/create-no-tagged-template-expression-rule';
import { noTaggedTemplateExpressionRuleSchema } from '../utils/create-no-tagged-template-expression-rule/no-tagged-template-expression-rule-schema';
const rule = createLintRule({
meta: {
name: 'no-css-tagged-template-expression',
fixable: 'code',
type: 'problem',
docs: {
description: 'Disallows any `css` tagged template expressions that originate from Emotion, Styled Components or Compiled',
recommended: false,
severity: 'error'
},
messages: {
unexpectedTaggedTemplate: 'Replace the css template literal with an object-form css() or cssMap() declaration; migrate properties and interpolations to static local styles or runtime style values.'
},
schema: noTaggedTemplateExpressionRuleSchema
},
create: createNoTaggedTemplateExpressionRule(isCss, 'unexpectedTaggedTemplate')
});
export default rule;