Skip to content

[eslint-plugin-packlets] Linting TypeError with typescript version >=4.2.0 #2591

@klonowicki

Description

@klonowicki

Summary

I'm getting a typescript error from eslint-plugin-packlets while linting after upgrading TypeScript version to any equal or above 4.2.0
Error contents:
TypeError: program.getRefFileMap is not a function
It's from DependencyAnalizer file from checkEntryPointForCircularImport function.
Eslint exits with error code 2.

Repro steps

  1. Upgrade TypeScript version from 4.1.3 to 4.2.3
  2. Run 'eslint' script

Details

eslint script: eslint 'packages//{src,tests}/**/.{js,ts,tsx}' '/*.json' 'cypress//.{js,ts,tsx}' --fix && stylelint --fix 'packages/**/.scss'

"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"eslint": "^7.15.0",

An Error occurs also when upgrading above packages to the newest ones.

"webpack": "^5.17.0",

.eslintrc.json

{
"extends": ["../../.eslintrc.json", "plugin:@rushstack/eslint-plugin-packlets/recommended"],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"project": ["./tsconfig.json"],
"tsconfigRootDir": "./packages/client"
},
"ignorePatterns": ["*.json"],
"rules": {
"@rushstack/packlets/mechanics": "error"
}
}

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@rushstack/eslint-plugin-packlets version? 0.2.0
Operating system? Windows
Would you consider contributing a PR? No
TypeScript compiler version? >=4.2.0
Node.js version (node -v)? 14.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as intendedpriorityThe maintainers consider it to be an important issue. We should try to fix it soon.repro confirmedThe issue comments included repro instructions, and the maintainers reproduced the problem

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions