google / google/closure-compiler

Raise a warning when an ES6 class method doesn't call super

Open
#2,736 5 comments 0 reactions 0 assignees View on GitHub
enhancement ES6
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

When an ES6 class extends another and overrides a method, it's pretty easy for the user to forget to call `super`. Unfortunately, this is a check that is beyond the standard JS linting tools as it requires whole world type information.

I'm proposing adding a new diagnostic group which issues a warning when it sees this. Users can suppress the warning if the omission was intentional.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.