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.

Proposal `extends` to support loading from module with `module:foobar`

See original GitHub issue

The version of ESLint you are using. No matter of the version. But v4+

The problem you want to solve. Shareable configs is awesome. But sometimes you don’t want to create separate package and seaprate repository. Consider you are creating a linter CLI and there you put both the CLI logic and the config. You want one repo and one package, but you are using the CLI only when you are on the terminal and you are relying on the eslintConfig.extends when you are on the editor.

Currently you should do eslintConfig.extends: "./node_modules/foobar/index.js". Another way would be to create monorepo (and possibly use “fixed versioning”), but it still sounds “too much” and you may not want and not like to maintain monorepos.

https://twitter.com/tunnckoCore/status/1016441022329622534

Your take on the correct solution to problem.

https://twitter.com/tunnckoCore/status/1016444573420269568

The easiest way would be if we add one more else if check here (lib/util/naming.js#L56-L58) like

if (normalizedName.startsWith('module:')) {
  normalizedName = normalizedName.slice(7)
}

It’s the same like plugin:, but only working for configs?

Not sure if there is another place to change. I’m assuming that this normalizedName is later just required?

Wanna PR?

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
not-an-aardvarkcommented, Jul 11, 2018

In general, even small add-ons to a design can result in significant maintenance costs in the long term. When an existing feature such as extends: has many different functionalities, it can be much more difficult to expand or refactor the design of that feature in the future while still maintaining compatibility and coherence with all existing use cases.

It also might turn out later that we misjudged the problem that we were trying to solve, so what appears to be a small feature right now might need to become much more complex in order to adequately solve the problem. Or we might have failed to consider a given aspect of a feature thoroughly and made the wrong choice about how it should behave, resulting in a confusing behavior for users that we would be unable to change without breaking compatibility.

My personal view on software library design is that adding features should not be done lightly – it should only be done when there is a very compelling motivation. I don’t think saving a few characters in this case is sufficiently compelling.

3reactions
kaicataldocommented, Jul 10, 2018

I’m still not convinced the maintenance burden/added config complexity is worth the slight convenience of this feature, since we can already point it directly to a module as noted in the original comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create reusable infrastructure with Terraform modules
With Terraform, you can put your code inside of a Terraform module and reuse that module in multiple places throughout your code.
Read more >
Create geoprocessing modules—ArcGIS Pro | Documentation
Extend Python packages with custom geoprocessing functionality for distribution as ArcGIS system toolboxes.
Read more >
P0986R0: Comparison of Modules Proposals
This paper provides a comparison of the modules design in P0947R0 to the ... The Atom proposal extends modular semantics to legacy headers, ......
Read more >
Description of the cmsRun Python Configuration Syntax
A Python configuration program specifies which modules, inputs, ... When the process load function or the process extend function is used to ...
Read more >
Writing Modular JavaScript With AMD, CommonJS & ES ...
The module loader proposed describes a dynamic API for loading modules in highly controlled contexts. Signatures supported on the loader include load( url, ......
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