eslint-plugin-kyt
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.4.2](https://github.com/nytimes/kyt/compare/eslint-plugin-kyt@1.4.1...eslint-plugin-kyt@1.4.2) (2021-04-15) | ||
### Bug Fixes | ||
* **lint:** ensure that node.argument.name is a string value ([8928b85](https://github.com/nytimes/kyt/commit/8928b85bc8a937910b4bc0f359174b1fbc4b524d)) | ||
## [1.4.1](https://github.com/nytimes/kyt/compare/eslint-plugin-kyt@1.4.0...eslint-plugin-kyt@1.4.1) (2021-04-15) | ||
@@ -8,0 +19,0 @@ |
@@ -20,3 +20,8 @@ const message = 'Do not declare a variable and then immediately return it. Just return it.'; | ||
const name = n.declarations[0].id.name; | ||
if (next.type === 'ReturnStatement' && name === next.argument.name) { | ||
if ( | ||
next.type === 'ReturnStatement' && | ||
next.argument.type === 'Identifier' && | ||
next.argument.name && | ||
name === next.argument.name | ||
) { | ||
context.report({ | ||
@@ -23,0 +28,0 @@ node: next, |
{ | ||
"name": "eslint-plugin-kyt", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "ESLint plugin for Vi-specific rules.", | ||
@@ -23,3 +23,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "6babbd8a8c41835d4946e741dc6594e635bf6339" | ||
"gitHead": "824bebdf552c05ed1f23c5680477d990374a3cd1" | ||
} |
@@ -23,2 +23,5 @@ const { RuleTester } = require('eslint'); | ||
}, | ||
{ | ||
code: `function Foo() { const { bar, baz } = {}; return (1); }`, | ||
}, | ||
], | ||
@@ -25,0 +28,0 @@ invalid: [ |
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
25747
699