Skip to content

Commit e574964

Browse files
authored
chore: clean up extra * in TSDoc comments (#13336)
1 parent e21c5ab commit e574964

File tree

5 files changed

+70
-25
lines changed

5 files changed

+70
-25
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ module.exports = {
333333
parserOptions: {
334334
sourceType: 'module',
335335
},
336-
plugins: ['import'],
336+
plugins: ['import', 'jsdoc'],
337337
rules: {
338338
'accessor-pairs': ['warn', {setWithoutGet: true}],
339339
'block-scoped-var': 'off',
@@ -390,6 +390,7 @@ module.exports = {
390390
},
391391
],
392392
'init-declarations': 'off',
393+
'jsdoc/check-alignment': 'error',
393394
'lines-around-comment': 'off',
394395
'max-depth': 'off',
395396
'max-nested-callbacks': 'off',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"eslint-plugin-eslint-comments": "^3.1.2",
3939
"eslint-plugin-import": "^2.6.0",
4040
"eslint-plugin-jest": "^26.1.0",
41+
"eslint-plugin-jsdoc": "^39.3.6",
4142
"eslint-plugin-local": "^1.0.0",
4243
"eslint-plugin-markdown": "^3.0.0",
4344
"eslint-plugin-prettier": "^4.0.0",

packages/jest-environment/src/index.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -184,27 +184,27 @@ export interface Jest {
184184
options?: {virtual?: boolean},
185185
): Jest;
186186
/**
187-
* Returns the actual module instead of a mock, bypassing all checks on
188-
* whether the module should receive a mock implementation or not.
189-
*
190-
* @example
191-
```js
192-
jest.mock('../myModule', () => {
193-
// Require the original module to not be mocked...
194-
const originalModule = jest.requireActual('../myModule');
195-
196-
return {
197-
__esModule: true, // Use it when dealing with esModules
198-
...originalModule,
199-
getRandom: jest.fn().mockReturnValue(10),
200-
};
201-
});
202-
203-
const getRandom = require('../myModule').getRandom;
204-
205-
getRandom(); // Always returns 10
206-
```
207-
*/
187+
* Returns the actual module instead of a mock, bypassing all checks on
188+
* whether the module should receive a mock implementation or not.
189+
*
190+
* @example
191+
* ```js
192+
* jest.mock('../myModule', () => {
193+
* // Require the original module to not be mocked...
194+
* const originalModule = jest.requireActual('../myModule');
195+
*
196+
* return {
197+
* __esModule: true, // Use it when dealing with esModules
198+
* ...originalModule,
199+
* getRandom: jest.fn().mockReturnValue(10),
200+
* };
201+
* });
202+
*
203+
* const getRandom = require('../myModule').getRandom;
204+
*
205+
* getRandom(); // Always returns 10
206+
* ```
207+
*/
208208
requireActual<T = unknown>(moduleName: string): T;
209209
/**
210210
* Wraps types of the `source` object and its deep members with type definitions

packages/jest-types/src/Config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export type GlobalFakeTimersConfig = {
3535
*
3636
* @defaultValue
3737
* The default is `false`.
38-
* */
38+
*/
3939
enableGlobally?: boolean;
4040
};
4141

@@ -55,7 +55,7 @@ export type FakeTimersConfig = {
5555
*
5656
* @defaultValue
5757
* The default is `[]`, meaning all APIs are faked.
58-
* */
58+
*/
5959
doNotFake?: Array<FakeableAPI>;
6060
/**
6161
* Sets current system time to be used by fake timers.

yarn.lock

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2485,6 +2485,17 @@ __metadata:
24852485
languageName: node
24862486
linkType: hard
24872487

2488+
"@es-joy/jsdoccomment@npm:~0.31.0":
2489+
version: 0.31.0
2490+
resolution: "@es-joy/jsdoccomment@npm:0.31.0"
2491+
dependencies:
2492+
comment-parser: 1.3.1
2493+
esquery: ^1.4.0
2494+
jsdoc-type-pratt-parser: ~3.1.0
2495+
checksum: 1691ff501559f45593e5f080d2c08dea4fadba5f48e526b9ff2943c050fbb40408f5e83968542e5b6bf47219c7573796d00bfe80dacfd1ba8187904cc475cefb
2496+
languageName: node
2497+
linkType: hard
2498+
24882499
"@eslint/eslintrc@npm:^1.3.0":
24892500
version: 1.3.0
24902501
resolution: "@eslint/eslintrc@npm:1.3.0"
@@ -2766,6 +2777,7 @@ __metadata:
27662777
eslint-plugin-eslint-comments: ^3.1.2
27672778
eslint-plugin-import: ^2.6.0
27682779
eslint-plugin-jest: ^26.1.0
2780+
eslint-plugin-jsdoc: ^39.3.6
27692781
eslint-plugin-local: ^1.0.0
27702782
eslint-plugin-markdown: ^3.0.0
27712783
eslint-plugin-prettier: ^4.0.0
@@ -7284,6 +7296,13 @@ __metadata:
72847296
languageName: node
72857297
linkType: hard
72867298

7299+
"comment-parser@npm:1.3.1":
7300+
version: 1.3.1
7301+
resolution: "comment-parser@npm:1.3.1"
7302+
checksum: 421e6a113a3afd548500e7174ab46a2049dccf92e82bbaa3b209031b1bdf97552aabfa1ae2a120c0b62df17e1ba70e0d8b05d68504fee78e1ef974c59bcfe718
7303+
languageName: node
7304+
linkType: hard
7305+
72877306
"common-tags@npm:^1.8.0":
72887307
version: 1.8.2
72897308
resolution: "common-tags@npm:1.8.2"
@@ -9099,6 +9118,23 @@ __metadata:
90999118
languageName: node
91009119
linkType: hard
91019120

9121+
"eslint-plugin-jsdoc@npm:^39.3.6":
9122+
version: 39.3.6
9123+
resolution: "eslint-plugin-jsdoc@npm:39.3.6"
9124+
dependencies:
9125+
"@es-joy/jsdoccomment": ~0.31.0
9126+
comment-parser: 1.3.1
9127+
debug: ^4.3.4
9128+
escape-string-regexp: ^4.0.0
9129+
esquery: ^1.4.0
9130+
semver: ^7.3.7
9131+
spdx-expression-parse: ^3.0.1
9132+
peerDependencies:
9133+
eslint: ^7.0.0 || ^8.0.0
9134+
checksum: 0825a5eba6cdcb250e45cd5ad488bd234da346f324a11160ad4b8c9fb3c76d8e1457d462fa91c24f11bdff5ef0013375d65c366b648202254c4bcc79eed89060
9135+
languageName: node
9136+
linkType: hard
9137+
91029138
"eslint-plugin-local@npm:^1.0.0":
91039139
version: 1.0.0
91049140
resolution: "eslint-plugin-local@npm:1.0.0"
@@ -13155,6 +13191,13 @@ __metadata:
1315513191
languageName: node
1315613192
linkType: hard
1315713193

13194+
"jsdoc-type-pratt-parser@npm:~3.1.0":
13195+
version: 3.1.0
13196+
resolution: "jsdoc-type-pratt-parser@npm:3.1.0"
13197+
checksum: 2f437b57621f1e481918165f6cf0e48256628a9e510d8b3f88a2ab667bf2128bf8b94c628b57c43e78f555ca61983e9c282814703840dc091d2623992214a061
13198+
languageName: node
13199+
linkType: hard
13200+
1315813201
"jsdom@npm:^20.0.0":
1315913202
version: 20.0.0
1316013203
resolution: "jsdom@npm:20.0.0"
@@ -19075,7 +19118,7 @@ __metadata:
1907519118
languageName: node
1907619119
linkType: hard
1907719120

19078-
"spdx-expression-parse@npm:^3.0.0":
19121+
"spdx-expression-parse@npm:^3.0.0, spdx-expression-parse@npm:^3.0.1":
1907919122
version: 3.0.1
1908019123
resolution: "spdx-expression-parse@npm:3.0.1"
1908119124
dependencies:

0 commit comments

Comments
 (0)