Closed
Description
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.
Playground Link
Repro Code
type RecursiveArray = Array<RecursiveArray>;
function identity<T>(subject: T): T{
return subject;
}
const arr:RecursiveArray = [];
arr.push(arr,arr);
identity(arr);
ESLint Config
{
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/no-unsafe-argument": "error"
},
"env": { "node": true }
}
tsconfig
Expected Result
I expected no errors reported
Actual Result
Stack overflow error:
Uncaught RangeError: Maximum call stack size exceeded
Occurred while linting <input>:6
Rule: "@typescript-eslint/no-unsafe-argument"
at getTypeFlags (index.js:131903:23)
at isTypeFlagSet (index.js:131916:20)
at isTypeAnyType (index.js:132620:45)
at isUnsafeAssignment (index.js:132720:41)
at isUnsafeAssignment (index.js:132762:29)
at isUnsafeAssignment (index.js:132762:29)
at isUnsafeAssignment (index.js:132762:29)
at isUnsafeAssignment (index.js:132762:29)
at isUnsafeAssignment (index.js:132762:29)
at isUnsafeAssignment (index.js:132762:29)
Additional Info
eslint:cli CLI args: [ '--no-color', '--debug', 'index.ts' ] +0ms
eslint:cli Running on files +3ms
eslintrc:config-array-factory Loading JSON config file: /Users/isaac_riceweber/test/package.json +0ms
eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/Users/isaac_riceweber/test', loose: false } ] +0ms
eslintrc:ignore-pattern processed: { basePath: '/Users/isaac_riceweber/test', patterns: [ '/**/node_modules/*' ] } +1ms
eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/Users/isaac_riceweber/test', loose: false } ] +1ms
eslintrc:ignore-pattern processed: { basePath: '/Users/isaac_riceweber/test', patterns: [ '/**/node_modules/*' ] } +0ms
eslint:file-enumerator Start to iterate files: [ 'index.ts' ] +0ms
eslint:file-enumerator File: /Users/isaac_riceweber/test/index.ts +1ms
eslintrc:cascading-config-array-factory Load config files for /Users/isaac_riceweber/test. +0ms
eslintrc:cascading-config-array-factory No cache found: /Users/isaac_riceweber/test. +0ms
eslintrc:config-array-factory Loading JSON config file: /Users/isaac_riceweber/test/.eslintrc.json +5ms
eslintrc:config-array-factory Config file found: /Users/isaac_riceweber/test/.eslintrc.json +0ms
eslintrc:config-array-factory Loading parser "@typescript-eslint/parser" from /Users/isaac_riceweber/test/.eslintrc.json +0ms
eslintrc:config-array-factory Loaded: @typescript-eslint/parser@5.25.0 (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/parser/dist/index.js) +1ms
eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/isaac_riceweber/test/.eslintrc.json +249ms
eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.25.0 (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/eslint-plugin/dist/index.js) +1ms
eslint:rules Loading rule 'brace-style' (remaining=286) +0ms
eslint:rules Loading rule 'comma-dangle' (remaining=285) +3ms
eslint:rules Loading rule 'dot-notation' (remaining=284) +5ms
eslint:rules Loading rule 'indent' (remaining=283) +3ms
eslint:rules Loading rule 'init-declarations' (remaining=282) +2ms
eslint:rules Loading rule 'keyword-spacing' (remaining=281) +1ms
eslint:rules Loading rule 'lines-between-class-members' (remaining=280) +1ms
eslint:rules Loading rule 'no-dupe-class-members' (remaining=279) +10ms
eslint:rules Loading rule 'no-duplicate-imports' (remaining=278) +1ms
eslint:rules Loading rule 'no-empty-function' (remaining=277) +1ms
eslint:rules Loading rule 'no-extra-parens' (remaining=276) +2ms
eslint:rules Loading rule 'no-extra-semi' (remaining=275) +1ms
eslint:rules Loading rule 'no-invalid-this' (remaining=274) +8ms
eslint:rules Loading rule 'no-loop-func' (remaining=273) +1ms
eslint:rules Loading rule 'no-loss-of-precision' (remaining=272) +1ms
eslint:rules Loading rule 'no-magic-numbers' (remaining=271) +1ms
eslint:rules Loading rule 'no-restricted-imports' (remaining=270) +16ms
eslint:rules Loading rule 'no-unused-expressions' (remaining=269) +21ms
eslint:rules Loading rule 'no-useless-constructor' (remaining=268) +2ms
eslint:rules Loading rule 'object-curly-spacing' (remaining=267) +4ms
eslint:rules Loading rule 'quotes' (remaining=266) +22ms
eslint:rules Loading rule 'semi' (remaining=265) +8ms
eslint:rules Loading rule 'space-before-blocks' (remaining=264) +1ms
eslint:rules Loading rule 'space-infix-ops' (remaining=263) +1ms
eslintrc:config-array-factory Plugin /Users/isaac_riceweber/test/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 187ms +187ms
eslintrc:cascading-config-array-factory No cache found: /Users/isaac_riceweber. +439ms
eslintrc:cascading-config-array-factory Stop traversing because of considered root. +0ms
eslintrc:cascading-config-array-factory Configuration was determined: ConfigArray(2) [ { type: 'config', name: 'DefaultIgnorePattern', filePath: '', criteria: null, env: undefined, globals: undefined, ignorePattern: IgnorePattern { patterns: [Array], basePath: '/Users/isaac_riceweber/test', loose: false }, noInlineConfig: undefined, parser: undefined, parserOptions: undefined, plugins: undefined, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: undefined, settings: undefined }, { type: 'config', name: '.eslintrc.json', filePath: '/Users/isaac_riceweber/test/.eslintrc.json', criteria: null, env: { node: true }, globals: undefined, ignorePattern: undefined, noInlineConfig: undefined, parser: { error: null, filePath: '/Users/isaac_riceweber/test/node_modules/@typescript-eslint/parser/dist/index.js', id: '@typescript-eslint/parser', importerName: '.eslintrc.json', importerPath: '/Users/isaac_riceweber/test/.eslintrc.json' }, parserOptions: { project: './tsconfig.json' }, plugins: { '@typescript-eslint': [Object] }, processor: undefined, reportUnusedDisableDirectives: undefined, root: undefined, rules: { '@typescript-eslint/no-unsafe-argument': 'error' }, settings: undefined } ] on /Users/isaac_riceweber/test +1ms
eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/Users/isaac_riceweber/test', loose: false } ] +443ms
eslintrc:ignore-pattern processed: { basePath: '/Users/isaac_riceweber/test', patterns: [ '/**/node_modules/*' ] } +0ms
eslintrc:ignore-pattern Check {
filePath: '/Users/isaac_riceweber/test/index.ts',
dot: false,
relativePath: 'index.ts',
result: false
} +1ms
eslint:cli-engine Lint /Users/isaac_riceweber/test/index.ts +0ms
eslint:linter Linting code for /Users/isaac_riceweber/test/index.ts (pass 1) +0ms
eslint:linter Verify +0ms
eslint:linter With ConfigArray: /Users/isaac_riceweber/test/index.ts +1ms
eslint:linter Parsing: /Users/isaac_riceweber/test/index.ts +2ms
eslint:linter Parsing successful: /Users/isaac_riceweber/test/index.ts +2s
eslint:linter Scope analysis: /Users/isaac_riceweber/test/index.ts +0ms
eslint:linter Scope analysis successful: /Users/isaac_riceweber/test/index.ts +0ms
eslint:linter An error occurred while traversing +27ms
eslint:linter Filename: /Users/isaac_riceweber/test/index.ts +0ms
eslint:linter Line: 6 +0ms
eslint:linter Parser Options: {
ecmaFeatures: { globalReturn: true },
project: './tsconfig.json',
ecmaVersion: undefined
} +0ms
eslint:linter Parser Path: /Users/isaac_riceweber/test/node_modules/@typescript-eslint/parser/dist/index.js +1ms
eslint:linter Settings: {} +0ms
Oops! Something went wrong! :(
ESLint: 8.15.0
RangeError: Maximum call stack size exceeded
Occurred while linting /Users/isaac_riceweber/test/index.ts:6
Rule: "@typescript-eslint/no-unsafe-argument"
at getTypeFlags (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.js:32:22)
at isTypeFlagSet (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.js:45:19)
at isTypeAnyType (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/predicates.js:101:43)
at isUnsafeAssignment (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js:19:40)
at isUnsafeAssignment (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js:61:28)
at isUnsafeAssignment (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js:61:28)
at isUnsafeAssignment (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js:61:28)
at isUnsafeAssignment (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js:61:28)
at isUnsafeAssignment (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js:61:28)
at isUnsafeAssignment (/Users/isaac_riceweber/test/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js:61:28)
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.25.0 |
@typescript-eslint/parser |
5.25.0 |
TypeScript |
4.6.4 |
ESLint |
8.15.0 |
node |
16.15.0 |