Skip to content

Commit 7dd4109

Browse files
committed
Use custom rule
1 parent 25d34f8 commit 7dd4109

2 files changed

Lines changed: 54 additions & 28 deletions

File tree

etc/eslint/rules/stdlib.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,60 @@ rules[ 'stdlib/empty-line-before-comment' ] = 'error';
147147
*/
148148
rules[ 'stdlib/jsdoc-blockquote-indentation' ] = [ 'error', 2 ];
149149

150+
/**
151+
* Require checkboxes to be either empty (unchecked) or have an `x` (checked).
152+
*
153+
* @name jsdoc-checkbox-character-style
154+
* @memberof rules
155+
* @type {Array}
156+
* @see [checkbox-character-style]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-checkbox-character-style}
157+
*
158+
* @example
159+
* // Bad...
160+
*
161+
* /**
162+
* * Squares a number.
163+
* *
164+
* * - [X] Item
165+
* *
166+
* * @param {number} x - input number
167+
* * @returns {number} x squared
168+
* *
169+
* * @example
170+
* * var y = square( 2.0 );
171+
* * // returns 4.0
172+
* *\/
173+
* function square( x ) {
174+
* return x*x;
175+
* }
176+
*
177+
* @example
178+
* // Good...
179+
*
180+
* /**
181+
* * Squares a number.
182+
* *
183+
* * - [x] Item
184+
* *
185+
* * @param {number} x - input number
186+
* * @returns {number} x squared
187+
* *
188+
* * @example
189+
* * var y = square( 2.0 );
190+
* * // returns 4.0
191+
* *\/
192+
* function square( x ) {
193+
* return x*x;
194+
* }
195+
*/
196+
rules[ 'stdlib/jsdoc-checkbox-character-style' ] = [
197+
'error',
198+
{
199+
'checked': 'x',
200+
'unchecked': ' '
201+
}
202+
];
203+
150204
/**
151205
* Prevent checkboxes being followed by too much whitespace.
152206
*

etc/remark/plugins/lint/jsdoc.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,13 @@
1616
* limitations under the License.
1717
*/
1818

19-
/* eslint-disable stdlib/jsdoc-return-annotations-marker, stdlib/jsdoc-return-annotations-quote-props */
20-
2119
'use strict';
2220

2321
/**
2422
* Lint plugins for linting Markdown in JSDoc comments.
2523
*/
2624
var plugins = [ require( 'remark-lint' ) ];
2725

28-
/**
29-
* Require checkboxes to be either empty (unchecked) or have an `x` (checked).
30-
*
31-
* @see [checkbox-character-style]{@link https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-checkbox-character-style}
32-
*
33-
* @example
34-
* <!-- Bad -->
35-
*
36-
* * [X] checked
37-
*
38-
* @example
39-
* <!-- Good -->
40-
*
41-
* * [x] checked
42-
*/
43-
plugins.push([
44-
require( 'remark-lint-checkbox-character-style' ),
45-
[
46-
'error',
47-
{
48-
'checked': 'x',
49-
'unchecked': ' '
50-
}
51-
]
52-
]);
53-
5426

5527
// EXPORTS //
5628

0 commit comments

Comments
 (0)