From ffbe045fcc645bda4fcc0c0292c973774ef1ac1a Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 11 Jul 2016 10:10:51 +0100 Subject: [PATCH] Change to const-by-default --- code_style.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code_style.md b/code_style.md index 0ef16aedf5..6ec2597aa2 100644 --- a/code_style.md +++ b/code_style.md @@ -132,9 +132,7 @@ General Style ECMAScript ---------- -- Use `let` for variables and `const` for constants. This sounds obvious, but it isn't: the ES6 `const` keyword - could be used for assign-once variables, however this guide advises against doing so on the grounds that it - confuses them with constants. +- Use `const` unless you need a re-assignable variable. This ensures things you don't want to be re-assigned can't be. - Be careful migrating files to newer syntax. - Don't mix `require` and `import` in the same file. Either stick to the old style or change them all. - Likewise, don't mix things like class properties and `MyClass.prototype.MY_CONSTANT = 42;`