This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Expose programmatic api #165
Labels
Comments
index.js:runTests is a good starting point for what you want. It's not exported right now but I added that and then did this from $ node
> var dtslint = require('../dtslint/bin/index.js')
> dtslint.runTests(path.join(process.cwd(), 'types/openpgp'))
Promise {
<pending>,
domain:
Domain {
domain: null,
_events:
[Object: null prototype] {
removeListener: [Function: updateExceptionCapture],
newListener: [Function: updateExceptionCapture],
error: [Function: debugDomainError] },
_eventsCount: 3,
_maxListeners: undefined,
members: [] } }
> (node:19054) UnhandledPromiseRejectionWarning: Error: /home/nathansa/DefinitelyTyped/types/openpgp/index.d.ts:578:45
ERROR: 578:45 expect Compile error in [email protected] but not in [email protected].
Fix with a comment '// TypeScript Version: 3.2' just under the header.
Type 'ReadableStream' is not generic.
at /home/nathansa/dtslint/bin/index.js:159:19
at Generator.next (<anonymous>)
at fulfilled (/home/nathansa/dtslint/bin/index.js:5:58)
(node:19054) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) Which is the right output, plus a warning that I don't handle exceptions from the promise. |
Seems the errors are emitted as string. I think it should be fine for now. I want to discuss two issues before I submit my pr. File structure:The current So I think we should modify dist/bin/index.ts # CLI
dist/index.ts # main module which exporting apis Exposed APIsI'm going to expose 3 apis:
Let me know if we should expose more or less. |
Could this be done from the CLI? I want to put my d.ts in the root folder |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It would be nice if dtslint expose programmatic api. So I can provide the location of configurations(
tsconfig.json
andtslint.json
), a definition file and tests.The text was updated successfully, but these errors were encountered: