@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
29 lines • 1.09 kB
JavaScript
import { createLintRule } from '../utils/create-lint-rule';
import { StyleProperty } from './transformers/style-property';
export var 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 = 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.lint(node, {
context: context
});
}
};
}
});
export default rule;