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.

--config cannot point to a package.json

See original GitHub issue

Currently, if a config file is passed explicitly, and that config file is a package.json, the contents of the package.json file are loaded instead of a single property within it.

https://github.com/davidtheclark/cosmiconfig/blob/334065d9f7b557170a38b3f920bf5e90cecfab72/lib/createExplorer.js#L30-L39

Would it make sense to have a special case for package.json that calls loadPackageProp instead?

Context: https://github.com/prettier/prettier/issues/2704

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
azzcommented, Sep 5, 2017

Can do!

0reactions
sudo-suhascommented, Sep 5, 2017

@azz Would it be possible for you to make a PR for this change?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot read config file: X:\package.json - Stack Overflow
The eslint server is able to run but it could not read the package.json file from the current root folder. Instead it tries...
Read more >
package.json has problems with '--config' · Issue #2704 - GitHub
Say I have this file structure: /path/to/project package.json /tmp ... --config cannot point to a package.json davidtheclark/cosmiconfig#79.
Read more >
package.json - npm Docs
Files included with the "package.json#files" field cannot be excluded ... The main field is a module ID that is the primary entry point...
Read more >
Main property in package.json defines package entry point
First, Node looks for a package.json file and checks if it contains a main property. It will be used to point a file...
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
In a package's package.json file, two fields can define entry points for a package: "main" and "exports" . Both fields apply to ...
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