Fork-ts-checker-webpack-plugin: 5.0.1: The "files" glob patterns is not working properly

Created on 17 Jun 2020  ·  2Comments  ·  Source: TypeStrong/fork-ts-checker-webpack-plugin

Current behavior

For version4, I use "reportFiles" to ignore some unuseful “.ts” or ".tsx" files, this plugin works normaly.

reportFiles: ['./src/**/*.{ts,tsx}', '!src/ts/**/*.{ts,tsx}']

For version5, I use "eslint" -> "files" to ignore same files.

For example:

files: ['./src/**/*.{ts,tsx}', '!src/ts/**/*.{ts,tsx}']

But this plugin throws an error:

Error: No files matching 'D:/GitHub/code-twitter/!src/ts/**/*.{ts,tsx}' were found.

It seems like a path, not glob patterns.
Is this a normal behavior?

Sorry for my bad english.

Expected behavior

The "files" option should ignore files properly.

Steps to reproduce the issue

*

Issue reproduction repository

*

Environment

  • fork-ts-checker-webpack-plugin: 5.0.1
  • typescript: 3.9.5
  • eslint: 7.2.0
  • webpack: 4.43.0
  • os: Windows 10 1909
bug

Most helpful comment

The files parameter works inclusive - not exclusive. If some of the patterns don't resolve to existing files, eslint will throw an error (it behaves the same as eslint command).

If you want to mimic the behavior of reportFiles, you can use issue option:

  issue: {
    exclude: [
      {
        origin: 'eslint',
        file: 'src/ts/**/*.{ts,tsx}'
      }
    ]
  }

All 2 comments

The files parameter works inclusive - not exclusive. If some of the patterns don't resolve to existing files, eslint will throw an error (it behaves the same as eslint command).

If you want to mimic the behavior of reportFiles, you can use issue option:

  issue: {
    exclude: [
      {
        origin: 'eslint',
        file: 'src/ts/**/*.{ts,tsx}'
      }
    ]
  }

It works now, thanks.

Was this page helpful?
0 / 5 - 0 ratings