Skip to content

A typescript linting rule to discourage the usage of closures.

License

Notifications You must be signed in to change notification settings

bafolts/tslint-no-closures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tslint-no-closures

A typescript linting rule to discourage the usage of closures.

THIS PROJECT IS STILL A WORK IN PROGRESS

Closures in javascript can cause memory leaks in certain situations. Most closures can be avoided. This linting rule attempts to find closures and log them as either warnings or errors in order to help avoid memory leaks.

"rules": {
    "no-closures": true
}

With this rule enabled, common closure bugs will be marked as errors:

BAD:

for (var i = 0; i < 100; i++) {
    setTimeout(() => {
        // i was not defined in this function
        alert(i);
    });
}

About

A typescript linting rule to discourage the usage of closures.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published