eslint-plugin-strict-newline
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -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' |
{ | ||
"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 | ||
[](https://travis-ci.org/MitMaro/eslint-plugin-strict-newline) | ||
[](https://coveralls.io/r/MitMaro/eslint-plugin-strict-newline?branch=master) | ||
[](https://coveralls.io/github/MitMaro/eslint-plugin-strict-newline?branch=master) | ||
[](https://www.npmjs.com/package/eslint-plugin-strict-newline) | ||
[](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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
35
0
5584
7
79