hapi-no-var
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -28,4 +28,5 @@ // Based on https://github.com/eslint/eslint/blob/master/lib/rules/no-var.js | ||
if (node.parent.parent.type === 'TryStatement' || | ||
node.parent.parent.type === 'CatchClause') { | ||
if (node.parent.parent && | ||
(node.parent.parent.type === 'TryStatement' || | ||
node.parent.parent.type === 'CatchClause')) { | ||
@@ -32,0 +33,0 @@ const variables = context.getDeclaredVariables(node); |
{ | ||
"name": "hapi-no-var", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "ESLint rule to enforce the usage of var declarations only in try-catch scope", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -26,3 +26,4 @@ 'use strict'; | ||
'function test() { try { var bf = 2; if (bf) { console.log(bf); } } catch (err) {} }', | ||
'function test() { try { if (true) { var bf = 2; } console.log(bf); } catch (err) {} }' | ||
'function test() { try { if (true) { var bf = 2; } console.log(bf); } catch (err) {} }', | ||
'var a = 1; try {} catch (err) {}' | ||
]; | ||
@@ -49,3 +50,4 @@ | ||
'function test() { try {} catch (err) { var cf = 3; } console.log(cf); }', | ||
'function test() { a = 1; try { var a = 2; } catch (err) {} }' | ||
'function test() { a = 1; try { var a = 2; } catch (err) {} }', | ||
'try { var a = 1; } catch (err) {} console.log(a);' | ||
]; | ||
@@ -52,0 +54,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6204
100