@atlaskit/eslint-plugin-ui-styling-standard
Version:
The eslint plugin to enforce and educate on Atlassian's UI Styling Standard
39 lines (38 loc) • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createNoExportedRule = require("@atlaskit/eslint-utils/create-no-exported-rule");
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
var _createRule = require("../utils/create-rule");
var schema = [{
type: 'object',
properties: {
importSources: {
type: 'array',
items: {
type: 'string'
},
uniqueItems: true
}
}
}];
var supportedImports = [_isSupportedImport.isCss, _isSupportedImport.isCssMap, _isSupportedImport.isKeyframes, _isSupportedImport.isXcss, _isSupportedImport.isStyled];
var rule = (0, _createRule.createLintRule)({
meta: {
name: 'no-exported-styles',
docs: {
description: 'Disallows exports of css, keyframes, styled and xcss',
recommended: true,
severity: 'error'
},
messages: {
'no-exported-styles': "Keep css, cssMap, keyframes, styled and xcss declarations in the file that uses them. Export a component to share its styling instead of exporting style values."
},
type: 'problem',
schema: schema
},
create: (0, _createNoExportedRule.createNoExportedRule)(supportedImports, 'no-exported-styles')
});
var _default = exports.default = rule;