Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support evolving the type with assignments for expando object #12416

Open
waderyan opened this issue Nov 21, 2016 · 4 comments
Open

Support evolving the type with assignments for expando object #12416

waderyan opened this issue Nov 21, 2016 · 4 comments
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue

Comments

@waderyan
Copy link

Copied from #12278 (comment)
OP = @abgivant

I use a similar module pattern in an application I'm working on, and the lack of IntelliSense/definitions for those has been an issue for me as well.

Mine follow this basic pattern:

module.exports = function(x, y, z) {
  var exports = {};
  exports.method = function() {
    // Something that might use x, y, or z
  };
  return exports;
}

Would it be possible to do something like include an option in the jsconfig.json file to specify a property name or list of names to track when determining module exports?

Maybe something like this?

{
  "moduleOptions": {
    "exportProperty": ["exports", "this"]
  }
}
@waderyan
Copy link
Author

From @mhegazy (here):

@abgivant, this pattern is actually an easier one to support, we already have plans to do so on the future. it is a general construction patter that is common in JS.
the this one is a bit more tricky though.

@waderyan waderyan added the VS Code Tracked There is a VS Code equivalent to this issue label Nov 21, 2016
@waderyan
Copy link
Author

From @abgivant (here):

@mhegazy Ah cool. Is that part of the "expando" discussion, or is there a more specific feature in the works for things like that?

@mhegazy
Copy link
Contributor

mhegazy commented Dec 15, 2016

This has been referenced before in #11839

@mhegazy mhegazy changed the title IntelliSense does not work for common module pattern Support evolving the type with assignments for expando object Dec 15, 2016
@mhegazy mhegazy added Suggestion An idea for TypeScript In Discussion Not yet reached consensus labels Dec 15, 2016
@minkir014
Copy link

Is there any intend to fix this issue in the near future?????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

3 participants