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

Rule no-stateless-class does not account for constructors using parameter properties #310

Closed
rsaddey opened this issue Nov 3, 2016 · 2 comments
Milestone

Comments

@rsaddey
Copy link

rsaddey commented Nov 3, 2016

class Point {  
    constructor(public x: number, public y: number) {  
        // Constructor body  
    }  
}

has 2 private public properties but is still marked as stateless.

See TypeScript - Handbook - Classes: Parameter Properties
and TypeScript Language Specification (v1.8.2) at 8.3.1 Constructor Parameters

@HamletDRC HamletDRC added this to the 2.0.14 milestone Nov 3, 2016
@HamletDRC
Copy link
Member

The modifiers available in 2.0 are:

  • public
  • private
  • protected
  • readonly

@HamletDRC
Copy link
Member

Thanks for the bug report!

The fix is available on our "releases" branch. So you can point your npm to that github branch and start using the fix today if you'd like.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants