@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
36 lines (35 loc) • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
var _createLintRule = require("../utils/create-lint-rule");
var _main = require("../utils/create-no-exported-rule/main");
var noExportedKeyframesRule = (0, _createLintRule.createLintRule)({
meta: {
name: 'no-exported-keyframes',
type: 'problem',
docs: {
description: 'Forbid exporting `keyframes` 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: "`keyframes` can't be exported - this will cause unexpected behaviour at runtime. Instead, please move your `keyframes(...)` code to the same file where these styles are being used."
},
schema: [{
type: 'object',
properties: {
importSources: {
type: 'array',
items: [{
type: 'string'
}]
}
},
additionalProperties: false
}]
},
create: (0, _main.createNoExportedRule)(_isSupportedImport.isKeyframes, 'unexpected')
});
var _default = exports.default = noExportedKeyframesRule;