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

Bad type declaration in "clean-webpack-plugin.d.ts" #193

Open
AxelEric opened this issue Dec 20, 2020 · 1 comment
Open

Bad type declaration in "clean-webpack-plugin.d.ts" #193

AxelEric opened this issue Dec 20, 2020 · 1 comment

Comments

@AxelEric
Copy link

Issue description or question

clean-webpack-plugin.d.ts

  • have a wrong type declaration due to a bad use of ´import´ syntax.

    Your code ...

import { Compiler, Stats, compilation as compilationType } from 'webpack';
declare type Compilation = compilationType.Compilation;
  • This give a type any to your Declared tyoe Compilation.

    Correction proposal ...

import { Compiler, Stats, Compilation as CompilationType } from 'webpack';
declare type Compilation = CompilationType;
  • Another way is to, simpy forget your Type declaration ...
import { Compiler, Stats, Compilation } from 'webpack';
...//...
handleInitial(compilation: typeof Compilation): void;
  • I'm not even sure 'typeof' is needed ...

Webpack Config

Not usefull

Environment

  • For the fun ...
  System:
    OS: Windows 10 10.0.17763
    CPU: (8) x64 Intel(R) Core(TM) i7 CPU         960  @ 3.20GHz
    Memory: 11.54 GB / 15.99 GB
  Binaries:
    Node: 14.11.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - D:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    clean-webpack-plugin: ^3.0.0 => 3.0.0
    webpack: ^5.11.0 => 5.11.0

Keep smyling

AxelEric.

@djcsdy
Copy link

djcsdy commented Feb 10, 2021

Note this is due to incompatibility with the type declarations provided by webpack 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants