eslint-plugin-sorting
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -11,6 +11,11 @@ "use strict"; | ||
function getKey(prop) { | ||
if (prop.key.type === "Literal") { | ||
return prop.key.value.toString(); | ||
try { | ||
if (prop.key.type === "Literal") { | ||
return prop.key.value.toString(); | ||
} | ||
return prop.key.name.toString(); | ||
} catch (err) { | ||
console.log("prop:", prop); | ||
return ""; | ||
} | ||
return prop.key.name.toString(); | ||
} | ||
@@ -17,0 +22,0 @@ |
@@ -13,2 +13,5 @@ "use strict"; | ||
}, { | ||
nodeType: "key", | ||
type: "MemberExpression" | ||
}, { | ||
nodeType: "value", | ||
@@ -15,0 +18,0 @@ type: "FunctionExpression", |
{ | ||
"name": "eslint-plugin-sorting", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Sorting rules for eslint", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -23,3 +23,4 @@ "use strict"; | ||
{ code: "var a = { [a()]: 'a' }", "parser": "babel-eslint", rules: {strict: 0} }, | ||
{ code: "var a = { [a?b:c]: d }", "parser": "babel-eslint", rules: {strict: 0} } | ||
{ code: "var a = { [a?b:c]: d }", "parser": "babel-eslint", rules: {strict: 0} }, | ||
{ code: "var a = { b: c }; var d = {[a.b]: e}", "parser": "babel-eslint", rules: {strict: 0} } | ||
], | ||
@@ -26,0 +27,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
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
6811
142
0