eslint-plugin-sorting
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -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); |
{ | ||
"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 @@ |
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
4139
0
43
53