Skip to content

Add write-file-atomically types#25064

Merged
RyanCavanaugh merged 1 commit intoDefinitelyTyped:masterfrom
Aankhen:add-write-file-atomically
Apr 17, 2018
Merged

Add write-file-atomically types#25064
RyanCavanaugh merged 1 commit intoDefinitelyTyped:masterfrom
Aankhen:add-write-file-atomically

Conversation

@Aankhen
Copy link
Copy Markdown
Contributor

@Aankhen Aankhen commented Apr 17, 2018

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • tslint.json should be present, and tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

@typescript-bot typescript-bot added New Definition This PR creates a new definition package. Awaiting reviewer feedback labels Apr 17, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Apr 17, 2018

@Aankhen Thank you for submitting this PR!

Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes.

In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day!

@@ -0,0 +1,10 @@
import * as writeFileAtomically from 'write-file-atomically';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classes and functions cannot be imported using import * as syntax. Please fix either the test or the definition file to use a correct import form.

See also https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for the link. Strange that neither the lint nor the testing caught it.

Should I be using export default in this case? Or is it reasonable to expect users to say import writeFileAtomically = require("write-file-atomically");?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the module actually provide a default export, or is it a CommonJS module that you could only import through require ?

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Apr 17, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

@Aankhen One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@Aankhen Aankhen changed the title Add write-file-atomically types. Add write-file-atomically types Apr 17, 2018
@typescript-bot typescript-bot removed the Revision needed This PR needs code changes before it can be merged. label Apr 17, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @RyanCavanaugh - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate?

@RyanCavanaugh RyanCavanaugh merged commit 5227ddf into DefinitelyTyped:master Apr 17, 2018
@RyanCavanaugh
Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Definition This PR creates a new definition package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants