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.

[Help Request] Semicolon placement configuration

See original GitHub issue

I have some problem with placement of semicolon in multyline call chain: I want to place semicolon in the new line after call chain. (I don’t found resolves of my problem in docs)

For example, lets look for next code:

const arr = [];

// Inline style:
arr.map(x => x).filter(x => x).sort((a, b) => (a >= b) * 2 - 1);

// My style:
arr
   .map(x => x)
   .filter(x => x)
   .sort((a, b) => (a >= b) * 2 - 1)
; // << Semicolon placement here (in my sweet dreams)

// ESLint fixer result:
arr
   .map(x => x)
   .filter(x => x)
   .sort((a, b) => (a >= b) * 2 - 1); // << Semicolon placement here, but I didn't want this end
  • ESLint Version: 4.19.0
  • Node Version: 8.9.1
  • npm Version: 5.5.1

What parser (default, Babel-ESLint, etc.) are you using? babel-eslint / 8.2.2

Does ESLint have rule for setting this behavior? Otherwise whether can you add it?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ilyavolodincommented, Apr 22, 2018

As far as I know, ESLint doesn’t have rule for something like this. However, you can definitely create one yourself for this style. I don’t think this style is prevalent enough to include something like this in the core, but that’s why ESLint allows you to create your own plugins.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring ESLint Semi-Colons Rule - Carl de Souza
In this post, we will look at configuring the ESLint semi-colon rule. ... with it using the automatic semicolon insertion feature, or ASI....
Read more >
Semicolon Usage Rules (Video) - Mometrix Test Preparation
This video tutorial helps explain the basics of Semicolon Usage. Get the best test prep review for your exam!
Read more >
Semicolon | Effective Writing Practices Tutorial
Use a semicolon to join two related independent clauses in place of a comma and a coordinating conjunction.
Read more >
How to add semicolon to the end of the line in visual studio code
Now there is an extension called Colonize: Shift + Enter Insert semicolon at the end of line and continue on the same line....
Read more >
Using Commas, Semicolons, and Colons Within Sentences
Rule 1. Use a semicolon in place of a period to separate two sentences where the conjunction has been left out. Examples: Call...
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