override-decorator

1.0.1 • Public • Published

override-decorator

Simple @Override decorator for ES7.

Usage

Enable stage 0 or es7.decorators in Babel, then mark properties that are intended to override superclass properties with @Override.

class A {
  a() {
    /* ... */
  }
}
 
class B extends A {
  @Override
  a() {
    /* ... */
  }
}

The decorator will throw an error if the decorated property does not override a parent property.

class C extends A {
  @Override
  b() {
    /* ... */
  }
}
 
// Error: b does not override a member of its superclass

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.0
    0
    • alpha
  • 1.0.1
    12
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    12
  • 1.0.0
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i override-decorator

Weekly Downloads

12

Version

1.0.1

License

CC0-1.0

Last publish

Collaborators

  • taion