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

Use jsdoc rules recommended for typescript #956

Merged
merged 4 commits into from
Jun 26, 2023

Conversation

spearec
Copy link
Contributor

@spearec spearec commented Jun 23, 2023

Description

Merging #949 caused a few issues with jsdoc, and while resolving those I had a look through the package documentation. There is a specific recommended ruleset for typescript, which is different from what OED was using. This ruleset removes the need for types in jsdoc headers, as they are redundant since typescript is a typed language.
I also took the chance to use eslint overrides to disable jsdoc as a rule for actions, reducers, and containers, instead of disabling jsdoc on a per-file basis. This allows easier control over the rules for these files as a group.

Type of change

(Check the ones that apply by placing an "x" instead of the space in the [ ] so it becomes [x])

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request

Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

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

Thanks to @spearec for quickly updating the files based on the recent update to eslint. I know removing all those recent edits was painful so I am esp. grateful.

I've made a couple of comments but overall this looks very good. Note I added a comment in issue #726 so the TODOs in .eslintrc.json will be addressed.

src/client/app/actions/admin.ts Outdated Show resolved Hide resolved
src/client/app/utils/api/ReadingsApi.ts Outdated Show resolved Hide resolved
src/client/app/utils/calculateCompare.ts Outdated Show resolved Hide resolved
src/client/app/utils/calculateCompare.ts Outdated Show resolved Hide resolved
src/client/app/utils/graphics.ts Show resolved Hide resolved
@spearec
Copy link
Contributor Author

spearec commented Jun 26, 2023

As other comments, return the JSON structure if we are doing that.

In this case, the JSON structure is directly noted in the function header instead of an interface, so the mouseover text of the function has the structure.

@huss huss merged commit 6fcd45a into OpenEnergyDashboard:development Jun 26, 2023
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.

2 participants