@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
35 lines (34 loc) • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.noRawSpacingValues = exports.default = void 0;
var _createLintRule = require("../utils/create-lint-rule");
var _styleProperty = require("./transformers/style-property");
var noRawSpacingValues = exports.noRawSpacingValues = "Don't use non-token values in padding or margin. There is ongoing work to make this a TypeScript error. Once that happens, you will have to delete/refactor anyway. Atlassians: See https://go.atlassian.com/xcss-spacing for details.";
var rule = (0, _createLintRule.createLintRule)({
meta: {
name: 'use-latest-xcss-syntax',
type: 'problem',
fixable: 'code',
hasSuggestions: false,
docs: {
description: 'Enforces usage of space design tokens rather than hard-coded values in xcss.',
recommended: true,
severity: 'error'
},
messages: {
noRawSpacingValues: noRawSpacingValues
}
},
create: function create(context) {
return {
'CallExpression[callee.name="xcss"] ObjectExpression Property': function CallExpressionCalleeNameXcss_ObjectExpression_Property(node) {
return _styleProperty.StyleProperty.lint(node, {
context: context
});
}
};
}
});
var _default = exports.default = rule;