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

Allow declarations:true to work with checkJs #15718

Closed
nojvek opened this issue May 10, 2017 · 3 comments
Closed

Allow declarations:true to work with checkJs #15718

nojvek opened this issue May 10, 2017 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@nojvek
Copy link
Contributor

nojvek commented May 10, 2017

First of all, I bow down to the typescript gods for blessing us with checkJs. It has kept our children fed. However puny humans still pray for more. :godmode: πŸ™ πŸ™‡ πŸ™‡β€β™€οΈ

TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)
2.3

Code

/**
 * @param {string} str
 * @returns {string}
 */
export function snakecase(str) {
  return str.replace(/\_/g, `-`);
}
// A *self-contained* demonstration of the problem follows...
{
  "compilerOptions":{
    "checkJs": true,
    "declaration": true,
    "noEmit": true
  }
}

Expected behavior:
Running tsc on a project that uses js types should allow emitting a .d.ts like you would in a typescript project. This would allow projects to automatically emit typings for their project without having to maintain a separate .d.ts file that they need to keep in sync.

typings are documentation and if they are separate from code, they will eventually fall out of sync. Making this super easy to do with auto-generation will help a ton of javascript projects keep their typings up-to-date.

Actual behavior:
error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.

@DanielRosenwasser DanielRosenwasser added the Committed The team has roadmapped this issue label May 10, 2017
@DanielRosenwasser
Copy link
Member

This is a duplicate of #7546 but I don't want to close this issue because I like it too much.

@nojvek
Copy link
Contributor Author

nojvek commented May 10, 2017

😒 I did try searching to see if there was an existing issue. I suppose my github kungfu was not good enough. Feel free to close it as a dupe.

Github really needs a feature that searches previous issues for possible duplicates. I can imagine how much time you spend just marking issues as dupes.

@mhegazy
Copy link
Contributor

mhegazy commented May 10, 2017

indeed a duplicate, closing in favor of #7546

@mhegazy mhegazy added Duplicate An existing issue was already created and removed Committed The team has roadmapped this issue labels May 10, 2017
@mhegazy mhegazy closed this as completed May 10, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants