/** * @typedef {import('../types.js').Context} Context * @typedef {import('../types.js').Options} Options */ /** * @param {Context} context * @returns {Exclude} */ export function checkListItemIndent(context) { const style = context.options.listItemIndent || 'tab' // To do: remove in a major. // @ts-expect-error: deprecated. if (style === 1 || style === '1') { return 'one' } if (style !== 'tab' && style !== 'one' && style !== 'mixed') { throw new Error( 'Cannot serialize items with `' + style + '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`' ) } return style }