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

import/no-named-as-default-member rule became less useful in 2.30.0 #3055

Open
peterjuras opened this issue Sep 8, 2024 · 1 comment
Open

Comments

@peterjuras
Copy link

In 2.30.0 the following code gives a lot of warnings and suggests to import string, number, etc. instead of using the properties from the default import z.

image

In this case, I think it is clearer to continue prefixing the code with z and not using imported generic words like "string", "number" etc.

I'm not sure why the rule needed to be changed like this. The zod library is likely not the only case where such prefixing makes sense.

Would you be open to give an option to disable this behavior and only create warnings/errors for actual import statements?

I disabled the rule for now.

@ljharb
Copy link
Member

ljharb commented Sep 8, 2024

What happens if you import * as z instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants