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

Add JSDoc plugin #286

Merged
merged 1 commit into from Jan 20, 2018
Merged

Add JSDoc plugin #286

merged 1 commit into from Jan 20, 2018

Conversation

pvdlg
Copy link
Contributor

@pvdlg pvdlg commented Jan 20, 2018

Related xojs/eslint-config-xo#45

Fix #282

I added the plugin and rules suggested in #282. I didn't add the --jsdoc option for the reasons explained in this comment:

As the valid-jsdoc rule is used when a JSDoc bloc is defined, in the end the jsdoc flag would just enable the require-jsdoc rule forcing to write JSDoc for every declaration in the code.

Enforcing 100% JSDoc is not really something very common from what I see in the open source community (AFAIK ESLint is the only major project with near 100% JSDoc coverage).

In addition, it would be difficult to find the best default config for the rule. Some might want a warning, some an error. Some might want a JSDoc block for function expression and declaration, some for declaration only etc...

So I'm not sure adding a flag is justified for a case that is not really common, and requires additional config anyway. It's probably better to just set the rule in XO:

{
  "xo": {
    "rules": {"require-jsdoc": ["warn", {...}]}
  }
}

@sindresorhus if you think the --jsdoc flag makes sense I can add it. Not sure what the require-jsdoc options would be though.

@sindresorhus
Copy link
Member

if you think the --jsdoc flag makes sense I can add it. Not sure what the require-jsdoc options would be though.

No, I agree with you. We should not add it.

@pvdlg
Copy link
Contributor Author

pvdlg commented Jan 20, 2018

Just rebased. As we won't add the --jsdoc flag it should be good to go

@sindresorhus sindresorhus changed the title Add JSdoc plugin Add JSDoc plugin Jan 20, 2018
@sindresorhus sindresorhus merged commit c1f1be6 into xojs:master Jan 20, 2018
@pvdlg pvdlg deleted the jsdoc branch January 20, 2018 23:17
pvdlg added a commit to pvdlg/xo that referenced this pull request Jan 29, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants