@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
36 lines (35 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createLintRule = require("../utils/create-lint-rule");
var primitiveDocsUrl = 'https://go.atlassian.com/dst-prefer-primitives';
var rule = (0, _createLintRule.createLintRule)({
meta: {
name: 'prefer-primitives',
type: 'suggestion',
hasSuggestions: false,
deprecated: true,
docs: {
description: 'Increase awareness of primitive components via code hints. Strictly used for education purposes and discoverability.',
recommended: false,
severity: 'warn'
},
messages: {
preferPrimitives: "This \"{{element}}\" may be able to be replaced with a primitive component. See ".concat(primitiveDocsUrl, " for guidance.")
}
},
create: function create() {
/**
* We can't just outright delete the ESLint rule, since:
* ```
* // eslint-disable @eslint-plugin/design-system/prefer-primitives
* ```
* will cause CI to fail if the rule definition doesn't exist. So, instead
* we can change the implementation of the rule so that it never reports.
*/
return {};
}
});
var _default = exports.default = rule;