aboutsummaryrefslogtreecommitdiffstats
path: root/.eslintrc
diff options
context:
space:
mode:
authorMark Stacey <markjstacey@gmail.com>2019-07-06 01:01:34 +0800
committerGitHub <noreply@github.com>2019-07-06 01:01:34 +0800
commit95f198550e419c598750a1717014dac6ca5091e9 (patch)
tree50720fa452bf11b9f0ec720f84f70bd2231d38d2 /.eslintrc
parent0311f2d28c60fb82141dee471c19ad085930f8cc (diff)
downloadtangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.tar.gz
tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.tar.zst
tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.zip
Declare variables before use (#6806)
While working on #6805, I noticed that many variables were being used before they were declared. Technically this worked fine in practice because we were using the `transform-es2015-block-scoping` Babel plugin, which transforms `let` and `const` to `var`, which is hoisted. However, after removing that Babel transformation, many things broke. All instances of variables or classes being used before declared have been fixed. The `no-use-before-define` eslint rule has been added to catch these cases going forward. The rule is disabled for function declarations for the moment, because those are always hoisted. We could disable that too if we want to, but it's purely stylistic and would require a lot more changes.
Diffstat (limited to '.eslintrc')
-rw-r--r--.eslintrc1
1 files changed, 1 insertions, 0 deletions
diff --git a/.eslintrc b/.eslintrc
index 53033b753..22585aa9d 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -134,6 +134,7 @@
"no-unreachable": 2,
"no-unsafe-finally": 2,
"no-unused-vars": [2, { "vars": "all", "args": "all", "argsIgnorePattern": "[_]+" }],
+ "no-use-before-define": [2, { "functions": false }],
"no-useless-call": 2,
"no-useless-computed-key": 2,
"no-useless-constructor": 2,