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

📝 Added eslint-plugin-jsdoc and fixed errors #133

Merged
merged 17 commits into from
May 27, 2022
Merged

Conversation

arimgibson
Copy link
Contributor

@arimgibson arimgibson commented May 26, 2022

Closes #132

  • Added eslint-plugin-jsdoc
  • Configured eslint to use plugin
  • Changed plugin rules as needed
  • Fixed warnings thrown by plugin

@arimgibson arimgibson added dependencies Pull requests that update a dependency file Chore labels May 26, 2022
@arimgibson arimgibson self-assigned this May 26, 2022
@vercel
Copy link

vercel bot commented May 26, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
essential-eth ✅ Ready (Inspect) Visit Preview May 27, 2022 at 8:39PM (UTC)

@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #133 (3d53420) into master (6126618) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #133      +/-   ##
==========================================
- Coverage   86.19%   86.17%   -0.02%     
==========================================
  Files          38       38              
  Lines         927      926       -1     
  Branches      265      265              
==========================================
- Hits          799      798       -1     
  Misses        113      113              
  Partials       15       15              
Impacted Files Coverage Δ
src/classes/Contract.ts 100.00% <ø> (ø)
src/classes/utils/clean-block.ts 100.00% <ø> (ø)
src/classes/utils/clean-log.ts 95.23% <ø> (ø)
src/classes/utils/clean-transaction-receipt.ts 86.20% <ø> (ø)
src/classes/utils/clean-transaction.ts 100.00% <ø> (ø)
src/classes/utils/encode-decode-transaction.ts 93.75% <ø> (ø)
src/classes/utils/fetchers.ts 93.33% <ø> (ø)
src/classes/utils/hex-to-decimal.ts 100.00% <ø> (ø)
src/providers/JsonRpcProvider.ts 100.00% <ø> (ø)
src/shared/tiny-big/helpers.ts 97.67% <ø> (ø)
... and 17 more

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 6126618...3d53420. Read the comment docs.

@arimgibson
Copy link
Contributor Author

@dawsbot I got lost trying to document these last ones because they deal with contracts. Leaving these last ones for you; besides those, I think this is merge ready.

C:\coding\essential-eth\src\classes\Contract.ts
   10:1  warning  Missing JSDoc @param "txnData" description  jsdoc/require-param-description
   11:1  warning  Missing JSDoc @example description          jsdoc/require-example
   35:1  warning  Missing JSDoc @example description          jsdoc/require-example
  101:1  warning  Missing JSDoc @param "object" description   jsdoc/require-param-description
  102:1  warning  Missing JSDoc @param "name" description     jsdoc/require-param-description
  103:1  warning  Missing JSDoc @param "value" description    jsdoc/require-param-description
  104:1  warning  Missing JSDoc @example description          jsdoc/require-example

C:\coding\essential-eth\src\classes\utils\encode-decode-transaction.ts
   30:1  warning  Missing JSDoc @returns declaration                  jsdoc/require-returns
   32:1  warning  Missing JSDoc @param "jsonABIArgument" description  jsdoc/require-param-description
   33:1  warning  Missing JSDoc @param "args" description             jsdoc/require-param-description
   34:1  warning  Missing JSDoc @example description                  jsdoc/require-example
  113:1  warning  Missing JSDoc @returns declaration                  jsdoc/require-returns
  115:1  warning  Missing JSDoc @param "jsonABIArgument" description  jsdoc/require-param-description
  116:1  warning  Missing JSDoc @param "nodeResponse" description     jsdoc/require-param-description
  117:1  warning  Missing JSDoc @example description                  jsdoc/require-example

*
* @param jsonABIArgument
* @param args
* @example
Copy link
Owner

@dawsbot dawsbot May 27, 2022

Choose a reason for hiding this comment

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

Is this empty "@example" statement intentional? Seems like it was thrown in to skip a warning from the eslint rule, but we do want examples for everything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That'll still throw an error actually (jsdoc/require-example). The empty is added through eslint --fix using the JSDoc plugin

@@ -15,6 +27,12 @@ function expandType(type: ContractTypes) {
}
return type;
}
/**
*
* @param jsonABIArgument
Copy link
Owner

Choose a reason for hiding this comment

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

We don't need @param lines like this because TS automatically documents these by the function definition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#133 (comment)

Also added through eslint --fix but still throws warning until the description is added (jsdoc/require-description)

@dawsbot dawsbot marked this pull request as ready for review May 27, 2022 20:38
@dawsbot dawsbot merged commit 678ceac into master May 27, 2022
@dawsbot dawsbot deleted the feature/jsdoc branch May 27, 2022 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add eslint-plugin-jsdoc to standardize documentation
2 participants