Skip to content

Commit

Permalink
Enable rule to require angle-bracketed links to have protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Dec 29, 2017
1 parent f9bda3d commit adcfad8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions etc/eslint/rules/stdlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,55 @@ rules[ 'stdlib/jsdoc-markdown-remark' ] = [ 'error',
}
];

/**
* Require angle-bracketed links to include a protocol.
*
* @name jsdoc-no-auto-link-without-protocol
* @memberof rules
* @type {string}
* @default 'error'
* @see [list-item-bullet-indent]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-no-auto-link-without-protocol}
*
* @example
* // Bad...
*
* /**
* * Squares a number.
* *
* * <foo@bar.com>
* *
* * @arg {number} x - input number
* * @return {number} x squared
* *
* * @examples
* * var y = square( 2.0 );
* * // returns 4.0
* *\/
* function square( x ) {
* return x*x;
* }
*
* @example
* // Good...
*
* /**
* * Squares a number.
* *
* * <mailto:foo@bar.com>
* *
* * @arg {number} x - input number
* * @return {number} x squared
* *
* * @examples
* * var y = square( 2.0 );
* * // returns 4.0
* *\/
* function square( x ) {
* return x*x;
* }
*/
rules[ 'stdlib/jsdoc-no-auto-link-without-protocol' ] = 'error';

/**
* Require that only allowed JSDoc tags are used.
*
Expand Down

0 comments on commit adcfad8

Please sign in to comment.