Repository navigation
Add Recase typings - #15744
Add Recase typings#157445 commits merged into
Conversation
|
types/recase/index.d.ts Checklist
|
| }): {}; | ||
| export function stringify(obj: any): string; | ||
|
|
||
| export default { |
There was a problem hiding this comment.
This object is not the default export of the package!
There was a problem hiding this comment.
Yes, this line should simply be removed. The package doesn't have a default export, it has several named exports.
| @@ -0,0 +1,36 @@ | |||
| import RJSON from 'relaxed-json'; | |||
There was a problem hiding this comment.
This is not how you would use the package in practice.
| @@ -0,0 +1,7 @@ | |||
| // Type definitions for Recase v1.0.4 | |||
| // Project: https://www.npmjs.com/package/recase | |||
| // Definitions by: Mikal Madsen <[email protected]> | |||
There was a problem hiding this comment.
Prefer your github page like you used for relaxed-json
| relaxed?: boolean, | ||
| warnings?: boolean, | ||
| tolerant?: boolean, | ||
| duplicate?: boolean, |
There was a problem hiding this comment.
One of the options may be a reviver function too. Also, tolerant doesn't appear in the documentation.
| }): {}; | ||
| export function stringify(obj: any): string; | ||
|
|
||
| export default { |
There was a problem hiding this comment.
Yes, this line should simply be removed. The package doesn't have a default export, it has several named exports.
| @@ -0,0 +1 @@ | |||
| { "extends": "../tslint.json" } | |||
There was a problem hiding this comment.
Change these to "extends": "dtslint/dt.json".
There was a problem hiding this comment.
Failed to load ...\DefinitelyTyped\types\relaxed-json\tslint.json: Invalid "extends" configuration value - could not require "dtslint/dt.json". Review the Node lookup algorithm (https://nodejs.org/api/modules.html#modules_all_together) for the approximate method TSLint uses to find the referenced configuration file.
The original value is what's generated by the generator script.
There was a problem hiding this comment.
The generator script is out of date (microsoft/dts-gen#50), and you may be running an older version of dtslint if you're getting the above error.
|
For relaxed-json I'm exporting a Reviver type, but this is based on native JSON.parse so I'm wondering if there's a native type I should import, and if so where I can find it. |
|
The builtin |
Please fill in this template.
npm run lint package-name(ortscif notslint.jsonis present).Select one of these and delete the others:
If adding a new definition:
dts-gen --dt, not by basing it on an existing project.tslint.jsonshould be present, andtsconfig.jsonshould havenoImplicitAny,noImplicitThis, andstrictNullChecksset totrue.