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 for spaces around "=" character

See original GitHub issue

I looked through the available rules but I can’t seem to find how to enforce having spaces around a = character.

This should give a warning: const my_object={key: 'value'};

This should not give a warning and should be considered valid: const my_object = {key: 'value'};

Is there already a rule to enforce this?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:22 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
BYKcommented, Aug 12, 2015

@IanVS - I think it was automatic and it kind of addresses the original issue since space-infix-ops covers that case already.

0reactions
IanVScommented, Aug 12, 2015

@ilyavolodin did you mean to close this issue from https://github.com/eslint/eslint/commit/ba818eee0fd69a50abe6289ae27b7ae4248c733d? It seems like maybe that should have been a (refs #2399).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Space (punctuation) - Wikipedia
In writing, a space ( ) is a blank area that separates words, sentences, syllables (in syllabification) and other written or printed glyphs...
Read more >
How to make letter spacing css rule add space around ...
In css letter-spacing rule, the rule adds space after the character. Now I want to make the space to surround the character instead....
Read more >
Formatting - Coding Style - Read the Docs
Each line of text in your code should be at most 80 characters long. ... NO spaces around the . and -> structure...
Read more >
Whitespace · Styleguide JavaScript
Indentation Character · Before Blocks · Around Keywords · Infix Operator Spacing · Newline · Chains · After Blocks · Padded Blocks.
Read more >
Rules of Punctuation and Spacing - The Classroom
Some special characters do not require a space between them and the word that follows, while others do. For example, a number sign...
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