Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.

Add ESLint JSDoc rules. - #206

Merged
Gudahtt merged 1 commit into
mainfrom
add-eslint-jsdoc-linting
Sep 15, 2021
Merged

Gudahtt merged 1 commit into
mainfrom
add-eslint-jsdoc-linting

Conversation

@Gudahtt

@Gudahtt Gudahtt commented Sep 15, 2021 •

Copy link
Copy Markdown
Member

ESLint rules have been added to enforce our JSDoc conventions. The rules have been added directly to .eslintrc.js temporarily until they get published in our main ESLint config.

Most of the changes in this PR were a result of running yarn lint:fix. There were a handful of manual changes that seemed obvious and simple to make.

There were a few minor variable renames made as well, to make the code and comments easier to read.

ESLint rules have been added to enforce our JSDoc conventions. The
rules have been added directly to `.eslintrc.js` temporarily until they
get published in our main ESLint config.

Most of the changes in this PR were a result of running
`yarn lint:fix`. There were a handful of manual changes that seemed
obvious and simple to make.

There were a few minor variable renames made as well, to make the code
and comments easier to read.
@Gudahtt
Gudahtt force-pushed the add-eslint-jsdoc-linting branch from 4414547 to 6adb060 Compare September 15, 2021 05:47
Gudahtt added a commit to MetaMask/eslint-config that referenced this pull request Sep 15, 2021
ESLint rules for JSDoc have been added to the base package and to the
TypeScript package, using the `eslint-plugin-jsdoc` plugin. These rules
should help improve the quality of our inline documentation.

This was done primarily to prepare for the generation of HTML
documentation using TypeDoc. Our inline documentation needs to be of a
higher quality than it is now for that to work out well.

These rules have been tested with `metamask-extension` [1],
`@metamask/controllers` [2], and `@metamask/eth-sig-util` [3]. See
those draft PRs to get an idea of what these rules look like in
practice.

[1]: MetaMask/metamask-extension#12112
[2]: MetaMask/core#591
[3]: MetaMask/eth-sig-util#206
@Gudahtt
Gudahtt marked this pull request as ready for review September 15, 2021 06:21
@Gudahtt
Gudahtt requested a review from a team as a code owner September 15, 2021 06:21
Gudahtt added a commit to MetaMask/eslint-config that referenced this pull request Sep 15, 2021
ESLint rules for JSDoc have been added to the base package and to the
TypeScript package, using the `eslint-plugin-jsdoc` plugin. These rules
should help improve the quality of our inline documentation.

This was done primarily to prepare for the generation of HTML
documentation using TypeDoc. Our inline documentation needs to be of a
higher quality than it is now for that to work out well.

These rules have been tested with `metamask-extension` [1],
`@metamask/controllers` [2], and `@metamask/eth-sig-util` [3]. See
those draft PRs to get an idea of what these rules look like in
practice.

[1]: MetaMask/metamask-extension#12112
[2]: MetaMask/core#591
[3]: MetaMask/eth-sig-util#206

@mcmire mcmire left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Makes sense to me!

@Gudahtt
Gudahtt merged commit 6571e30 into main Sep 15, 2021
@Gudahtt
Gudahtt deleted the add-eslint-jsdoc-linting branch September 15, 2021 16:44
Gudahtt added a commit to MetaMask/eslint-config that referenced this pull request Sep 21, 2021
* Add JSDoc ESLint rules

ESLint rules for JSDoc have been added to the base package and to the
TypeScript package, using the `eslint-plugin-jsdoc` plugin. These rules
should help improve the quality of our inline documentation.

This was done primarily to prepare for the generation of HTML
documentation using TypeDoc. Our inline documentation needs to be of a
higher quality than it is now for that to work out well.

These rules have been tested with `metamask-extension` [1],
`@metamask/controllers` [2], and `@metamask/eth-sig-util` [3]. See
those draft PRs to get an idea of what these rules look like in
practice.

[1]: MetaMask/metamask-extension#12112
[2]: MetaMask/core#591
[3]: MetaMask/eth-sig-util#206

* Update hyphen config

The `jsdoc/require-hyphen-before-param-description` config has been
updated to also disallow hyphens before `@throws` descriptions, and to
require hyphens before `@template` descriptions. This seems to be what
TypeDoc expects, and it's in-line with what we do in most places.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants