Hi 馃憢 ! Thanks for continuing to improve this plugin.
I discovered a place for potential improvement in the docs after upgrading from v4 to v5 that i suspect a number of folks may run into.
The minimal configuration recommended is as such:
new ForkTsCheckerWebpackPlugin({
eslint: {
files: './src/**/*' // required - same as command `eslint ./src/**/* --ext .ts,.tsx,.js,.jsx`
}
})
The current recommendation to use files: "./src/**/*" causes issues in common webpack project setups. The docs say:
same as command
eslint ./src/**/* --ext .ts,.tsx,.js,.jsx
But i don't believe to be the case without explicitly specifying the extensions. Perhaps the recommendation should include the extensions by default?
The recommendation is also missing the enabled: true option. I expected the linter to be enabled when specifying the eslint object.
The plugin provides some recommendations for projects that use CSS and other types of file loaders, and also includes enabled: true in the example if it's expected.
Import a .css file in a project with a CSS loader configured. Observe the error with the recommended files configuration:
ERROR in src/components/Foo/Foo.css
[unknown]: Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: src/components/Foo/Foo.css.
The extension for the file (.css) is non-standard. You should add "parserOptions.extraFileExtensions" to your config.
Changing files to be configured as follows seems to solve the issue in my case:
files: "./src/**/*.{js,jsx,ts,tsx}"
Thanks for the recommendation @ianschmitz! What do you think @piotr-oles ?
@johnnyreilly note that i edited my OP and included a note about the enabled property.
Thanks for reporting this issue. I've created a PR to fix it :)
:tada: This issue has been resolved in version 5.0.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Most helpful comment
Thanks for reporting this issue. I've created a PR to fix it :)