Skip to content

Commit

Permalink
fix Use#end return type in OneOf (neutrinojs#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
bolasblack authored and eliperelman committed Mar 25, 2019
1 parent ff4ef28 commit 66b4650
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ declare namespace Config {

interface LoaderOptions { [name: string]: any; }

class Use extends ChainedMap<Rule> implements Orderable {
class Use<Parent = Rule> extends ChainedMap<Parent> implements Orderable {
loader(value: string): this;
options(value: LoaderOptions): this;

Expand All @@ -264,7 +264,7 @@ declare namespace Config {

class OneOf extends ChainedMap<Rule> implements Orderable {
resourceQuery(value: webpack.Condition | webpack.Condition[]): this;
use(name: string): Use;
use(name: string): Use<this>;

// Orderable
before(name: string): this;
Expand Down
7 changes: 4 additions & 3 deletions types/test/webpack-chain-tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Notes: The order structure of the type check follows the order
* Notes: The order structure of the type check follows the order
* of this document: https://github.com/neutrinojs/webpack-chain#config
*/
import Config = require('webpack-chain');
Expand Down Expand Up @@ -191,7 +191,7 @@ config
.delete('__dirname')
.clear()
.end()

.devServer
.allowedHosts
.add('host.com')
Expand Down Expand Up @@ -282,6 +282,7 @@ config
.use('url')
.loader('url-loader')
.end()
.end()
.oneOfs
.delete('inline')
.end()
Expand All @@ -290,7 +291,7 @@ config
.delete('compile')
.end()
.end()

//** support https://webpack.js.org/configuration/module/#ruletype */
.module
.rule('mjs-compile')
Expand Down

0 comments on commit 66b4650

Please sign in to comment.