Skip to content

Commit 0d746a2

Browse files
committed
Switch out for custom rules
1 parent cdb22aa commit 0d746a2

File tree

2 files changed

+62
-46
lines changed

2 files changed

+62
-46
lines changed

etc/eslint/rules/stdlib.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,13 @@ rules[ 'stdlib/jsdoc-fenced-code-marker' ] = [ 'error', '`' ];
542542
*/
543543
rules[ 'stdlib/jsdoc-final-definition' ] = 'error';
544544

545+
/**
546+
* Require first heading level be a level `2` heading in JSDoc comments. A level `1` heading is implied.
547+
*
548+
* @see [first-heading-level]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-first-heading-level}
549+
*/
550+
rules[ 'stdlib/jsdoc-first-heading-level' ] = [ 'error', 2 ];
551+
545552
/**
546553
* Prevent too many spaces from being used to hard break.
547554
*
@@ -593,6 +600,61 @@ rules[ 'stdlib/jsdoc-final-definition' ] = 'error';
593600
*/
594601
rules[ 'stdlib/jsdoc-hard-break-spaces' ] = 'error';
595602

603+
/**
604+
* Warn when headings increment by more than 1 level.
605+
*
606+
* @see [heading-increment]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-heading-increment}
607+
*/
608+
rules[ 'stdlib/jsdoc-heading-increment' ] = [ 'warn' ];
609+
610+
/**
611+
* Require `atx` heading style.
612+
*
613+
* @see [heading-style]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-heading-style}
614+
*
615+
* @example
616+
* // Bad...
617+
*
618+
* /**
619+
* * Returns a pseudo-random number on `[0,1]`
620+
* *
621+
* * Beep
622+
* * ===
623+
* *
624+
* * ## Boop
625+
* *
626+
* * @returns {number} uniform random number
627+
* *
628+
* * @example
629+
* * var y = rand();
630+
* * // e.g., returns 0.5363925252089496
631+
* *\/
632+
* function rand() {
633+
* return Math.random();
634+
* }
635+
*
636+
* @example
637+
* // Good...
638+
*
639+
* /**
640+
* * Returns a pseudo-random number on `[0,1]`
641+
* *
642+
* * # Beep
643+
* *
644+
* * ## Boop
645+
* *
646+
* * @returns {number} uniform random number
647+
* *
648+
* * @example
649+
* * var y = rand();
650+
* * // e.g., returns 0.5363925252089496
651+
* *\/
652+
* function rand() {
653+
* return Math.random();
654+
* }
655+
*/
656+
rules[ 'stdlib/jsdoc-heading-style' ] = [ 'error', 'atx' ];
657+
596658
/**
597659
* Require that JSDoc descriptions start with an uppercase letter and end with a period.
598660
*

etc/remark/plugins/lint/jsdoc.js

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -80,52 +80,6 @@ plugins.push([
8080
]
8181
]);
8282

83-
/**
84-
* Require first heading level be a level `2` heading in JSDoc comments. A level `1` heading is implied.
85-
*
86-
* @see [first-heading-level]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-first-heading-level}
87-
*/
88-
plugins.push([
89-
require( 'remark-lint-first-heading-level' ),
90-
[ 'error', 2 ]
91-
]);
92-
93-
/**
94-
* Warn when headings increment by more than 1 level.
95-
*
96-
* @see [heading-increment]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-heading-increment}
97-
*/
98-
plugins.push([
99-
require( 'remark-lint-heading-increment' ),
100-
[ 'warn' ]
101-
]);
102-
103-
/**
104-
* Require `atx` heading style.
105-
*
106-
* @see [heading-style]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-heading-style}
107-
*
108-
* @example
109-
* <!-- Bad -->
110-
*
111-
* Beep
112-
* ===
113-
*
114-
* ## Boop
115-
*
116-
* @example
117-
* <!-- Good -->
118-
*
119-
* # Beep
120-
*
121-
* ## Boop
122-
*
123-
*/
124-
plugins.push([
125-
require( 'remark-lint-heading-style' ),
126-
[ 'error', 'atx' ]
127-
]);
128-
12983
/**
13084
* Require consistent list item spacing.
13185
*

0 commit comments

Comments
 (0)