Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Demonstration that max-func-body-length fails to count body length correctly

Notifications You must be signed in to change notification settings

makotom/tslint-test-20180724

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisite

I assume that the following block defines a 3-line arrow function:

(): void => {   // Line 1
                // Line 2
}               // Line 3

The Issue

I am demonstrating that max-func-body-length fails to count body length correctly. For instance, when you run npm run lint with this repository, lint says:

[20, 5]: Max arrow function body length exceeded - max: 2, actual: 3

Actually, however, the function has 4 lines.

This happens because it does not add 1 to endLine - startLine for calculation of body length.

About

Demonstration that max-func-body-length fails to count body length correctly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published