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
mutated array/object declared with const errors but ok with let #691
Comments
No, we don't have an option like that. What I personally use is the I'm not sure if I'd be in favor of adding your suggestion as a built-in option or not. I'd need to think about the flow on effects of such an option. |
I think it's worth giving it a good thought. |
Is there a way to use ignore patterns or something to make all arrays immutable by default but using some regex in the identifier to allow mutations like "let/const mut_arr = []"? |
# [6.0.0-next.6](v6.0.0-next.5...v6.0.0-next.6) (2023-07-21) ### Features * **immutable-data:** add new option `ignoreNonConstDeclarations` ([ecde24a](ecde24a)), closes [#691](#691)
🎉 This issue has been resolved in version 6.0.0-next.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I'm not sure what you mean exactly. |
This comment was marked as off-topic.
This comment was marked as off-topic.
# [6.0.0](v5.0.8...v6.0.0) (2023-07-30) ### Bug Fixes * add sanity checks to type immutablity override settings ([d3ce5b0](d3ce5b0)) * further updates for v6 ([71ecdb5](71ecdb5)) * **immutable-data:** rework logic, it should work now ([9644994](9644994)), closes [#692](#692) * migrate code for [@typescript-eslint](https://github.com/typescript-eslint) v6 ([5c6b1a2](5c6b1a2)) * replace `ignorePattern` option with `ignoreIdentifierPattern` and `ignoreCodePattern` ([48d8eba](48d8eba)), closes [#467](#467) ### Build System * increase minimum supported TypeScript version to 4.3.5 ([aefe6b2](aefe6b2)) ### Features * **functional-parameters:** add option to ignore getters and setters ([9c89b9e](9c89b9e)) * **immutable-data:** add new option `ignoreNonConstDeclarations` ([ecde24a](ecde24a)), closes [#691](#691) * **no-expression-statements:** add option to ignore self returning functions ([894fb91](894fb91)), closes [#611](#611) * **prefer-immutable-types:** use suggestions instead of a fixer by default ([#598](#598)) ([3fb9028](3fb9028)) * remove `assumeTypes` option ([6be5862](6be5862)) ### BREAKING CHANGES * replace `ignorePattern` option with `ignoreIdentifierPattern` and `ignoreCodePattern` * increase minimum supported TypeScript version to 4.3.5 * remove `assumeTypes` option * **prefer-immutable-types:** The fixer config no longer inherits as many options as before; be sure to be explicit in your configs.
🎉 This issue has been resolved in version 6.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Suggestion
Is there a setting where, if you declare an array or object with const and mutate it, it errors, but if declared with let it's ok?
I've been searching through the docs but couldn't figure out.
PS: I'm using typescript.
The text was updated successfully, but these errors were encountered: