Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. #485

Closed
andyrooger opened this issue Jul 22, 2020 · 2 comments · Fixed by #491
Closed

Comments

@andyrooger
Copy link
Contributor

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.

@andyrooger andyrooger added the bug label Jul 22, 2020
@piotr-oles
Copy link
Collaborator

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

andyrooger added a commit to andyrooger/fork-ts-checker-webpack-plugin that referenced this issue Jul 29, 2020
Filter out files ignored by the eslint config when linting on watched builds.
Before this, ignored files would still be passed to the linter when changed and would trigger warnings in webpack.

Closes TypeStrong#485
piotr-oles pushed a commit that referenced this issue Jul 31, 2020
Filter out files ignored by the eslint config when linting on watched builds.
Before this, ignored files would still be passed to the linter when changed and would trigger warnings in webpack.

Closes #485
@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 5.0.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants