Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
See discussion injsx-eslint/eslint-plugin-react#2882
There are only two cases in this project that we honourparserOptions.ecmaVersion, and both are inscope-manager:
typescript-eslint/packages/scope-manager/src/ScopeManager.ts
Lines 78 to 84 in498f397
| publicisStrictModeSupported():boolean{ | |
| returnthis.#options.ecmaVersion!=null&&this.#options.ecmaVersion>=5; | |
| } | |
| publicisES6():boolean{ | |
| returnthis.#options.ecmaVersion!=null&&this.#options.ecmaVersion>=6; | |
| } |
These usages were brought across when I forkedeslint-scope.
However in the context of TS scope analysis - theecmaVersion makes zero sense.
TS will never treat your code as if it's ES5 or lower - it is always (syntactically and semantically) "ESNext".
Whilst other parts of the ecosystem respects them - and they should continue to - our parser and scope analyser should (like TS itself) always treat code as if it is ESNext in terms of language features.