New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-strict-newline

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-strict-newline - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

CHANGELOG.md

21

lib/rules/strict-newline.js

@@ -7,3 +7,3 @@ 'use strict';

var sourceCode = context.getSourceCode();
// Cache comments by start line

@@ -22,6 +22,21 @@ var comments = context.getAllComments().reduce(function (result, token) {

var i;
var nodeBodyLength;
var bodyToCheck;
for (i = 0; i < node.body.length; i++) {
token = node.body[i];
// add IIFE support
if (node.body.length === 1
&& node.body[0].type === 'ExpressionStatement'
&& node.body[0].expression.type === 'CallExpression'
&& node.body[0].expression.callee.type === 'FunctionExpression'
&& node.body[0].expression.callee.body.type === 'BlockStatement'
) {
bodyToCheck = node.body[0].expression.callee.body.body;
}
else {
bodyToCheck = node.body;
}
for (i = 0, nodeBodyLength = bodyToCheck.length; i < nodeBodyLength; i++) {
token = bodyToCheck[i];
if (

@@ -28,0 +43,0 @@ token.type === 'ExpressionStatement'

14

package.json
{
"name": "eslint-plugin-strict-newline",
"version": "1.0.0",
"version": "1.1.0",
"description": "ESLint plugin that provides a rule for newline spacing around 'use strict'",
"author": "Tim Oram @MitMaro <mitmaro@gmail.com>",
"author": "Tim Oram <mitmaro@gmail.com>",
"contributors": [
"Tim Oram <<mitmaro@gmail.com>",
"Arno Chauveau <arno.chaveau@delen.be>"
],
"main": "index.js",

@@ -23,5 +27,5 @@ "engines": {

"eslint": "^2.9.0",
"coveralls": "2.11.9",
"istanbul": "0.4.3",
"mocha": "2.4.5"
"coveralls": "2.11.11",
"istanbul": "0.4.4",
"mocha": "2.5.3"
},

@@ -28,0 +32,0 @@ "keywords": [

@@ -5,4 +5,5 @@ # ESLint Strict Newline Plugin

[![Build Status](https://travis-ci.org/MitMaro/eslint-plugin-strict-newline.svg?branch=master)](https://travis-ci.org/MitMaro/eslint-plugin-strict-newline)
[![Coverage Status](https://coveralls.io/repos/MitMaro/eslint-plugin-strict-newline/badge.svg?branch=master)](https://coveralls.io/r/MitMaro/eslint-plugin-strict-newline?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/MitMaro/eslint-plugin-strict-newline/badge.svg?branch=master)](https://coveralls.io/github/MitMaro/eslint-plugin-strict-newline?branch=master)
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-strict-newline.svg)](https://www.npmjs.com/package/eslint-plugin-strict-newline)
[![GitHub license](https://img.shields.io/badge/license-ISC-blue.svg)](https://raw.githubusercontent.com/MitMaro/eslint-plugin-strict-newline/master/LICENSE.md)

@@ -34,2 +35,2 @@ This is an ESLint rule that warns against a missing newline after 'use strict'.

Combokeys Context is released under the ISC license. See [LICENSE](LICENSE.md).
ESLint Strict Newline Plugin is released under the ISC license. See [LICENSE](LICENSE.md).

Sorry, the diff of this file is not supported yet

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