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 to linting rules #223

Merged
merged 5 commits into from Dec 19, 2017
Merged

Add jsdoc to linting rules #223

merged 5 commits into from Dec 19, 2017

Conversation

evansiroky
Copy link
Contributor

I'm proposing to add this rule to help us better document our javascript code. This PR proposes to add the eslint rule require-jsdoc and thus require docstrings in the following places:

  • FunctionDeclaration
  • MethodDefinition
  • ClassDeclaration

I could also include arrow functions, but I figured that'd be excessive.

As you'll notice, a lot of the functions in mastarm remain undocumented and pass the linting test because of the this issue with the require-jsdoc. It's on their roadmap to fix, but that hasn't happened yet.

If we really wanted to go all out on jsdoc, we could also add the valid-jsdoc rule which would force us to do things like annote every param in function arguments. I left that out for now and propose this as a first step.

@codecov-io
Copy link

codecov-io commented Sep 28, 2017

Codecov Report

Merging #223 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #223   +/-   ##
=======================================
  Coverage   66.22%   66.22%           
=======================================
  Files          18       18           
  Lines         450      450           
  Branches       87       87           
=======================================
  Hits          298      298           
  Misses        131      131           
  Partials       21       21
Impacted Files Coverage Δ
lib/prepublish.js 100% <ø> (ø) ⬆️
lib/js-transform.js 68.96% <ø> (ø) ⬆️
lib/lint-messages.js 90.74% <ø> (ø) ⬆️
lib/css-transform.js 87.27% <ø> (ø) ⬆️
lib/load-config.js 86.95% <ø> (ø) ⬆️
lib/logger.js 42.85% <ø> (ø) ⬆️
lib/push-to-s3.js 75.86% <ø> (ø) ⬆️
lib/util.js 43.13% <ø> (ø) ⬆️
lib/flyle.js 0% <ø> (ø) ⬆️
lib/browserify.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42a37e2...6ffc8e3. Read the comment docs.

The production snapshot needs to change because the source map differs.
@trevorgerhardt
Copy link
Member

We talked about this offline. I am pretty against this. We don't need JSDoc level documentation in our application repositories. Flow takes care of parameter definitions and return values. Having a simple "commenting on functions" lint rule sounds ideal until it fails hundreds/thousands of times in our application repos.

@evansiroky
Copy link
Contributor Author

Maybe we can compromise by agreeing to not approve pull requests that don't add or update comments in the affected area of code?

Copy link
Member

@trevorgerhardt trevorgerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evansiroky let's switch it to warnings and then I'll approve 👌

@trevorgerhardt trevorgerhardt merged commit 4007c87 into dev Dec 19, 2017
@trevorgerhardt trevorgerhardt deleted the jsdoc-lint branch December 19, 2017 22:42
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

3 participants