Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit a463246

Browse files
committed
Add rule jsdoc/tag-lines
1 parent 7b610ce commit a463246

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

src/rules/jsdoc/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { NoTypesRule } from './no-types';
33
import type { RequireJsdocRule } from './require-jsdoc';
44
import type { RequireParamTypeRule } from './require-param-type';
55
import type { RequireReturnsTypeRule } from './require-returns-type';
6+
import type { TagLinesRule } from './tag-lines';
67

78
/**
89
* All jsdoc rules.
@@ -11,4 +12,5 @@ export type JSDocRules = MatchDescriptionRule &
1112
NoTypesRule &
1213
RequireJsdocRule &
1314
RequireParamTypeRule &
14-
RequireReturnsTypeRule;
15+
RequireReturnsTypeRule &
16+
TagLinesRule;

src/rules/jsdoc/tag-lines.d.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Config.
5+
*/
6+
export type TagLinesConfig = {
7+
/**
8+
* Use with "always" to indicate the number of lines to require be present.
9+
*
10+
* @default 1
11+
*
12+
* @see [count](https://github.com/gajus/eslint-plugin-jsdoc#count-defaults-to-1)
13+
*/
14+
count?: number;
15+
/**
16+
* Use with "always" to indicate the normal lines to be added after tags should not be added after the final tag.
17+
*
18+
* @default false
19+
*
20+
* @see [noEndLines](https://github.com/gajus/eslint-plugin-jsdoc#noendlines-defaults-to-false)
21+
*/
22+
noEndLines?: boolean;
23+
};
24+
25+
/**
26+
* Values for tag lines.
27+
*/
28+
export type TagLinesOptionValue = 'always' | 'never';
29+
30+
/**
31+
* Option.
32+
*/
33+
export type TagLinesOption = TagLinesOptionValue;
34+
35+
/**
36+
* Options.
37+
*/
38+
export type TagLinesOptions = [TagLinesOption?, TagLinesConfig?];
39+
40+
/**
41+
* Enforces lines (or no lines) between tags.
42+
*
43+
* @see [tag-lines](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-tag-lines)
44+
*/
45+
export type TagLinesRuleConfig = RuleConfig<TagLinesOptions>;
46+
47+
/**
48+
* Enforces lines (or no lines) between tags.
49+
*
50+
* @see [tag-lines](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-tag-lines)
51+
*/
52+
export interface TagLinesRule {
53+
/**
54+
* Enforces lines (or no lines) between tags.
55+
*
56+
* @see [tag-lines](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-tag-lines)
57+
*/
58+
'jsdoc/tag-lines': TagLinesRuleConfig;
59+
}

0 commit comments

Comments
 (0)