I am using TypeScript to write some default configurations. When I import with import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";, the line const forkTypeCheckingPlugin = new ForkTsCheckerWebpackPlugin() is showing me some eslint issues from my IDE (using tsconfig.esm.json from the gist below).
new is shown as being ESLint: Unsafe construction of an any type value.(@typescript-eslint/no-unsafe-call)
forkTypeCheckingPlugin is shown as being ESLint: Unsafe assignment of ananyvalue.(@typescript-eslint/no-unsafe-assignment)
When compiling with TSC, I get Module [fork-ts-checker-webpack-plugin] can only be default-imported using the 'esModuleInterop' flag (using tsconfig.cjs.json from the gist below).
When I import using import { ForkTsCheckerWebpackPlugin } from "fork-ts-checker-webpack-plugin/lib/plugin.js"; I have no more issues.
Expected behavior
No issues shown either on IDE or tsc when using the import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import statement when creating TypeScript package, using the most recent versions and configurations (TS 5, module resolution node16, etc.).
⚠ It might be a misconfiguration on my side for the IDE, even though I would prefer to no change any behavioral configuration such as esModuleInterop or verbatimModuleSyntax.
Steps to reproduce the issue
Using configuration shown in gist below,
Import using import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";.
Create instance using const forkTypeCheckingPlugin = new ForkTsCheckerWebpackPlugin().
Current behavior
I am using TypeScript to write some default configurations. When I import with
import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
, the lineconst forkTypeCheckingPlugin = new ForkTsCheckerWebpackPlugin()
is showing me some eslint issues from my IDE (usingtsconfig.esm.json
from the gist below).new
is shown as beingESLint: Unsafe construction of an any type value.(@typescript-eslint/no-unsafe-call)
forkTypeCheckingPlugin
is shown as beingESLint: Unsafe assignment of an
anyvalue.(@typescript-eslint/no-unsafe-assignment)
When compiling with TSC, I get
Module [fork-ts-checker-webpack-plugin] can only be default-imported using the 'esModuleInterop' flag
(usingtsconfig.cjs.json
from the gist below).When I import using
import { ForkTsCheckerWebpackPlugin } from "fork-ts-checker-webpack-plugin/lib/plugin.js";
I have no more issues.Expected behavior
No issues shown either on IDE or
tsc
when using theimport ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
import statement when creating TypeScript package, using the most recent versions and configurations (TS 5, module resolution node16, etc.).⚠ It might be a misconfiguration on my side for the IDE, even though I would prefer to no change any behavioral configuration such as
esModuleInterop
orverbatimModuleSyntax
.Steps to reproduce the issue
Using configuration shown in gist below,
import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
.const forkTypeCheckingPlugin = new ForkTsCheckerWebpackPlugin()
.Issue reproduction repository
https://gist.github.com/sharky98/94ac3a661e2862c5df5108152a00efd4
Environment