Skip to content

Commit 182e952

Browse files
committed
- docs: Update README
1 parent a78f84a commit 182e952

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

README.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ JSDoc linting rules for ESLint.
3333
* [`implements-on-classes`](#eslint-plugin-jsdoc-rules-implements-on-classes)
3434
* [`match-description`](#eslint-plugin-jsdoc-rules-match-description)
3535
* [`newline-after-description`](#eslint-plugin-jsdoc-rules-newline-after-description)
36+
* [`no-types`](#eslint-plugin-jsdoc-rules-no-types)
3637
* [`no-undefined-types`](#eslint-plugin-jsdoc-rules-no-undefined-types)
3738
* [`require-description-complete-sentence`](#eslint-plugin-jsdoc-rules-require-description-complete-sentence)
3839
* [`require-description`](#eslint-plugin-jsdoc-rules-require-description)
@@ -129,6 +130,7 @@ Finally, enable all of the rules that you would like to use.
129130
"jsdoc/implements-on-classes": 1,
130131
"jsdoc/match-description": 1,
131132
"jsdoc/newline-after-description": 1,
133+
"jsdoc/no-types": 1,
132134
"jsdoc/no-undefined-types": 1,
133135
"jsdoc/require-description": 1,
134136
"jsdoc/require-description-complete-sentence": 1,
@@ -1834,6 +1836,52 @@ function quux () {
18341836
````
18351837

18361838

1839+
<a name="eslint-plugin-jsdoc-rules-no-types"></a>
1840+
### <code>no-types</code>
1841+
1842+
This rule reports types being used on `@param` or `@returns`.
1843+
1844+
The rule is intended to prevent the indication of types on tags where
1845+
the type information would be redundant with TypeScript.
1846+
1847+
|||
1848+
|---|---|
1849+
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
1850+
|Tags|`param`, `returns`|
1851+
|Aliases|`arg`, `argument`, `return`|
1852+
1853+
The following patterns are considered problems:
1854+
1855+
````js
1856+
/**
1857+
* @param {number} foo
1858+
*/
1859+
function quux (foo) {
1860+
1861+
}
1862+
// Message: Types are not permitted on @param.
1863+
1864+
/**
1865+
* @returns {number}
1866+
*/
1867+
function quux () {
1868+
1869+
}
1870+
// Message: Types are not permitted on @returns.
1871+
````
1872+
1873+
The following patterns are not considered problems:
1874+
1875+
````js
1876+
/**
1877+
* @param foo
1878+
*/
1879+
function quux (foo) {
1880+
1881+
}
1882+
````
1883+
1884+
18371885
<a name="eslint-plugin-jsdoc-rules-no-undefined-types"></a>
18381886
### <code>no-undefined-types</code>
18391887

@@ -3869,7 +3917,7 @@ Also impacts behaviors on namepath (or event)-defining and pointing tags:
38693917
1. Name(path)-pointing tags (which may have value without namepath): `@listens`, `@fires`, `@emits`
38703918
1. Name(path)-pointing tags (multiple names in one): `@borrows`
38713919

3872-
The following apply to the above sets:
3920+
...with the following applying to the above sets:
38733921

38743922
- Expect tags in set 1-4 to have a valid namepath if present
38753923
- Prevent sets 3-4 from being empty by setting `allowEmptyNamepaths` to `false` as these tags might have some indicative value without a path (but sets 1-2 will always fail if empty)

0 commit comments

Comments
 (0)