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 Proposal: spread-spacing

See original GitHub issue

I’d like to enforce spacing between the spread operator (...) and its expression. I propose calling it spread-spacing

When does this rule warn? Please describe and show example code:

I envision it being configured with strings “always” and “never”.

With “never” (the default):

// Warns
myFunction(... args);

// Does not warn
myFunction(...args);

And vice-versa for “always”

Is this rule preventing an error or is it stylistic?

Stylistic

Why is this rule a candidate for inclusion instead of creating a custom rule?

It seems to fit with the other spacing rules we’ve included in core.

Are you willing to create the rule yourself?

Yes.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
IanVScommented, Feb 25, 2016

I propose this would apply to all forms of rest and spread operators (including experimentalObjectRestSpread). If people want more configurability in the future, it could be expanded with further options for the various cases. But, I don’t see much of a use case for enforcing/prohibiting spaces for certain kinds and not others (although I’m sure someone will want to eventually).

So, maybe the name should be rest-spread-spacing.

1reaction
nzakascommented, Apr 28, 2016

@kaicataldo much appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SEC Proposed Rules
SEC Proposed Rules · Regulation NMS: Minimum Pricing Increments, Access Fees, and Transparency of Better Priced Orders · File No: S7-30-22 · Comments...
Read more >
rest-spread-spacing - ESLint - Pluggable JavaScript Linter
Rule Details. This rule aims to enforce consistent spacing between rest and spread operators and their expressions. The rule also supports object rest...
Read more >
Proposed Rules - GovInfo
Commission has requested comment on a release proposing amendments to its rules under the Securities Act and. Exchange Act that would require.
Read more >
LAND DEVELOPMENT CODE | Code of Ordinances | Venice, FL
A. The Land Development Regulations (LDR) are adopted to be consistent with and implement the City of Venice Comprehensive Plan as it may...
Read more >
Tree and Landscaping Manual | Portland.gov
Tree and Landscaping Regulations of the Zoning Code ... A permit is required in the case where required landscaping is proposed without additional ......
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