@dreipol/eslint-plugin-export-keys
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.default = [1, {}]; | ||
exports.default = [1, []]; | ||
module.exports = exports["default"]; |
@@ -35,8 +35,9 @@ 'use strict'; | ||
if (~itemPosition) { | ||
let prevItemIndex = keysPositions.length - 1; | ||
let previousItem = keysPositions[keysPositions.length - 1]; | ||
// if it's the first key we can not compare to the previous key | ||
if (i && keysPositions[prevItemIndex] > itemPosition) { | ||
if (i && previousItem && previousItem[0] > itemPosition) { | ||
// collect all the nodes that seem to have the wrong position | ||
// compared to their direct previous sibling | ||
arr.push([node.properties[prevItemIndex], node.properties[i]]); | ||
arr.push([node.properties[previousItem[1]], node.properties[i]]); | ||
} | ||
@@ -46,5 +47,4 @@ | ||
// to compare it to the next one in the next loop | ||
keysPositions.push(itemPosition); | ||
keysPositions.push([itemPosition, i]); | ||
} | ||
return arr; | ||
@@ -51,0 +51,0 @@ }, []); |
{ | ||
"name": "@dreipol/eslint-plugin-export-keys", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Specify how the object kyes should be exported", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
8350