fix: set a valid parserOptions.ecmaVersion
#403
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.
We've been having some problems with false positives lately. Namely, the
prefer-const
andno-implicit-globals
rules seemed to disregard scope. With the help of some very helpful folks over at eslint, we've found the culprit.This line in our config is not supported by
@typescript-eslint/parser
and it will fall back to at least ES9. What version it falls back to is not entirely clear to me, but it seems to be a version without block scoping, where all variables are hoisted. This causes scope-aware rules to misreport.This PR changes the
parserOptions.ecmaVersion
from"latest"
to12
, which is the latest ratified version. This means we will have to bump this version every year. Since our configuration is executable, maybe we can find a way to query the latest version automatically.Since this error in our configuration breaks some of our builds, we should probably merge this fix first and then figure out how to maintain the pinned version later.