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

no-unsafe-mutable-readonly-assignment should whitelist Array.from #729

Open
danielnixon opened this issue Mar 11, 2023 · 4 comments
Open

Comments

@danielnixon
Copy link
Owner

No description provided.

@danielnixon
Copy link
Owner Author

Ditto Array.of

@danielnixon
Copy link
Owner Author

Be careful of this: #730

@danielnixon
Copy link
Owner Author

Should also whitelist immediate assignment from an array spread, like this:

      // eslint-disable-next-line total-functions/no-unsafe-mutable-readonly-assignment
      const foo: readonly string[] = [...new Set(["a"] as const)];

@danielnixon
Copy link
Owner Author

Should also consider whitelisting constructors, such as:

const foo: ReadonlyDate = new Date(...);

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

No branches or pull requests

1 participant