-
Notifications
You must be signed in to change notification settings - Fork 24
EVG-20049 Add eslint-jsdoc plugin and fix errors #1890
Conversation
Passing run #10644 ↗︎Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
.eslintrc.js
Outdated
"plugin:prettier/recommended", // Note: prettier must ALWAYS be the last extension. | ||
"plugin:jsdoc/recommended-typescript-error", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"plugin:prettier/recommended", // Note: prettier must ALWAYS be the last extension. | |
"plugin:jsdoc/recommended-typescript-error", | |
"plugin:jsdoc/recommended-typescript-error", | |
"plugin:prettier/recommended", // Note: prettier must ALWAYS be the last extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😓
src/utils/string/index.ts
Outdated
@@ -33,6 +33,11 @@ export const shortenString = ( | |||
return valueSubstring + (tail || " …"); | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shortenString
in this file is missing a doc comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it entirely since it isn't used in the codebase and is dead code.
src/utils/numbers/index.ts
Outdated
*/ | ||
const formatZeroIndexForDisplay = (value: number): number => value + 1; | ||
|
||
/** | ||
* roundDecimal rounds a decimal number to include a certain number of decimal places. It does not add trailing | ||
* `roundDecimal` rounds a decimal number to include a certain number of sig figs. It does not add trailing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,3 +1,4 @@ | |||
/* eslint-disable jsdoc/valid-types */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to just disable it for that comment block rather than for the whole file? Someone in the GitHub issue thread seemed to have a solution for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I couldn't get this to pass the pre-commit hook check.
@@ -1,3 +1,4 @@ | |||
/* eslint-disable jsdoc/valid-types */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
* @param props.stopPolling - Function from useQuery that is called when offline or not visible | ||
* @param props.refetch - Optional function from useQuery that can be used to refetch data. | ||
* @param props.shouldPollFaster - Optional boolean to enable increased poll rate. | ||
* @param props.initialPollingState - Optional boolean to indicate the initial polling state. | ||
* @param props.startPolling - Function from useQuery that is called when online and visible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know why whenever the props comes in as an object, its individual fields are always typed as any
? I see any
when I hover over these fields, but I get proper types when the props isn't an object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure tbh. I think vscode intellisense is just having a tough time parsing these object fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeaaay! i left a bunch of comments but it's all just small edits 🥳
Co-authored-by: minnakt <47064971+minnakt@users.noreply.github.com>
Co-authored-by: minnakt <47064971+minnakt@users.noreply.github.com>
Co-authored-by: minnakt <47064971+minnakt@users.noreply.github.com>
EVG-20049
Description
Adds the eslint-jsdoc plugin to the spruce repo.
Ran into the following issue because some of our props were named
readonly
for now I disabled thejsdoc/valid-types
rule on files that are affected.jsdoc-type-pratt-parser/jsdoc-type-pratt-parser#104