Skip to content

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

Open
@peterjuras

Description

@peterjuras

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions