Skip to content

Commit 510bde4

Browse files
authored
chore: import webpack using "* as webpack" syntax (#780)
Avoids problems like the following: ``` $ npx tsc node_modules/fork-ts-checker-webpack-plugin/lib/plugin.d.ts:1:13 - error TS1259: Module '".../node_modules/webpack/types"' can only be default-imported using the 'allowSyntheticDefaultImports' flag 1 import type webpack from 'webpack'; ~~~~~~~ node_modules/webpack/types.d.ts:13189:1 13189 export = exports; ~~~~~~~~~~~~~~~~~ This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag. Found 1 error in node_modules/fork-ts-checker-webpack-plugin/lib/plugin.d.ts:1 ```
1 parent d461689 commit 510bde4

15 files changed

+15
-15
lines changed

src/hooks/intercept-done-to-get-dev-server-tap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type webpack from 'webpack';
1+
import type * as webpack from 'webpack';
22

33
import { getInfrastructureLogger } from '../infrastructure-logger';
44
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';

src/hooks/tap-after-compile-to-add-dependencies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type webpack from 'webpack';
1+
import type * as webpack from 'webpack';
22

33
import { getInfrastructureLogger } from '../infrastructure-logger';
44
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';

src/hooks/tap-after-compile-to-get-issues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type webpack from 'webpack';
1+
import type * as webpack from 'webpack';
22

33
import { getInfrastructureLogger } from '../infrastructure-logger';
44
import type { Issue } from '../issue';

src/hooks/tap-after-environment-to-patch-watching.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type webpack from 'webpack';
1+
import type * as webpack from 'webpack';
22

33
import { getInfrastructureLogger } from '../infrastructure-logger';
44
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';

src/hooks/tap-done-to-async-get-issues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import chalk from 'chalk';
2-
import type webpack from 'webpack';
2+
import type * as webpack from 'webpack';
33

44
import { statsFormatter } from '../formatter/stats-formatter';
55
import { createWebpackFormatter } from '../formatter/webpack-formatter';

src/hooks/tap-error-to-log-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import chalk from 'chalk';
2-
import type webpack from 'webpack';
2+
import type * as webpack from 'webpack';
33

44
import type { ForkTsCheckerWebpackPluginConfig } from '../plugin-config';
55
import { getPluginHooks } from '../plugin-hooks';

src/hooks/tap-stop-to-terminate-workers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type webpack from 'webpack';
1+
import type * as webpack from 'webpack';
22

33
import { getInfrastructureLogger } from '../infrastructure-logger';
44
import type { ForkTsCheckerWebpackPluginState } from '../plugin-state';

src/infrastructure-logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type webpack from 'webpack';
1+
import type * as webpack from 'webpack';
22

33
export interface InfrastructureLogger {
44
log(...args: unknown[]): void;

src/issue/issue-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type webpack from 'webpack';
1+
import type * as webpack from 'webpack';
22

33
import { createIssuePredicateFromIssueMatch } from './issue-match';
44
import type { IssuePredicateOption, IssueOptions } from './issue-options';

src/issue/issue-webpack-error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'path';
22

33
import chalk from 'chalk';
4-
import webpack from 'webpack';
4+
import * as webpack from 'webpack';
55

66
import type { FormatterPathType } from '../formatter';
77
import { forwardSlash } from '../utils/path/forward-slash';

0 commit comments

Comments
 (0)