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

eslint-plugin-sorting

Package Overview
Dependencies
Maintainers
1
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.0.1 to 0.1.0

9

index.js

@@ -8,2 +8,4 @@ "use strict";

var ignoreMethods = context.options[0].ignoreMethods;
var ignorePrivate = context.options[0].ignorePrivate;
var MSG = "Property names in object literals should be sorted";

@@ -25,6 +27,11 @@ return {

}
if (caseSensitive) {
if ((caseSensitive) && (lastPropId !== undefined)) {
lastPropId = lastPropId.toLowerCase();
propId = propId.toLowerCase();
}
if (ignorePrivate && /^_/.test(propId)) {
return prop;
}
if (propId < lastPropId) {

@@ -31,0 +38,0 @@ context.report(prop, MSG);

5

package.json
{
"name": "eslint-plugin-sorting",
"version": "0.0.1",
"version": "0.1.0",
"description": "Require property names in object literals to be sorted alphabetically.",

@@ -12,6 +12,3 @@ "keywords": [

"main": "index.js",
"peerDependencies": {
"eslint": ">=0.8.0"
},
"repository": "jacobrask/eslint-plugin-sorting"
}

@@ -0,1 +1,5 @@

## Install
`npm install --save-dev eslint eslint-plugin-sorting`
In the plugins section of your `.eslintrc`, add `sorting`.

@@ -8,6 +12,8 @@

"rules": {
"sorting/sort-object-props": [ 1, { ignoreCase: true, ignoreMethods: false } ]
"sorting/sort-object-props": [ 1, { "ignoreCase": true, "ignoreMethods": false } ]
}
}
## Rule Details
By default all rules are case insensitive and methods (functions as values) are not ignored.

@@ -14,0 +20,0 @@

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