UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

30 lines 1.16 kB
import { isCss } from '@atlaskit/eslint-utils/is-supported-import'; import { createLintRule } from '../utils/create-lint-rule'; import { createNoExportedRule } from '../utils/create-no-exported-rule/main'; var noExportedCssRule = createLintRule({ meta: { name: 'no-exported-css', type: 'problem', docs: { description: 'Forbid exporting `css` function calls. Exporting `css` function calls can result in unexpected behaviour at runtime, and is not statically analysable.', removeFromPresets: true // effectively disable this rule here, this is overriden by `@atlaskit/ui-styling-standard` instead }, messages: { unexpected: "`css` can't be exported - this will cause unexpected behaviour at runtime. Instead, please move your `css(...)` code to the same file where these styles are being used." }, schema: [{ type: 'object', properties: { importSources: { type: 'array', items: [{ type: 'string' }] } }, additionalProperties: false }] }, create: createNoExportedRule(isCss, 'unexpected') }); export default noExportedCssRule;