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

Commit ebf42df

Browse files
committed
Add rule jsdoc/no-types
1 parent 39ec79e commit ebf42df

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

src/rules/jsdoc/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { MatchDescriptionRule } from './match-description';
2+
import type { NoTypesRule } from './no-types';
23

34
/**
45
* All jsdoc rules.
56
*/
6-
export type JSDocRules = MatchDescriptionRule;
7+
export type JSDocRules = MatchDescriptionRule & NoTypesRule;

src/rules/jsdoc/no-types.d.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export type NoTypesOption = {
7+
/**
8+
* @see [contexts](https://github.com/gajus/eslint-plugin-jsdoc#contexts-3)
9+
*/
10+
contexts?: string[];
11+
};
12+
13+
/**
14+
* Options.
15+
*/
16+
export type NoTypesOptions = [NoTypesOption?];
17+
18+
/**
19+
* This rule reports types being used on `@param` or `@returns`.
20+
*
21+
* The rule is intended to prevent the indication of types on tags where the type information would be redundant with TypeScript.
22+
*
23+
* @see [no-types](https://github.com/gajus/eslint-plugin-jsdoc#no-types)
24+
*/
25+
export type NoTypesRuleConfig = RuleConfig<NoTypesOptions>;
26+
27+
/**
28+
* This rule reports types being used on `@param` or `@returns`.
29+
*
30+
* The rule is intended to prevent the indication of types on tags where the type information would be redundant with TypeScript.
31+
*
32+
* @see [no-types](https://github.com/gajus/eslint-plugin-jsdoc#no-types)
33+
*/
34+
export interface NoTypesRule {
35+
/**
36+
* This rule reports types being used on `@param` or `@returns`.
37+
*
38+
* The rule is intended to prevent the indication of types on tags where the type information would be redundant with TypeScript.
39+
*
40+
* @see [no-types](https://github.com/gajus/eslint-plugin-jsdoc#no-types)
41+
*/
42+
'jsdoc/no-types': NoTypesRuleConfig;
43+
}

0 commit comments

Comments
 (0)