Configurations in upper folders are always ignored
See original GitHub issueTell us about your environment
- ESLint Version: 4.16.0
- eslint-plugin-vue Version: 4.2.0
- Node Version: 6.8.1
Please show your full configuration:
Say, I have this setting: (modified from ESLint configuration cascading example)
your-project
├── .eslintrc.yaml // (A)
└── app
├── source.js
└─┬ vue_components
├── .eslintrc.yaml // (B)
└─ foo.vue
And in (A), I set
root: true
rules:
semi:
- error
- always
In (B):
extends:
- plugin:vue/essential
What did you do? Please include the actual source code causing the issue.
In foo.vue:
<script>
console.log(hi) // no semi
</script>
What did you expect to happen?
ESLint should report error about “Missing semicolon”
What actually happened? Please include the actual, raw output from ESLint.
ESLint considered everything fine and output nothing.
I traced the flow of ESLint, and found that the root: true
in config/base.js
which comes from update-lib-config.js resulting the very config file including “pulgin: vue” would be considered root
and thus making ESLint ignore any config file in upper directories. In my example, the config of semi: always
is ignored.
Because we are adopting Vue gragually, we want this kind of configuration. A root: false
in (B) could work, but I think root: true
should be used in the project config file, since providing it from a ESLint plugin only causes confusion. (Maybe ESLint should block this?)
I did search through the issues and did not find reports about this, but if I just missed it, please accept my apology, and close this issue.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7 (1 by maintainers)
Top GitHub Comments
Thank you for this issue.
Sounds good to me. We have
root:true
in the base config since the first time, but it seems confusing. However, the change of configs needssemver-major
in our policy, so we consider it on the next major release.For now, please use
root: false
.+1, just ran into this based on a setup from the webpack vue template. Passing
--debug
to eslint makes it very easy to see which configuration files are being considered.