Enable the ESLint no-var
rule globally
#13091
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A significant portion of the code-base has now been converted to use
let
/const
, rather thanvar
, hence it should be possible to simply enable the ESLintno-var
rule globally.This way we can ensure that new code won't accidentally use
var
, and it also removes the need to manually enable the rule in various folders.Obviously it makes sense to continue the efforts to replace
var
, but that should probably happen on a file and/or folder basis.Please note that this patch excludes the following code:
The
extensions/
folder, since that seemed easiest for now (and I don't know exactly what the support situation is for the Chromium-extension).The entire
external/
folder is ignored, since most of it's currently excluded from linting.For the code that isn't imported from elsewhere (and should be ignored), we should probably (at some point) bring the code up to the same linting/formatting standard as the rest of the code-base.
Various files in the
test/
folder are ignored, as necessary, since the way that a lot of this code is loaded will require some care (or perhaps larger re-factoring) when removingvar
usage.