New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

coffeelint-alphabetize-keys

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffeelint-alphabetize-keys

Coffeelint rule that verifies object keys are in alphabetical order

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-90%
Maintainers
1
Weekly downloads
 
Created
Source

coffeelint-alphabetize-keys

NPM Version Build Status

Coffeelint rule requiring objects to have keys in alphabetical order

Installation

npm install coffeelint-alphabetize-keys

Usage

Put this in your coffeelint config:

"alphabetize_keys": {
  "module": "coffeelint-alphabetize-keys",
}

Examples

Objects

{keyA, keyB, keyC} # Good
{keyC, keyB, keyA} # Bad

The rule applies to both defining and destructing objects.

Classes

The rule differentiates between variables and methods, and each are required to only be individually alphabetical.

# Good
class A
  variableA: 1 * 2
  variableB: 'abc'
  variableC: fn()

  methodA: ->
  methodB: ->
  methodC: ->

# Bad
class A
  variableC: fn()
  variableB: 'abc'
  variableA: 1 * 2

  methodC: ->
  methodB: ->
  methodA: ->

Methods and variables are also broken down into static, instance, and private instance (starting with _) where each are required to only be individually alphabetical.

Keywords

FAQs

Package last updated on 17 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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