Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-sorting

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-sorting - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

11

lib/rules/sort-object-props.js

@@ -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: [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc