TypeStrong / fork-ts-checker-webpack-plugin

Webpack plugin that runs typescript type checker on a separate process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fork-ts-checker-webpack-plugin does not seem use the plugins in the tsconfig.json

wys-evan opened this issue · comments

Current behavior

webpack compiles successfully, but fails to check css module when building.

TS2307: Cannot find module './index.module.less' or its corresponding type declarations.

Expected behavior

Can successfully check the css module

Steps to reproduce the issue

  1. Project's tsconfig.json configuration :
"plugins": [{   
      "name": "typescript-plugin-css-modules",  
      "options": {  
        "customMatcher": "*.module.(c|le|sc)ss$"   
      }
    }],
  1. webpack configuration:
new ForkTsCheckerWebpackPlugin({
         async: false,
         typescript: {
           configFile: path.join(process.cwd(), 'tsconfig.json'),
           configOverwrite: {
             include: [options.packageDir],
           },
           diagnosticOptions: {
             semantic: true,
             syntactic: true,
           },
         },
       })

Issue reproduction repository

Environment

  • fork-ts-checker-webpack-plugin: 7.2.3
  • typescript: 4.7.3
  • eslint: 6.8.0
  • webpack: 5.70.0
  • os: CentOS Linux release 7.2

Unfortunately, TypeScript plugins are supported only in a language service API. I created an issue in TypeScript repo to support plugins in other APIs: microsoft/TypeScript#38736
It seems that TypeScript team has other priorities - my proposal is 2 years old and there is no update.
This plugin supports the same features as tsc - so this behaviour is sadly expected :/