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.

Local Config File Resolution throw error in file protocol

See original GitHub issue

https://cn.eslint.org/docs/developer-guide/shareable-configs#local-config-file-resolution

I create my config @scope/eslint-config-myconfig in local, and install it by npm install file:../eslint-config-myconfig

eslint-config-myconfig

// index.js
module.exports = {
  parser: 'babel-eslint',
  extends: ['./base.js'],
};

// base.js
module.exports = {
  extends: ['other-config'],
  rules: {
  },
};

// vue.js
module.exports = {
  extends: ['@scope/eslint-config-myconfig', 'plugin:vue/essential'],
  rules: {
  },
};

project-1

module.exports = {
  extends: '@scope/eslint-config-myconfig/vue'
};

when i run eslint src, it throw error

Oops! Something went wrong! :(

ESLint: 7.1.0

ESLint couldn't find the config "@scope/eslint-config-myconfig" to extend from. Please check that the name of the config is correct.

The config "@scope/eslint-config-myconfig" was referenced from the config file in "/Users/my/scope/eslint-config-myconfig/vue.js".

If you still have problems, please stop by https://eslint.org/chat to chat with the team.

but it succeed after published to npm

Tell us about your environment

  • ESLint Version: 7.1.0
  • Node Version: 10.16.3
  • npm Version: 6.11.3

Resolved

I used extends: ['./base'] to resolved it, but i diff to document

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mysticateacommented, May 26, 2020

throw error Error: Cannot find module ‘@scope/eslint-config-myconfig’, maybe it load from eslint-config-myconfig/node_modules

OK, so this is the designed behavior. You have to write eslint-config-myconfig as working fine with this behavior.

I’m not familiar with lerna, so I mention another solution: I guess you can use extends:"./index.js" or something like instead of extends:"@scope/eslint-config-myconfig", because require("./index.js") in the vue.js should work fine.

0reactions
eslint-deprecated[bot]commented, Aug 26, 2020

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that accepted issues failing to be implemented after 90 days tend to never be implemented, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ExpressJs is return error `ERR_MODULE_NOT_FOUND` if I ...
If someone is still searching, I got this error using node version 15, I was importing the files without the .js file extension, ......
Read more >
Error message definitions for WebSphere® Application ... - IBM
Cause: AS400 only: configuration file name not specified. Resolution: Specify file name in web server configuration. Message: ws_common: ...
Read more >
Configuration options | Yarn - Package Manager
List of all the configuration option for Yarn (yarnrc files) ... If throw (the default), Yarn will throw an exception on yarn install...
Read more >
How to Resolve the "Temporary failure in name resolution" Error
The "Temporary failure in name resolution" error appears due to bad system configuration. This article shows how to troubleshoot and fix it.
Read more >
git-config Documentation - Git
This command will fail with non-zero status upon error. Some exit codes are: ... --local. For writing options: write to the repository .git/config...
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