-
-
Notifications
You must be signed in to change notification settings - Fork 121
eslint-loader doesn't check if additional .eslintrc exists #129
Comments
eslint-loader doesn't load the eslintrc files - it uses an instance of eslint.CLIEngine which the eslint-cli also uses and that should resolve the correct rules for each file itself. I've just tried nested .eslintrc files and it seemed to be working correctly for me. Do you have the eslint-loader cache option enabled? If so then you may be experiencing the problem described in #124 where if you change the eslint rules the previously cached results are still being output. Try setting cache to false and if that fixes the issue you can delete |
Yes. If I disable cache, it doesn't change anything. {
module: {
loaders: [
{
enforce: 'pre',
test: /\.js$/,
loader: 'eslint-loader',
exclude: /node_modules/,
},
],
},
plugins: [
new webpack.LoaderOptionsPlugin({
test: /\.js$/,
options: {
eslint: {
configFile: utils.root('.eslintrc'), // this is my helper for resolving paths
cache: false,
}
},
}),
],
} I'm using also |
Update: If I remove @wrakky https://github.com/hinok/webpack2-eslint-loader npm install
# Run eslint by eslint-cli
npm run lint
# Run webpack2 + eslint-loader
npm start Repository contains |
If you use the The file passed to the Either way this isn't an eslint-loader issue. Hope that helps! |
Yep, that's it. Sorry for the confussion! When I found yesterday that removing configFile solved the problem, I was pretty sure that let's say it's the eslint's fault not eslint-loader - if we could name it as a fault. I close this issue and maybe it's worth to update README? I could add PR if you want. |
PR welcome! |
Added PR #130 |
* MoOx/master: README: Add information about eslint behaviour when configFile is set directly (webpack-contrib#129) (webpack-contrib#130) Add clarifying note to README (webpack-contrib#127) Removed test.only so that all tests will run (webpack-contrib#125) 1.6.1 Fixed: multiples config per instance are now supported (webpack-contrib#123)
I am having a similar problem, can you post your actual config files which resolved your issue? configs:
|
NVM: https://github.com/webpack-contrib/eslint-loader/pull/183/files Use eslintPath with the Seems like defining CLIEngine is overkill. Why is this not wrapped within the code/eslint-loader library itself?
|
The problem can be fixed by adding the option
|
@dualeoo: I still got a same issue with latest eslint-loader and eslint, even when configFile is there |
@midori0507 sr but
|
@dualeoo:
.eslintrc
|
@midori0507 maybe webpack doesn't include files with error in the build. Is it realy used in code? |
In my case the issue was fixed by changing from the old |
eslint
gives ability to overrides rules for specific folders, for example:In my project when I use
eslint
byeslint-cli
I don't get any errors but when I develop and usewebpack
+eslint-loader
, then I get errors.I don't want append
in each file that contains SVG because I have a lot of icons...
Is there any way to instrument this loader to check if additional
.eslintrc
files exists?The text was updated successfully, but these errors were encountered: