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

chore: address eslint errors #2182

Closed
wants to merge 7 commits into from

Conversation

cheahjs
Copy link
Contributor

@cheahjs cheahjs commented May 11, 2024

Pull Request Checklist

  • Target branch: Pull requests should target the dev branch.
  • Description: Briefly describe the changes in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for the changes?
  • Code Review: Have you self-reviewed your code and addressed any coding standard issues?

Description

  1. Address all eslint errors that are flagged when running npm run lint:frontend
  2. Add types for i18next usage across the codebase
  3. Add eslint-plugin-unused-imports to remove unused imports

return null;
});

if (error) {
throw error;
}

return res;
return res!;
Copy link
Contributor

Choose a reason for hiding this comment

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

Having to add !s like this smells like a bug...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's one tiny edge case that isn't fully covered, which is if the catch handles a falsey err, we don't re-throw that I can address.

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

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

(That said, I'll have to reopen #2227 as a new PR anyway since you can't push to a closed PR, so that doesn't really affect this PR 😅. However, the type-related comments from that PR might apply to this one too.)

Copy link
Contributor

Choose a reason for hiding this comment

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

See: #2233. It might be a good idea to start building types for the API on top of that, if it gets eventually merged?

@cheahjs cheahjs closed this May 19, 2024
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

2 participants