Unordered List Marker Style

ESLint rule to enforce a specified Markdown unordered list marker style in JSDoc descriptions.

Usage

var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style' );

rule

ESLint rule to enforce a specified Markdown unordered list marker style in JSDoc descriptions.

Bad:

/**
* Beep boop.
*
* +   Foo
* +   Bar
*
* @returns {string} a value
*
* @example
* var str = beep();
* // returns 'boop'
*/
function beep() {
    return 'boop';
}

Good:

/**
* Beep boop.
*
* -   Foo
* -   Bar
*
* @returns {string} a value
*
* @example
* var str = beep();
* // returns 'boop'
*/
function beep() {
    return 'boop';
}

The rule may be configured using the same options as supported by remark. By default, the rule enforces that - be used as the Markdown unordered list marker in JSDoc descriptions.

Examples

var Linter = require( 'eslint' ).Linter;
var rule = require( '@stdlib/_tools/eslint/rules/jsdoc-unordered-list-marker-style' );

var linter = new Linter();
var result;
var code;

// Generate our source code:
code = [
    '/**',
    '* Beep *boop*.',
    '*',
    '* +   Foo',
    '* +   Bar',
    '*',
    '* @param {string} str - input value',
    '* @returns {string} output value',
    '*',
    '* @example',
    '* var out = beep( "boop" );',
    '* // returns "beepboop"',
    '*/',
    'function beep( str ) {',
    '\treturn "beep" + str;',
    '}'
].join( '\n' );

// Register the ESLint rule:
linter.defineRule( 'jsdoc-unordered-list-marker-style', rule );

// Lint the code:
result = linter.verify( code, {
    'rules': {
        'jsdoc-unordered-list-marker-style': [ 'error', '-' ]
    }
});
console.log( result );
/* =>
    [
        {
            'ruleId': 'jsdoc-unordered-list-marker-style',
            'severity': 2,
            'message': 'Marker style should be `-`',
            'line': 4,
            'column': 3,
            'nodeType': null,
            'source': '* +   Foo',
            'endLine': 13,
            'endColumn': 3
        },
                {
            'ruleId': 'jsdoc-unordered-list-marker-style',
            'severity': 2,
            'message': 'Marker style should be `-`',
            'line': 5,
            'column': 3,
            'nodeType': null,
            'source': '* +   Bar',
            'endLine': 13,
            'endColumn': 3
        }
    ]
*/