Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

app.js: prevent mutation of global config #1233

Merged
merged 1 commit into from
Nov 24, 2021
Merged

app.js: prevent mutation of global config #1233

merged 1 commit into from
Nov 24, 2021

Conversation

remi-dupre
Copy link
Contributor

@remi-dupre remi-dupre commented Nov 24, 2021

I feel like the best way to fix this indefinitely would be to clone the global config, but it doesn't seem like this is something idiomatic in Javascript: https://attacomsian.com/blog/javascript-clone-objects (describes a solution based on a library, and the other one consists in serializing then de-serializing JSON ... lol nope).

So I guess we will have to be careful never mutating the global configuration.

EDIT: maybe we'd want to use the no-mutation lint from https://github.com/jhusain/eslint-plugin-immutable ? It seems unacceptable to me that eslint accepts this by default:

const obj = { a: 3 };
obj.a = 0;

@xem xem merged commit 41ed42d into master Nov 24, 2021
@remi-dupre remi-dupre deleted the fix-burger-menu branch November 24, 2021 18:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants