Skip to content

Commit e8a08b0

Browse files
authored
[Restore] README.md
1 parent 2211602 commit e8a08b0

File tree

1 file changed

+241
-49
lines changed

1 file changed

+241
-49
lines changed

README.md

Lines changed: 241 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ JSDoc linting rules for ESLint.
3333
* [`require-param`](#eslint-plugin-jsdoc-rules-require-param)
3434
* [`require-returns-description`](#eslint-plugin-jsdoc-rules-require-returns-description)
3535
* [`require-returns-type`](#eslint-plugin-jsdoc-rules-require-returns-type)
36-
* [`require-returns-check`](#eslint-plugin-jsdoc-rules-require-returns-check)
3736
* [`require-returns`](#eslint-plugin-jsdoc-rules-require-returns)
3837
* [`valid-types`](#eslint-plugin-jsdoc-rules-valid-types)
3938

@@ -59,7 +58,6 @@ This table maps the rules between `eslint-plugin-jsdoc` and `jscs-jsdoc`.
5958
| [`require-param-name`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-name) | N/A |
6059
| [`require-param-type`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-type) | [`requireParamTypes`](https://github.com/jscs-dev/jscs-jsdoc#requireparamtypes) |
6160
| [`require-returns`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns) | [`requireReturn`](https://github.com/jscs-dev/jscs-jsdoc#requirereturn) |
62-
| [`require-returns-check`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-check) | [`requireReturn`](https://github.com/jscs-dev/jscs-jsdoc#requirereturncheck) |
6361
| [`require-returns-description`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-description) | [`requireReturnDescription`](https://github.com/jscs-dev/jscs-jsdoc#requirereturndescription) |
6462
| [`require-returns-type`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-returns-type) | [`requireReturnTypes`](https://github.com/jscs-dev/jscs-jsdoc#requirereturntypes) |
6563
| [`valid-types`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-valid-types) | N/A |
@@ -119,7 +117,6 @@ Finally, enable all of the rules that you would like to use.
119117
"jsdoc/require-param-name": 1,
120118
"jsdoc/require-param-type": 1,
121119
"jsdoc/require-returns": 1,
122-
"jsdoc/require-returns-check": 1,
123120
"jsdoc/require-returns-description": 1,
124121
"jsdoc/require-returns-type": 1,
125122
"jsdoc/valid-types": 1
@@ -379,7 +376,7 @@ function quux () {
379376

380377
}
381378
// Settings: {"jsdoc":{"baseConfig":{"rules":{"no-undef":["error"]}},"eslintrcForExamples":false,"noDefaultExampleRules":true}}
382-
// Message: @example error (no-undef): 'quux' is not defined.
379+
// Message: @example error (semi): Extra semicolon.
383380

384381
/**
385382
* @example <caption>Valid usage</caption>
@@ -2200,10 +2197,10 @@ function quux () {
22002197
````
22012198

22022199

2203-
<a name="eslint-plugin-jsdoc-rules-require-returns-check"></a>
2204-
### <code>require-returns-check</code>
2200+
<a name="eslint-plugin-jsdoc-rules-require-returns"></a>
2201+
### <code>require-returns</code>
22052202

2206-
Check if exist return expression in function and in comment. Need exist both.
2203+
Requires returns are documented.
22072204

22082205
|||
22092206
|---|---|
@@ -2214,106 +2211,302 @@ The following patterns are considered problems:
22142211

22152212
````js
22162213
/**
2217-
* @returns
2214+
*
22182215
*/
22192216
function quux (foo) {
22202217

22212218
}
2222-
// Message: Present JSDoc @returns declaration but not available return expression in function.
2219+
// Message: Missing JSDoc @param "foo" declaration.
22232220

22242221
/**
2225-
* @return
2222+
*
22262223
*/
22272224
function quux (foo) {
22282225

22292226
}
2230-
// Settings: {"jsdoc":{"tagNamePreference":{"returns":"return"}}}
2231-
// Message: Present JSDoc @return declaration but not available return expression in function.
2227+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
2228+
// Message: Missing JSDoc @arg "foo" declaration.
2229+
2230+
/**
2231+
* @param foo
2232+
*/
2233+
function quux (foo, bar) {
2234+
2235+
}
2236+
// Message: Missing JSDoc @param "bar" declaration.
2237+
2238+
/**
2239+
* @override
2240+
*/
2241+
function quux (foo) {
2242+
2243+
}
2244+
// Message: Missing JSDoc @param "foo" declaration.
2245+
2246+
/**
2247+
* @implements
2248+
*/
2249+
function quux (foo) {
2250+
2251+
}
2252+
// Message: Missing JSDoc @param "foo" declaration.
2253+
2254+
/**
2255+
* @augments
2256+
*/
2257+
function quux (foo) {
2258+
2259+
}
2260+
// Message: Missing JSDoc @param "foo" declaration.
2261+
2262+
/**
2263+
* @extends
2264+
*/
2265+
function quux (foo) {
2266+
2267+
}
2268+
// Message: Missing JSDoc @param "foo" declaration.
2269+
2270+
/**
2271+
* @override
2272+
*/
2273+
class A {
2274+
/**
2275+
*
2276+
*/
2277+
quux (foo) {
2278+
2279+
}
2280+
}
2281+
// Message: Missing JSDoc @param "foo" declaration.
2282+
2283+
/**
2284+
* @implements
2285+
*/
2286+
class A {
2287+
/**
2288+
*
2289+
*/
2290+
quux (foo) {
2291+
2292+
}
2293+
}
2294+
// Message: Missing JSDoc @param "foo" declaration.
2295+
2296+
/**
2297+
* @augments
2298+
*/
2299+
class A {
2300+
/**
2301+
*
2302+
*/
2303+
quux (foo) {
2304+
2305+
}
2306+
}
2307+
// Message: Missing JSDoc @param "foo" declaration.
2308+
2309+
/**
2310+
* @extends
2311+
*/
2312+
class A {
2313+
/**
2314+
*
2315+
*/
2316+
quux (foo) {
2317+
2318+
}
2319+
}
2320+
// Message: Missing JSDoc @param "foo" declaration.
22322321
````
22332322

22342323
The following patterns are not considered problems:
22352324

22362325
````js
22372326
/**
2238-
* @returns Foo.
2327+
* @param foo
22392328
*/
2240-
function quux () {
2329+
function quux (foo) {
22412330

2242-
return foo;
22432331
}
22442332

22452333
/**
2246-
* @returns {void} Foo.
2334+
* @inheritdoc
22472335
*/
2248-
function quux () {
2336+
function quux (foo) {
22492337

2250-
return foo;
22512338
}
22522339

22532340
/**
2254-
* @returns {undefined} Foo.
2341+
* @arg foo
22552342
*/
2256-
function quux () {
2343+
function quux (foo) {
22572344

2258-
return foo;
22592345
}
2346+
// Settings: {"jsdoc":{"tagNamePreference":{"param":"arg"}}}
22602347

22612348
/**
2262-
*
2349+
* @override
2350+
* @param foo
22632351
*/
2264-
function quux () {
2352+
function quux (foo) {
2353+
22652354
}
2266-
````
22672355

2356+
/**
2357+
* @override
2358+
*/
2359+
function quux (foo) {
22682360

2269-
<a name="eslint-plugin-jsdoc-rules-require-returns"></a>
2270-
### <code>require-returns</code>
2361+
}
2362+
// Settings: {"jsdoc":{"allowOverrideWithoutParam":true}}
22712363

2272-
Requires returns are documented.
2364+
/**
2365+
* @implements
2366+
*/
2367+
function quux (foo) {
22732368

2274-
|||
2275-
|---|---|
2276-
|Context|`ArrowFunctionExpression`, `FunctionDeclaration`, `FunctionExpression`|
2277-
|Tags|`returns`|
2369+
}
2370+
// Settings: {"jsdoc":{"allowImplementsWithoutParam":true}}
22782371

2279-
The following patterns are considered problems:
2372+
/**
2373+
* @implements
2374+
* @param foo
2375+
*/
2376+
function quux (foo) {
2377+
2378+
}
22802379

2281-
````js
22822380
/**
2283-
*
2381+
* @augments
22842382
*/
22852383
function quux (foo) {
22862384

2287-
return foo;
22882385
}
2289-
// Message: Missing JSDoc @returns declaration.
2386+
// Settings: {"jsdoc":{"allowAugmentsExtendsWithoutParam":true}}
22902387

22912388
/**
2292-
*
2389+
* @augments
2390+
* @param foo
22932391
*/
22942392
function quux (foo) {
22952393

2296-
return foo;
22972394
}
2298-
// Settings: {"jsdoc":{"tagNamePreference":{"returns":"return"}}}
2299-
// Message: Missing JSDoc @return declaration.
2300-
````
23012395

2302-
The following patterns are not considered problems:
2396+
/**
2397+
* @extends
2398+
*/
2399+
function quux (foo) {
2400+
2401+
}
2402+
// Settings: {"jsdoc":{"allowAugmentsExtendsWithoutParam":true}}
23032403

2304-
````js
23052404
/**
2306-
* @returns Foo.
2405+
* @extends
2406+
* @param foo
23072407
*/
2308-
function quux () {
2408+
function quux (foo) {
23092409

2310-
return foo;
23112410
}
23122411

23132412
/**
2314-
*
2413+
* @override
23152414
*/
2316-
function quux () {
2415+
class A {
2416+
/**
2417+
* @param foo
2418+
*/
2419+
quux (foo) {
2420+
2421+
}
2422+
}
2423+
2424+
/**
2425+
* @override
2426+
*/
2427+
class A {
2428+
/**
2429+
*
2430+
*/
2431+
quux (foo) {
2432+
2433+
}
2434+
}
2435+
// Settings: {"jsdoc":{"allowOverrideWithoutParam":true}}
2436+
2437+
/**
2438+
* @implements
2439+
*/
2440+
class A {
2441+
/**
2442+
*
2443+
*/
2444+
quux (foo) {
2445+
2446+
}
2447+
}
2448+
// Settings: {"jsdoc":{"allowImplementsWithoutParam":true}}
2449+
2450+
/**
2451+
* @implements
2452+
*/
2453+
class A {
2454+
/**
2455+
* @param foo
2456+
*/
2457+
quux (foo) {
2458+
2459+
}
2460+
}
2461+
2462+
/**
2463+
* @augments
2464+
*/
2465+
class A {
2466+
/**
2467+
*
2468+
*/
2469+
quux (foo) {
2470+
2471+
}
2472+
}
2473+
// Settings: {"jsdoc":{"allowAugmentsExtendsWithoutParam":true}}
2474+
2475+
/**
2476+
* @augments
2477+
*/
2478+
class A {
2479+
/**
2480+
* @param foo
2481+
*/
2482+
quux (foo) {
2483+
2484+
}
2485+
}
2486+
2487+
/**
2488+
* @extends
2489+
*/
2490+
class A {
2491+
/**
2492+
*
2493+
*/
2494+
quux (foo) {
2495+
2496+
}
2497+
}
2498+
// Settings: {"jsdoc":{"allowAugmentsExtendsWithoutParam":true}}
2499+
2500+
/**
2501+
* @extends
2502+
*/
2503+
class A {
2504+
/**
2505+
* @param foo
2506+
*/
2507+
quux (foo) {
2508+
2509+
}
23172510
}
23182511
````
23192512

@@ -2365,4 +2558,3 @@ function quux() {
23652558
}
23662559
````
23672560

2368-

0 commit comments

Comments
 (0)