[Help Request] Semicolon placement configuration
See original GitHub issueI 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:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@Daniil-Pabolkov This might be what you are looking for https://github.com/justinanastos/eslint-plugin-justinanastos/blob/master/docs/rules/chained-semi.md