Skip to content

Commit

Permalink
fix(require-param): update comment-parser to surface fix for aste…
Browse files Browse the repository at this point in the history
…risk followed immediately by non-space; add test; fixes #443
  • Loading branch information
brettz9 committed Dec 4, 2019
1 parent d6ccd45 commit dd5f015
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
27 changes: 27 additions & 0 deletions README.md
Expand Up @@ -7928,6 +7928,33 @@ export class SomeClass {
function assign({name, department}) {
// ...
}
export abstract class StephanPlugin<O, D> {
/**
* Called right after Stephan loads the plugin file.
*
* @example
*```typescript
* type Options = {
* verbose?: boolean;
* token?: string;
* }
* ```
*
* Note that your Options type should only have optional properties...
*
* @param args Arguments compiled and provided by StephanClient.
* @param args.options The options as provided by the user, or an empty object if not provided.
* @param defaultOptions The default options as provided by the plugin, or an empty object.
*/
public constructor({options, client}: {
options: O;
client: unknown;
}, defaultOptions: D) {
}
}
````
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.0",
"comment-parser": "^0.7.1",
"debug": "^4.1.1",
"jsdoctypeparser": "^6.1.0",
"lodash": "^4.17.15",
Expand Down
31 changes: 31 additions & 0 deletions test/rules/assertions/requireParam.js
Expand Up @@ -982,5 +982,36 @@ export default {
}
`,
},
{
code: `
export abstract class StephanPlugin<O, D> {
/**
* Called right after Stephan loads the plugin file.
*
* @example
*\`\`\`typescript
* type Options = {
* verbose?: boolean;
* token?: string;
* }
* \`\`\`
*
* Note that your Options type should only have optional properties...
*
* @param args Arguments compiled and provided by StephanClient.
* @param args.options The options as provided by the user, or an empty object if not provided.
* @param defaultOptions The default options as provided by the plugin, or an empty object.
*/
public constructor({options, client}: {
options: O;
client: unknown;
}, defaultOptions: D) {
}
}
`,
parser: require.resolve('@typescript-eslint/parser'),
},
],
};

0 comments on commit dd5f015

Please sign in to comment.