Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3abeb85

Browse files
committed
test: add erring check for exemptOverloadedImplementations: true
1 parent f56b697 commit 3abeb85

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

‎docs/rules/require-jsdoc.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,16 @@ function myFunction(): void;
11031103
function myFunction(foo?: string) {}
11041104
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSDeclareFunction"],"exemptOverloadedImplementations":false,"skipInterveningOverloadedDeclarations":false}]
11051105
// Message: Missing JSDoc comment.
1106+
1107+
/**
1108+
* Test function with param.
1109+
* @param foo - Test param.
1110+
*/
1111+
function myFunction(foo: string): void;
1112+
function myFunction(): void;
1113+
function myFunction(foo?: string) {}
1114+
// "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["TSDeclareFunction"],"exemptOverloadedImplementations":true,"skipInterveningOverloadedDeclarations":false}]
1115+
// Message: Missing JSDoc comment.
11061116
````
11071117

11081118

‎test/rules/assertions/requireJsdoc.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4431,6 +4431,47 @@ function quux (foo) {
44314431
function myFunction(foo?: string) {}
44324432
`,
44334433
},
4434+
{
4435+
code: `
4436+
/**
4437+
* Test function with param.
4438+
* @param foo - Test param.
4439+
*/
4440+
function myFunction(foo: string): void;
4441+
function myFunction(): void;
4442+
function myFunction(foo?: string) {}
4443+
`,
4444+
errors: [
4445+
{
4446+
line: 7,
4447+
message: 'Missing JSDoc comment.',
4448+
},
4449+
],
4450+
languageOptions: {
4451+
parser: typescriptEslintParser,
4452+
},
4453+
options: [
4454+
{
4455+
contexts: [
4456+
'TSDeclareFunction',
4457+
],
4458+
exemptOverloadedImplementations: true,
4459+
skipInterveningOverloadedDeclarations: false,
4460+
},
4461+
],
4462+
output: `
4463+
/**
4464+
* Test function with param.
4465+
* @param foo - Test param.
4466+
*/
4467+
function myFunction(foo: string): void;
4468+
/**
4469+
*
4470+
*/
4471+
function myFunction(): void;
4472+
function myFunction(foo?: string) {}
4473+
`,
4474+
},
44344475
],
44354476
valid: [
44364477
{

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /