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

Using a const value as an index in an assignment flags modification #2432

Closed
yphoenix opened this issue Feb 18, 2024 · 1 comment · Fixed by #2433
Closed

Using a const value as an index in an assignment flags modification #2432

yphoenix opened this issue Feb 18, 2024 · 1 comment · Fixed by #2433
Assignees

Comments

@yphoenix
Copy link

yphoenix commented Feb 18, 2024

const { foo } = formValueObject;

let bar;
let bar[foo ?? 999] = 42;

eslint(no-const-assign): Unexpected re-assignment of const variable foo

let bar = [];
bar[parseInt("42", 10)] = 99;

eslint(no-global-assign): Read-only global 'parseInt' should not be modified.

@yphoenix
Copy link
Author

Thank you.

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 a pull request may close this issue.

2 participants