Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSDoc should not have types #7

Closed
fregante opened this issue Feb 5, 2019 · 1 comment
Closed

JSDoc should not have types #7

fregante opened this issue Feb 5, 2019 · 1 comment

Comments

@fregante
Copy link
Member

fregante commented Feb 5, 2019

JSDoc types are duplicate in TypeScript:

https://github.com/bfred-it/webext-options-sync/blob/93eafd4b6607090dca7cc9482a147c88748d340c/index.d.ts#L87-L90 (from https://github.com/bfred-it/webext-options-sync/pull/15/files)

Ideally it would support TSDoc but disabling types would be a step forward.

Settings: https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-types

@EdJoPaTo
Copy link

EdJoPaTo commented Feb 5, 2019

The current xo rules are requiring types. This is good for JavaScript Documentation but bad for TypeScript documentation.
The eslint built in valid-jsdoc has requireParamType and requireReturnType. They could be set to false (in the typescript ruleset) but they don't enforce something.

As ESLint drops support for JSDoc rules (see xojs/xo#378) the suggested eslint-plugin-jsdoc rules will be better.

Also I have a simple example of the current warnings with xo:

/**
 * Does foobar things
 *
 * @param  bar <docs>
 * @return <docs>
 */
function foo(bar: string): string {
  return bar
}
  ⚠    1:1   Missing JSDoc return type.            valid-jsdoc
  ⚠    4:4   Missing JSDoc parameter type for bar. valid-jsdoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants