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.

Rule Improvement for maps - dollar-variable-colon-newline-after

See original GitHub issue

Currently enabling dollar-variable-colon-newline-after errors for:

$map: (
  foo: value,
  bar: value,
);

Though it’s nice and readable.

To fix it I’m forced to write:

$map: 
  (
    foo: value,
    bar: value,
  );

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:23 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
levaciccommented, Mar 18, 2018

This fix works great, but I’ve now discovered another use-case which I haven’t noticed before - function calls. I would like the following to be valid:

$foo: someFunction(
  bar: baz,
  qux: quux
);

It’s a multi-line variable declaration, and isn’t a map (which this issue is about), but it’s a similar situation in spirit - moving the function call to the next line seems like it would decrease readability, rather than increase it.

What do you think about this? I see how these exceptions are only making the rule more complicated, but maybe an alternate approach would make sense, ie. whitelisting what the rule is about - personally, I (think I) only care about this rule when using lists as the variable value.

2reactions
kristerkaricommented, Mar 18, 2018

What do you think about this? I see how these exceptions are only making the rule more complicated, but maybe an alternate approach would make sense, ie. whitelisting what the rule is about - personally, I (think I) only care about this rule when using lists as the variable value.

Hmm… yeah it seem that we would need more exceptions to the rule, maybe we should start thinking of putting the exceptions behind an option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rule Improvement for maps - dollar-variable-colon-newline-after
Currently enabling dollar-variable-colon-newline-after errors for: $map: ( foo: value, bar: value, ); Though it's nice and readable.
Read more >
Improve data quality with attribute rules - Learn ArcGIS
Improve data quality with attribute rules. Create three types of attribute rules in ArcGIS Pro to accurately collect and maintain street light data....
Read more >
Fiscal Rules Dataset - International Monetary Fund
What are Fiscal Rules? A fiscal rule is a long-lasting constraint on fiscal policy through numerical limits on budgetary aggregates. Fiscal rules typically ......
Read more >
The Two Rules of Process Mapping - Accelerate
The Two Rules of Process Mapping. Process mapping is easy. But also hard. This is a common conundrum with value improvement.
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