Skip to content

Commit

Permalink
chore: update comment-parser; should now cause fixers to preserve ori…
Browse files Browse the repository at this point in the history
…ginal whitespace unless the rule is meant to fix it

BREAKING CHANGE:

Tests are not breaking, but as changing the fundamental parser, forcing major bump to be safe.

Also updates:
1. `require-description-complete-sentence` - test to fix output
2. `require-hyphen-before-param-description` - test to preserve whitespace in fixed output (though still minus hyphen)
3. `require-param` - test preserving whitespace
4 `require-jsdoc` - test with no indent
  • Loading branch information
brettz9 authored and Brett Zamir committed Jan 11, 2021
1 parent 2577f66 commit 095ff36
Show file tree
Hide file tree
Showing 28 changed files with 487 additions and 300 deletions.
59 changes: 32 additions & 27 deletions README.md
Expand Up @@ -9684,6 +9684,11 @@ Defaults to `true`.
The following patterns are considered problems:
````js
function quux (foo) {
}
// Message: Missing JSDoc comment.
/**
* @func myFunction
*/
Expand Down Expand Up @@ -12171,74 +12176,74 @@ let TestFunction: (id) => void;
// Message: Missing JSDoc @param "id" declaration.

/**
* A test function.
*/
* A test function.
*/
function test(
processor: (id: number) => string
processor: (id: number) => string
) {
return processor(10);
return processor(10);
}
// Options: [{"contexts":["TSFunctionType"]}]
// Message: Missing JSDoc @param "id" declaration.

/**
* A test function.
*/
* A test function.
*/
let test = (processor: (id: number) => string) =>
{
return processor(10);
return processor(10);
}
// Options: [{"contexts":["TSFunctionType"]}]
// Message: Missing JSDoc @param "id" declaration.

class TestClass {
/**
* A class property.
*/
public Test: (id: number) => string;
/**
* A class property.
*/
public Test: (id: number) => string;
}
// Options: [{"contexts":["TSFunctionType"]}]
// Message: Missing JSDoc @param "id" declaration.

class TestClass {
/**
* A class method.
*/
public TestMethod(): (id: number) => string
{
}
/**
* A class method.
*/
public TestMethod(): (id: number) => string
{
}
}
// Options: [{"contexts":["TSFunctionType"]}]
// Message: Missing JSDoc @param "id" declaration.

interface TestInterface {
/**
* An interface property.
*/
* An interface property.
*/
public Test: (id: number) => string;
}
// Options: [{"contexts":["TSFunctionType"]}]
// Message: Missing JSDoc @param "id" declaration.

interface TestInterface {
/**
* An interface method.
*/
public TestMethod(): (id: number) => string;
/**
* An interface method.
*/
public TestMethod(): (id: number) => string;
}
// Options: [{"contexts":["TSFunctionType"]}]
// Message: Missing JSDoc @param "id" declaration.

/**
* A function with return type
*/
* A function with return type
*/
function test(): (id: number) => string;
// Options: [{"contexts":["TSFunctionType"]}]
// Message: Missing JSDoc @param "id" declaration.

/**
* A function with return type
*/
* A function with return type
*/
let test = (): (id: number) => string =>
{
return (id) => `${id}`;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -5,7 +5,7 @@
"url": "http://gajus.com"
},
"dependencies": {
"comment-parser": "^0.7.6",
"comment-parser": "1.0.1",
"debug": "^4.3.1",
"jsdoctypeparser": "^9.0.0",
"lodash": "^4.17.20",
Expand Down

0 comments on commit 095ff36

Please sign in to comment.