From 329e75252a9ccc4192eb920e1bc321d19061f7d8 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Mon, 12 Feb 2018 17:37:32 +0100 Subject: [PATCH] webpack: remove lint overrides --- types/html-webpack-template/index.d.ts | 1 + types/loader-utils/index.d.ts | 4 +++- types/stylelint-webpack-plugin/index.d.ts | 3 ++- types/webpack-fail-plugin/index.d.ts | 1 + types/webpack-merge/v0/index.d.ts | 1 + types/webpack/index.d.ts | 29 +++++++++++++---------- types/webpack/tslint.json | 8 +------ types/webpack/webpack-tests.ts | 15 ++++++++---- 8 files changed, 35 insertions(+), 27 deletions(-) diff --git a/types/html-webpack-template/index.d.ts b/types/html-webpack-template/index.d.ts index f1b57fa331..b02be3c463 100644 --- a/types/html-webpack-template/index.d.ts +++ b/types/html-webpack-template/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jaketrent/html-webpack-template // Definitions by: Benjamin Lim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin'; diff --git a/types/loader-utils/index.d.ts b/types/loader-utils/index.d.ts index a178ada777..37ce2e461f 100644 --- a/types/loader-utils/index.d.ts +++ b/types/loader-utils/index.d.ts @@ -3,9 +3,11 @@ // Definitions by: Gyusun Yeom // Totooria Hyperion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + /// -import { loader } from "webpack"; +import { loader } from 'webpack'; export interface InterpolateOption { context?: string; diff --git a/types/stylelint-webpack-plugin/index.d.ts b/types/stylelint-webpack-plugin/index.d.ts index 580fc4325f..dfaf0a4f05 100644 --- a/types/stylelint-webpack-plugin/index.d.ts +++ b/types/stylelint-webpack-plugin/index.d.ts @@ -2,8 +2,9 @@ // Project: https://github.com/JaKXz/stylelint-webpack-plugin // Definitions by: Arne Bahlo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -import { Plugin } from "webpack"; +import { Plugin } from 'webpack'; export = StylelintWebpackPlugin; diff --git a/types/webpack-fail-plugin/index.d.ts b/types/webpack-fail-plugin/index.d.ts index 04f037e084..2db28733c2 100644 --- a/types/webpack-fail-plugin/index.d.ts +++ b/types/webpack-fail-plugin/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/TiddoLangerak/webpack-fail-plugin // Definitions by: Simon Hartcher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/webpack-merge/v0/index.d.ts b/types/webpack-merge/v0/index.d.ts index a939a2ed53..4cf82afd88 100644 --- a/types/webpack-merge/v0/index.d.ts +++ b/types/webpack-merge/v0/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/survivejs/webpack-merge // Definitions by: Simon Hartcher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index e25adc7e7d..b419efc2ea 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -492,7 +492,7 @@ declare namespace webpack { */ maxEntrypointSize?: number; } - type Stats = webpack.Stats.ToStringOptions; + type Stats = Stats.ToStringOptions; type WatchOptions = ICompiler.WatchOptions; } @@ -542,7 +542,7 @@ declare namespace webpack { type Handler = ICompiler.Handler; type WatchOptions = ICompiler.WatchOptions; - class Watching implements webpack.Watching { + class Watching implements Watching { constructor(compiler: Compiler, watchOptions: Watching.WatchOptions, handler: Watching.Handler); close(callback: () => void): void; @@ -1260,37 +1260,40 @@ declare namespace webpack { /** @deprecated */ namespace compiler { /** @deprecated use webpack.Compiler */ + // tslint:disable-next-line:no-unnecessary-qualifier type Compiler = webpack.Compiler; /** @deprecated use webpack.Compiler.Watching */ - type Watching = webpack.Compiler.Watching; + type Watching = Compiler.Watching; /** @deprecated use webpack.Compiler.WatchOptions */ - type WatchOptions = webpack.Compiler.WatchOptions; + + type WatchOptions = Compiler.WatchOptions; /** @deprecated use webpack.Stats */ + // tslint:disable-next-line:no-unnecessary-qualifier type Stats = webpack.Stats; /** @deprecated use webpack.Stats.ToJsonOptions */ - type StatsOptions = webpack.Stats.ToJsonOptions; + type StatsOptions = Stats.ToJsonOptions; /** @deprecated use webpack.Stats.ToStringOptions */ - type StatsToStringOptions = webpack.Stats.ToStringOptions; + type StatsToStringOptions = Stats.ToStringOptions; /** @deprecated use webpack.Compiler.Handler */ - type CompilerCallback = webpack.Compiler.Handler; + type CompilerCallback = Compiler.Handler; } /** @deprecated use webpack.Options.Performance */ - type PerformanceOptions = webpack.Options.Performance; + type PerformanceOptions = Options.Performance; /** @deprecated use webpack.Options.WatchOptions */ - type WatchOptions = webpack.Options.WatchOptions; + type WatchOptions = Options.WatchOptions; /** @deprecated use webpack.EvalSourceMapDevToolPlugin.Options */ - type EvalSourceMapDevToolPluginOptions = webpack.EvalSourceMapDevToolPlugin.Options; + type EvalSourceMapDevToolPluginOptions = EvalSourceMapDevToolPlugin.Options; /** @deprecated use webpack.SourceMapDevToolPlugin.Options */ - type SourceMapDevToolPluginOptions = webpack.SourceMapDevToolPlugin.Options; + type SourceMapDevToolPluginOptions = SourceMapDevToolPlugin.Options; /** @deprecated use webpack.optimize.UglifyJsPlugin.CommentFilter */ - type UglifyCommentFunction = webpack.optimize.UglifyJsPlugin.CommentFilter; + type UglifyCommentFunction = optimize.UglifyJsPlugin.CommentFilter; /** @deprecated use webpack.optimize.UglifyJsPlugin.Options */ - type UglifyPluginOptions = webpack.optimize.UglifyJsPlugin.Options; + type UglifyPluginOptions = optimize.UglifyJsPlugin.Options; } diff --git a/types/webpack/tslint.json b/types/webpack/tslint.json index 9d2d6ce987..b4b47a0378 100644 --- a/types/webpack/tslint.json +++ b/types/webpack/tslint.json @@ -1,9 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - // TODO - "no-unnecessary-qualifier": false, - "no-void-expression": false, - "space-within-parens": false - } + "extends": "dtslint/dt.json" } diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index d74960e4db..2b0cc516e0 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -509,8 +509,10 @@ declare function successfullyCompiled(): void; webpack({ // configuration }, (err, stats) => { - if (err) - return handleFatalError(err); + if (err) { + handleFatalError(err); + return; + } const jsonStats = stats.toJson(); const jsonStatsWithAllOptions = stats.toJson({ assets: true, @@ -537,10 +539,13 @@ webpack({ excludeAssets: ["filter", "excluded"] }); - if (jsonStats.errors.length > 0) - return handleSoftErrors(jsonStats.errors); - if (jsonStats.warnings.length > 0) + if (jsonStats.errors.length > 0) { + handleSoftErrors(jsonStats.errors); + return; + } + if (jsonStats.warnings.length > 0) { handleWarnings(jsonStats.warnings); + } successfullyCompiled(); });