Skip to content

Commit 6f71b2a

Browse files
committed
Enable rule to prevent duplicate definitions
1 parent 77c3eda commit 6f71b2a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

etc/eslint/rules/stdlib.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,56 @@ rules[ 'stdlib/jsdoc-no-auto-link-without-protocol' ] = 'error';
737737
*/
738738
rules[ 'stdlib/jsdoc-no-blockquote-without-marker' ] = 'error';
739739

740+
/**
741+
* Do not allow duplicate definitions.
742+
*
743+
* @name jsdoc-no-duplicate-definitions
744+
* @memberof rules
745+
* @type {string}
746+
* @default 'error'
747+
* @see [list-item-bullet-indent]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-no-duplicate-definitions}
748+
*
749+
* @example
750+
* // Bad...
751+
*
752+
* /**
753+
* * Squares a [number][number].
754+
* *
755+
* * [number]: https://example.com
756+
* * [number]: https://example.com
757+
* *
758+
* * @arg {number} x - input number
759+
* * @return {number} x squared
760+
* *
761+
* * @examples
762+
* * var y = square( 2.0 );
763+
* * // returns 4.0
764+
* *\/
765+
* function square( x ) {
766+
* return x*x;
767+
* }
768+
*
769+
* @example
770+
* // Good...
771+
*
772+
* /**
773+
* * Squares a [number][number].
774+
* *
775+
* * [number]: https://example.com
776+
* *
777+
* * @arg {number} x - input number
778+
* * @return {number} x squared
779+
* *
780+
* * @examples
781+
* * var y = square( 2.0 );
782+
* * // returns 4.0
783+
* *\/
784+
* function square( x ) {
785+
* return x*x;
786+
* }
787+
*/
788+
rules[ 'stdlib/jsdoc-no-duplicate-definitions' ] = 'error';
789+
740790
/**
741791
* Require that only allowed JSDoc tags are used.
742792
*

0 commit comments

Comments
 (0)