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: migrate eslint to flat config #2212

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

Conversation

KaiSpencer
Copy link
Contributor

@KaiSpencer KaiSpencer commented Jul 20, 2024

I have fixed some suggestions based on recommended lint rules from the newer version of eslint and tseslint, not sure they are all entirely correct!

Comment on lines -2 to +5
const SOURCE_FRAME = /[\/\\]msw[\/\\]src[\/\\](.+)/
const SOURCE_FRAME = /[/\\]msw[/\\]src[/\\](.+)/

const BUILD_FRAME =
/(node_modules)?[\/\\]lib[\/\\](core|browser|node|native|iife)[\/\\]|^[^\/\\]*$/
/(node_modules)?[/\\]lib[/\\](core|browser|node|native|iife)[/\\]|^[^/\\]*$/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this and other regex, eslint warned of unnecessary escape.

@@ -160,6 +160,7 @@ async function getGraphQLInput(request: Request): Promise<GraphQLInput | null> {
variables,
}
}
return null
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missing fallthrough lint warning (with new rules).

Happy to move this to an ignore and then address this separately

@@ -0,0 +1,59 @@
// @ts-check
Copy link
Member

Choose a reason for hiding this comment

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

Is there any chance the config can be written in TypeScript?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can indeed. Although only through an unstable_ flag in eslint. see here

Pull in the unstable flag (and jiti dev dependency) or leave as js?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @kettanaito, Would you be happy to implement in this way?

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