eslint-plugin-total-functions icon indicating copy to clipboard operation
eslint-plugin-total-functions copied to clipboard

no-unsafe-mutable-readonly-assignment should whitelist `Array.from`

Open danielnixon opened this issue 1 year ago • 4 comments

danielnixon avatar Mar 11 '23 10:03 danielnixon

Ditto Array.of

danielnixon avatar Mar 11 '23 10:03 danielnixon

Be careful of this: https://github.com/danielnixon/eslint-plugin-total-functions/issues/730

danielnixon avatar Mar 11 '23 21:03 danielnixon

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 avatar Mar 12 '23 02:03 danielnixon

Should also consider whitelisting constructors, such as:

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

danielnixon avatar Mar 13 '23 00:03 danielnixon