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.

[6.7] running eslint through npm script throws error.

See original GitHub issue

I don’t experience the issue when using eslint v6.6.x.

I have the following script in my package.json:

  "scripts": {
    "lint": "eslint ."

If I run eslint . directly in the console it works correctly, but when I run npm run lint, it throws an error. It seems like it’s using the wrong config?

ESLint: 6.7.1.

ESLint couldn't find the config "adpyke-es6" to extend from. Please check that the name of the config is correct.

The config "adpyke-es6" was referenced from the config file in "C:\Users\pykea\.eslintrc".

If you still have problems, please stop by to chat with the team.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

mysticateacommented, Nov 27, 2019

Side note: As you may know, we have deprecated the config files in HOME directory. The error of this issue looks like thrown from unused config files in HOME directory (because it should not work since ESLint 6.0.0, I guess that you have not used it while a time), therefore I’d like to recommend to remove it.

mysticateacommented, Nov 26, 2019

Ah, OK, I have found what it happens. Thank you for providing the information.

This happens under the following conditions:

  1. You have ESLint config in your HOME directory, but the config doesn’t work because of lacking dependencies in your HOME directory. (this behavior has been same since 6.0.0)
  2. You have ESLint config in your project directory as well and it works well.
  3. You started linting with the project directory itself (i.e., eslint .).

In the situation, first, ESLint has checked if the directory is ignored or not. Previously this process loads only .eslintignore. But since 6.7.0, this process additionally loads config files from the directory that the project directory exists because it uses ignorePatterns property of config files. If config files were not found in the directory that the project directory exists, it loads the config file in the HOME directory.

I think it’s not intuitive if eslint . command loads config files from outside of the project directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while npm run build? eslint package error - Stack Overflow
There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you...
Read more >
eslint/eslint - Gitter
I am having an issue with ESLint while deploying my react app to Heroku. I am getting this error "Oops! Something went wrong!...
Read more >
ESLint Error at npm start --open - Material Design for Bootstrap
Hello, im getting the following error when im afther unzipping the folder and running npm start --open. " ERROR Failed to compile with...
Read more >
NPM — How to Run ESLint --fix From npm Script - Future Studio
This tutorial shows you how to run ESLint with the --fix flag from an NPM script. NPM Quick Tips Series Overview. NPM Quick...
Read more >
eslint-config-prettier | Yarn - Package Manager
Turns off all rules that are unnecessary or might conflict with [Prettier]. This lets you use your favorite shareable config without letting its...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found