Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Compare types of exports #23

Open
gabritto opened this issue Mar 3, 2020 · 0 comments
Open

Compare types of exports #23

gabritto opened this issue Mar 3, 2020 · 0 comments

Comments

@gabritto
Copy link
Collaborator

gabritto commented Mar 3, 2020

We should compare the types of what is exported in the declaration file against the inferred types of what is exported in the JS source. This most likely should be used to provide warnings/suggestions, because JS type inference might not be good enough for this to be used as a lint rule. The implementation should also be resilient enough to avoid emitting useless information when inference of JS types doesn't work well.
Example:
js

module.exports.str = "clearly a string"; // Inferred type: "string"

d.ts

export const str: number; // Wrong type

In this case we'd want a warning that the type of str could be wrong.

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

No branches or pull requests

1 participant