check-list-item-indent.js 439 B

12345678910111213141516171819
  1. module.exports = checkListItemIndent
  2. function checkListItemIndent(context) {
  3. var style = context.options.listItemIndent || 'tab'
  4. if (style === 1 || style === '1') {
  5. return 'one'
  6. }
  7. if (style !== 'tab' && style !== 'one' && style !== 'mixed') {
  8. throw new Error(
  9. 'Cannot serialize items with `' +
  10. style +
  11. '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'
  12. )
  13. }
  14. return style
  15. }