eslint-plugin-mdx
Version:
ESLint Plugin for MDX
27 lines • 882 B
JavaScript
import { ENABLED_OPTION_SCHEMA, getRuleConfig } from './helpers.js';
export const noShortcutReferenceLink = {
meta: {
type: 'problem',
docs: {
description: 'Disallow shortcut reference links',
},
schema: [ENABLED_OPTION_SCHEMA],
},
create(context) {
const config = getRuleConfig(context, 'no-shortcut-reference-link');
if (!config) {
return {};
}
return {
MDLinkReference(node) {
if (node.referenceType === 'shortcut') {
context.report({
loc: node.loc,
message: 'Unexpected shortcut reference link (`[text]`), expected collapsed reference (`[text][]`)',
});
}
},
};
},
};
//# sourceMappingURL=no-shortcut-reference-link.js.map