UNPKG

eslint-plugin-mdx

Version:
33 lines • 1.21 kB
import { ENABLED_OPTION_SCHEMA, getRuleConfig } from './helpers.js'; export const listItemBulletIndent = { meta: { type: 'layout', docs: { description: 'Disallow indented list bullets' }, schema: [ENABLED_OPTION_SCHEMA], }, create(context) { const config = getRuleConfig(context, 'list-item-bullet-indent'); if (!config) { return {}; } return { Program(node) { for (const child of node.body) { if (child.type !== 'MDList') { continue; } for (const item of child.children) { const actual = item.loc.start.column; if (actual > 0) { context.report({ loc: item.loc, message: `Unexpected \`${actual}\` ${actual === 1 ? 'space' : 'spaces'} before list item, expected \`0\` spaces, remove them`, }); } } } }, }; }, }; //# sourceMappingURL=list-item-bullet-indent.js.map