eslint: eslint --print-config no longer works when given a directory
Tell us about your environment
- ESLint Version: v6.0.0
- Node Version: v11.15.0
- npm Version: 6.9.0
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true
},
extends: [
'standard',
'plugin:vue/recommended',
'prettier',
'prettier/babel',
'prettier/standard',
'prettier/vue'
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: ['babel', 'prettier', 'standard', 'vue'],
rules: { 'prettier/prettier': 'error' }
};
$ cd /home/user/www/project && yarn run eslint --print-config .
What did you expect to happen? Printing config
What actually happened? Please include the actual, raw output from ESLint. Looks in upper path instead of current.
Oops! Something went wrong! :(
ESLint: 6.0.0.
ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:
eslint --init
ESLint looked for configuration files in /home/user/www and its ancestors.
Project path is located at /home/user/www/project
.
Are you willing to submit a pull request to fix this bug? No, sorry.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (10 by maintainers)
Commits related to this issue
- Fix: improve error message on --print-config (fixes #11874) — committed to eslint/eslint by mysticatea 5 years ago
- Fix: improve error message on --print-config (fixes #11874) (#11885) — committed to eslint/eslint by mysticatea 5 years ago
- Fix usage of --print-config since it no longer supports directories Plus we were using it weirdly before. See: https://github.com/eslint/eslint/issues/11874 — committed to neutrinojs/neutrino by edmorley 5 years ago
Since v4.1.0, ESLint has supported glob-based configuration. So
--print-config
with a directory path doesn’t make sense anymore. Configurations are not per directory.And the document says requiring a file path and print the configuration for linting the given file. I think that the solution is a better error message when a directory path was given.
I have a similar problem, despite having proper packages in place: