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

coffeelint-ensure-super

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffeelint-ensure-super

Ensure super is called in certain methods.

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Ensure Super

A CoffeeLint rule that ensures that super is called.

Description

This rule ensures that classes that inherit from a set of defined base classes and override a set of defined methods call super in their implementations of those methods. A good example of this is making sure that all Backbone views that override View::remove call super, since otherwise they will leak resources, and may not actually be removed from the DOM.

By default no rules are defined - these must be configured (see below).

Installation

npm install coffeelint-ensure-super

Usage

Add the following configuration to coffeelint.json:

"ensure_super": {
      "module": "coffeelint-ensure-super",
      "check": {
        "SuperClassName": ["method1", "method2"],
        "AnotherSuperClass": ["methodX", "methodY"]
      }
}

Configuration

The check property defines which methods must call super. It is a mapping from the parent class name to the list of the methods that must call super when overriden. For example, a suitable configuration for ensuring all Backbone views call super on removal would be:

"ensure_super": {
      "module": "coffeelint-ensure-super",
      "check": {
        "View": ["remove"]
      }
}

Keywords

FAQs

Package last updated on 28 Dec 2014

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