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

Use unknown instead of any for StringIndexed #1661

Open
robhung opened this issue Nov 22, 2022 · 1 comment
Open

Use unknown instead of any for StringIndexed #1661

robhung opened this issue Nov 22, 2022 · 1 comment
Labels
discussion M-T: An issue where more input is needed to reach a decision semver:major TypeScript-specific
Milestone

Comments

@robhung
Copy link

robhung commented Nov 22, 2022

export type StringIndexed = Record<string, any>;

As per title, I think it should be unknown to prevent accessing properties which may not exist.

@robhung robhung changed the title Use unknown instead of any Use unknown instead of any for StringIndexed Nov 22, 2022
@seratch seratch added discussion M-T: An issue where more input is needed to reach a decision semver:major TypeScript-specific labels Nov 22, 2022
@seratch seratch added this to the 4.x milestone Nov 22, 2022
@seratch
Copy link
Member

seratch commented Nov 22, 2022

Thanks for the suggestion! This can be a breaking change, so we are not planning to make this change happen in the short term. In the long run, changing the type when upgrading the major version may be worth considering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion M-T: An issue where more input is needed to reach a decision semver:major TypeScript-specific
Projects
None yet
Development

No branches or pull requests

2 participants