Skip to content

Typescript definitions fail downstream when used #110

@rosskevin

Description

@rosskevin
  • webpack-plugin-serve Version: master

How Do We Reproduce?

💥 Working on PR

Expected Behavior

Typescript users should be able to npm add -D webpack-plugin-serve, and use it in a TS file without the need to do anything else.

Actual Behavior

This is a sample of the errors as-is once a usage test is added (reproduced from my config):

~/p/webpack-plugin-serve ❯❯❯ npm run test:typescript                                                                                                                                                                           ✘ 127 

> webpack-plugin-serve@0.6.0 test:typescript /Users/kross/projects/webpack-plugin-serve
> tslint --project tsconfig.json && tsc

index.d.ts:5:8 - error TS7016: Could not find a declaration file for module 'http-proxy-middleware'. '/Users/kross/projects/webpack-plugin-serve/node_modules/http-proxy-middleware/index.js' implicitly has an 'any' type.
  Try `npm install @types/http-proxy-middleware` if it exists or add a new declaration (.d.ts) file containing `declare module 'http-proxy-middleware';`

5 } from 'http-proxy-middleware';
         ~~~~~~~~~~~~~~~~~~~~~~~

index.d.ts:6:22 - error TS7016: Could not find a declaration file for module 'koa'. '/Users/kross/projects/webpack-plugin-serve/node_modules/koa/lib/application.js' implicitly has an 'any' type.
  Try `npm install @types/koa` if it exists or add a new declaration (.d.ts) file containing `declare module 'koa';`

6 import * as Koa from 'koa';
                       ~~~~~

index.d.ts:28:19 - error TS7006: Parameter 'res' implicitly has an 'any' type.

28     setHeaders?: (res, path, stats) => any;
                     ~~~

index.d.ts:28:24 - error TS7006: Parameter 'path' implicitly has an 'any' type.

28     setHeaders?: (res, path, stats) => any;
                          ~~~~

index.d.ts:28:30 - error TS7006: Parameter 'stats' implicitly has an 'any' type.

28     setHeaders?: (res, path, stats) => any;
                                ~~~~~


Found 5 errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions