Fork-ts-checker-webpack-plugin: eslint: File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Created on 22 Jul 2020  路  2Comments  路  Source: TypeStrong/fork-ts-checker-webpack-plugin

Current behavior

Ignored files in .eslintrc.js are ignored successfully on the initial build. After that if they are changed and a watch build picks them up you get the error:

WARNING in path/file.ts
[unknown]: File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

The files are successfully ignored still - it's just a distracting warning.

Expected behavior

No warnings

Steps to reproduce the issue

// .eslintrc.js
module.exports = {
    ...
    ignorePatterns: ['*/*.ignoreme.ts']
};
// webpack.config.js
modules.exports = {
    plugins: [
        new ForkTSCheckerWebpackPlugin({
            eslint: {
                files: '.',
            },
        }),
    ]
}

Run a watched webpack build. The initial build will run with no warnings. Now update and save test.ignoreme.ts.
You see the warning referred to above.

Environment

  • fork-ts-checker-webpack-plugin: 5.0.6
  • typescript: 3.9.2
  • eslint: 6.8.0
  • webpack: 4.43.0
  • os: Windows 10

Notes

This could possibly be worked around by not including the eslint ignored files in the include patterns for fork-ts-checker-webpack-plugin (or at least ignoring the warnings from the file as per #450).

This seems to be the same issue as #316 which was previously fixed but seems to have been partially reverted in the recent restructuring. If I update the eslint reporter locally like so, I no longer see the error

const changedAndIncludedFiles = changedFiles.filter(
  (changedFile) =>
    includedFilesPatterns.some((includedFilesPattern) =>
      minimatch(changedFile, includedFilesPattern)
    ) &&
    (configuration.options.extensions || []).some((extension) =>
      changedFile.endsWith(extension)
-   )
+   ) &&
+  (!engine.isPathIgnored(changedFile )
);

Happy to drop in a PR if you think this looks reasonable.

bug released

All 2 comments

Thanks for reporting this issue :) Would be great if you could create a PR :)

:tada: This issue has been resolved in version 5.0.13 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings