eslint-plugin-sort-class-members
Advanced tools
Comparing version 1.15.1 to 1.15.2
@@ -227,3 +227,5 @@ "use strict"; | ||
var classMemberNodes = classDeclaration.body.body; | ||
var members = classMemberNodes.map(function (member, i) { | ||
var members = classMemberNodes.filter(function (x) { | ||
return x.key; | ||
}).map(function (member, i) { | ||
return _objectSpread(_objectSpread({}, getMemberInfo(member, sourceCode)), {}, { | ||
@@ -243,3 +245,3 @@ id: String(i) | ||
function getMemberInfo(node, sourceCode) { | ||
var priv = node.key.type === 'PrivateName' || node.key.type === 'PrivateIdentifier'; | ||
var isPrivate = node.key.type === 'PrivateName' || node.key.type === 'PrivateIdentifier'; | ||
var name; | ||
@@ -257,3 +259,3 @@ var type; | ||
if (priv) { | ||
if (isPrivate) { | ||
name = "#".concat(node.key.id ? node.key.id.name : node.key.name); | ||
@@ -276,3 +278,3 @@ } else { | ||
} else { | ||
name = priv ? "#".concat(node.key.id ? node.key.id.name : node.key.name) : node.key.name; | ||
name = isPrivate ? "#".concat(node.key.id ? node.key.id.name : node.key.name) : node.key.name; | ||
} | ||
@@ -290,3 +292,3 @@ | ||
async: async, | ||
"private": priv, | ||
"private": isPrivate, | ||
kind: node.kind, | ||
@@ -293,0 +295,0 @@ propertyType: propertyType, |
{ | ||
"name": "eslint-plugin-sort-class-members", | ||
"version": "1.15.1", | ||
"version": "1.15.2", | ||
"description": "ESLint rule for enforcing consistent ES6 class member order.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
31121
623