JSMonk / hegel

An advanced static type checker
https://hegel.js.org
MIT License
2.09k stars 59 forks source link

Cannot use 'in' operator to search for 'start' in undefined #308

Open easoncxz opened 4 years ago

easoncxz commented 4 years ago

I don't have a minimal reproduction yet, but it seems to be related to the interpretation of .hegelrc file.

If in .hegelrc I put:

environment: browser
include:
  - ./src/**/*.js
exclude:
  - ./static/**
  - ./es5/**
  - ./node_modules/**
types:
  - ./@types
  - ./node_modules/@types

and run npx hegel, I get:

[0] $ npx hegel
Cannot use 'in' operator to search for 'start' in undefined

[1] $

However if I add a bogus entry to include: at the start, like bogus.js here:

environment: browser
include:
  - bogus.js
  - ./src/**/*.js
exclude:
  - ./static/**
  - ./es5/**
  - ./node_modules/**
types:
  - ./@types
  - ./node_modules/@types

Then type-checking is fine:

[0] $ npx hegel
No errors!

[0] $

I found #102, but not sure how related it is.

JSMonk commented 4 years ago

Hmm. It seems like an inner problem inside code base. Will try to reproduce it. Thank you for your contributions. You help us a lot and you are awesome :3