Skip to content

Bug(scope-manager): 8.16.0 not compatible with TS<5.7 when es2022.sharedmemory lib is used. #10395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks done
burtek opened this issue Nov 26, 2024 · 1 comment
Open
4 tasks done
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: scope-manager Issues related to @typescript-eslint/scope-manager

Comments

@burtek
Copy link
Contributor

burtek commented Nov 26, 2024

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Relevant Packages

types, scope-manager

Repro Link

https://github.com/burtek/tseslint-bug-repro

(unable to repro in playground)

Repro Code

function a() {}

ESLint Config

import tseslint from 'typescript-eslint'

export default tseslint.config(
    tseslint.configs.recommended,
    {
        languageOptions: {
            parserOptions: {
                project: 'tsconfig.json'
            },
        }
    }
)

tsconfig

{
  "compilerOptions": {
    "target": "ES2020",
    "lib": ["es2022", "ES2022.SharedMemory"],
    "module": "ESNext",
    "noEmit": true
  },
  "files": ["index.ts"]
}

Expected Result

no error

Actual Result

$ npm run lint

> tseslint-bug-repro@1.0.0 lint
> eslint


/home/bartosz/projects/tseslint-bug-repro/index.ts
  0:0  error  Parsing error: Invalid value for lib provided: es2022.sharedmemory

✖ 1 problem (1 error, 0 warnings)

Additional Info

Caused by removing es2022.sharedmemory lib file in #10372 from scope-manager. Additionally the es2022.sharedmemory literal type has been removed from types package, causing typescript type-checking issue in case eslint.config.js is type-checked, if it provides lib config separately.

#10372 (comment)

Versions

package version
typescript-eslint 8.16.0
TypeScript 5.6.3
ESLint 9.15.0
node 20.9.0
@burtek burtek added bug Something isn't working triage Waiting for team members to take a look labels Nov 26, 2024
@burtek burtek changed the title Bug: 8.16.0 not compatible with TS<5.7 when es2022.sharedmemory is used. Bug: 8.16.0 not compatible with TS<5.7 when es2022.sharedmemory lib is used. Nov 26, 2024
@burtek burtek changed the title Bug: 8.16.0 not compatible with TS<5.7 when es2022.sharedmemory lib is used. Bug(scope-manager): 8.16.0 not compatible with TS<5.7 when es2022.sharedmemory lib is used. Nov 26, 2024
@bradzacher bradzacher added package: scope-manager Issues related to @typescript-eslint/scope-manager accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Nov 26, 2024
@burtek
Copy link
Contributor Author

burtek commented Nov 26, 2024

So I was thinking... typescript-eslint either needs to keep separate set of libs for each supported TS version, or just needs to keep all libs declared by any supported version...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: scope-manager Issues related to @typescript-eslint/scope-manager
Projects
None yet
Development

No branches or pull requests

2 participants