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

Fix tsconfig.json and Lint errors #290

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

derekvmcintire
Copy link

@derekvmcintire derekvmcintire commented Jan 9, 2025

Summary of changes

  • Updated tsconfig.json - left comments on each line to document the purpose of each configuration
  • Fixed type and lint errors where I could find them including:
    • import order
    • file extensions in imports
    • vitest methods
    • explicit type imports
    • typecasting where necessary
    • declared a type module for heat-stack/types/vite-env-only.d.ts - not sure if there is a better solution for this, but it works

Unfixable Type Errors

There were unfixable errors in heat-stack/app/utils/providers/github.server.ts which i typecasted to unknown before typecasting again to the needed type, but I suspect there could be issues with either the data or the type here that need to be addressed further. I left @TODOs in the code - but it might be better to create an issue if there isn't a straight forward answer here.

Lint Errors Not Fixed

There are still some lint errors from a React hook being used in a test outside of a component (it is possible the use() method here is intended to be imported from somewhere else?)

Screenshots

Screenshot 2025-01-09 at 4 50 35 PM
Screenshot 2025-01-09 at 4 51 31 PM

return new GitHubStrategy(
{
clientID: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
callbackURL: '/auth/github/callback',
},
} as unknown as GitHubStrategyOptions, // @TODO fix types here, clientID and callbackURL do not exist on GitHubStrategyOptions
Copy link
Author

Choose a reason for hiding this comment

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

@todo here because clientID and callbackURL do not exist on type GitHubStrategyOptions, so we either need to figure out what type we should be using, or potentially update the code here

@@ -25,20 +26,20 @@ const shouldMock =
process.env.NODE_ENV === 'test'

export class GitHubProvider implements AuthProvider {
getAuthStrategy() {
getAuthStrategy(): Strategy<ProviderUser, any> { // @TODO double check the types here
Copy link
Author

Choose a reason for hiding this comment

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

added @todo here for someone to double check the types

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.

1 participant