I'm using ts-loader and fork-fs-checker-webpack-plugin in a project, and it's complaining about node_modules/@types
, for example:
ERROR in D:/temp/temp-vscode/temp-electron/application-volume- change/node_modules/@types/react/index.d.ts
ERROR in D:/temp/temp-vscode/temp-electron/application-volume-change/node_modules/@types/react/index.d.ts(2288,19):
TS2320: Interface 'Element' cannot simultaneously extend types 'ReactElement<any>' and 'ReactElement<any>'.
Named property 'type' of types 'ReactElement<any>' and 'ReactElement<any>' are not identical.
And also about it
, describe
, expect
, etc. with errors such as:
TS2304: Cannot find name 'describe'.
TS2304: Cannot find name 'expect'.
I have tried to exclude the directories in tsconfig.json
:
"exclude": [
"node_modules",
"node_modules/@types"
]
And (part of) my webpack.config
:
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
...
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
happyPackMode: true,
},
},
],
},
]
...
plugins: [
new ForkTsCheckerWebpackPlugin()
]
Versions:
"webpack": "^4.16.0"
"ts-loader": "^4.4.2"
"fork-ts-checker-webpack-plugin": "^0.4.3"