-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-manager
Milestone
Description
See discussion in jsx-eslint/eslint-plugin-react#2882
There are only two cases in this project that we honour parserOptions.ecmaVersion
, and both are in scope-manager
:
typescript-eslint/packages/scope-manager/src/ScopeManager.ts
Lines 78 to 84 in 498f397
public isStrictModeSupported(): boolean { | |
return this.#options.ecmaVersion != null && this.#options.ecmaVersion >= 5; | |
} | |
public isES6(): boolean { | |
return this.#options.ecmaVersion != null && this.#options.ecmaVersion >= 6; | |
} |
These usages were brought across when I forked eslint-scope
.
However in the context of TS scope analysis - the ecmaVersion
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.
stevematney, ljharb, svict4, zcfan and mortyccp
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-manager