@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
36 lines (35 loc) • 1.33 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 noExportedCssRule = (0, _createLintRule.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: (0, _main.createNoExportedRule)(_isSupportedImport.isCss, 'unexpected')
});
var _default = exports.default = noExportedCssRule;