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

Readme

Keywords

Package Sidebar

Install

npm i override-decorator

Weekly Downloads

8

Version

1.0.1

License

CC0-1.0

Last publish

Collaborators

  • taion