question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eslint --print-config no longer works when given a directory

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
mysticateacommented, Jun 23, 2019

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.

1reaction
mensfeldcommented, Jun 22, 2019

I have a similar problem, despite having proper packages in place:

Oops! Something went wrong! :(

ESLint: 6.0.0.
ESLint couldn't find the config "airbnb" to extend from. Please check that the name of the config is correct.

If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Why does "eslint --print-config blah.js > outfile.json" result in ...
It seems that this is a bug in ESLint v7.3.0. A temporary fix would be to downgrade ESLint to v7.2.0 - "eslint": "^7.3.0"...
Read more >
eslint/eslint - Gitter
Has anyone reported an issue with .eslintrc.js globals not working in a ... now that I can't extend root and still override it...
Read more >
xo-browser-focused-fork - npm
Opinionated but configurable ESLint wrapper with lots of goodies included. Enforces strict and readable code. Never discuss code style on a ...
Read more >
Local Install of ESLint Breaks In-Editor Linting
The ESLint CLI still functions as it should and the issue is not ... I'm going to do some more research but may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found