Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Maximum call stack size exceeded - Warning caused by no-inferred-empty-object-type #2646

Closed
Merott opened this issue Apr 27, 2017 · 1 comment · Fixed by #2762
Closed

Maximum call stack size exceeded - Warning caused by no-inferred-empty-object-type #2646

Merott opened this issue Apr 27, 2017 · 1 comment · Fixed by #2762

Comments

@Merott
Copy link
Contributor

Merott commented Apr 27, 2017

Bug Report

  • TSLint version: 5.1.0
  • TypeScript version: 2.3.1
  • Running TSLint via: CLI

TypeScript code being linted

import { expect } from 'chai';

describe('app', () => {
  it(`should know numbers`, () => {
    expect(1).to.eq(1);
  });
});

with tslint.json configuration:

{
  "rules": {
    "no-inferred-empty-object-type": true
  }
}

Actual behavior

Outputs Warning: Maximum call stack size exceeded.

Expected behavior

No warning, or better indicator of what the issue may be.

Explanation

I have this issue in a larger project, and managed to narrow it down to the no-inferred-empty-object-type rule, and created a minimal test project that reproduces the issue: https://github.com/Merott/tslint-max-call-stack-size-issue-demo.

It appears that it has something to do with the import of expect from chai, but that may be a red herring, as I couldn't understand where the issue came from.

@JoshuaKGoldberg
Copy link
Contributor

The exact issue is coming from your expect line. I'm seeing this too with a very similar repro. The issue goes away after removing the expect(1).to.eq(1);.

Diving into the source, isEmptyObjectInterface is recursing infinitely into itself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants