Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-newline-after-if-condition

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-newline-after-if-condition

Enforce new line after if condition

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
decreased by-82.14%
Maintainers
1
Weekly downloads
 
Created
Source

Newline after if condition (newline-after-if-condition)

Usage

.eslintrc.js

{
	/* ... */
	plugins: ['newline-after-if-condition'],
	rules: {
		/* ... */
		'newline-after-if-condition/rule': ['error']
	}
}

Rule Details

This rule enforces line breaks after if condition

Examples of incorrect code for this rule:


if(true) console.log('if');
if(true) { console.log('if') }

if(true) console.log('if');
else console.log('else');

if(true)

	console.log('if');

Examples of correct code for this rule:


if(true)
	console.log('if');

if(true) {
	console.log('if');
}

if(true) {

	console.log('if');
}

if(true)
	console.log('if');
else console.log('else');

if(true)
	console.log('if');
else 
	console.log('else');

When Not To Use It

When you don't want to enforce newline after if condition

Keywords

FAQs

Package last updated on 30 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc