eslint-plugin-richlab
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
"use strict" | ||
'use strict' | ||
@@ -21,3 +21,3 @@ //------------------------------------------------------------------------------ | ||
var _avoidIos9ViewportBug = require("./rules/avoid-ios9-viewport-bug"); | ||
var _avoidIos9ViewportBug = require('./rules/avoid-ios9-viewport-bug'); | ||
@@ -29,3 +29,3 @@ var _avoidIos9ViewportBug2 = _interopRequireDefault(_avoidIos9ViewportBug); | ||
var rules = exports.rules = { | ||
"avoid-ios9-viewport-bug": _avoidIos9ViewportBug2.default | ||
'avoid-ios9-viewport-bug': _avoidIos9ViewportBug2.default | ||
}; |
@@ -11,2 +11,7 @@ 'use strict'; | ||
var test = function test(str) { | ||
return (/^inner(Width|Height)$/.test(str) | ||
); | ||
}; | ||
function avoidIOS9ViewportBugs(context) { | ||
@@ -18,3 +23,3 @@ return { | ||
if (object.name === 'window' && /^inner(Width|Height)$/.test(property.name)) { | ||
if (object.name === 'window' && test(property.name)) { | ||
context.report(node, message[RegExp.$1.toLowerCase()]); | ||
@@ -27,8 +32,6 @@ } | ||
if (!(init.type === 'Identifier' && init.name === 'window' && id.type === 'ObjectPattern')) { | ||
return; | ||
} | ||
if (!init || init.type !== 'Identifier' || init.name !== 'window' || id.type !== 'ObjectPattern') return; | ||
id.properties.forEach(function (property) { | ||
if (/^inner(Width|Height)$/.test(property.key.name)) { | ||
if (test(property.key.name)) { | ||
context.report(property, message[RegExp.$1.toLowerCase()]); | ||
@@ -35,0 +38,0 @@ } |
{ | ||
"name": "eslint-plugin-richlab", | ||
"description": "An ESLint plugin created by RichLab", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Hiroyuki ANAI<pirosikick@gmail.com>", | ||
@@ -14,7 +14,2 @@ "bugs": { | ||
"url": "https://github.com/bonegollira" | ||
}, | ||
{ | ||
"name": "Kojiro Ozaki", | ||
"email": "koujirou0111@gmail.com", | ||
"url": "https://github.com/koozaki" | ||
} | ||
@@ -21,0 +16,0 @@ ], |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
56
4901
1