Skip to content

[explicit-member-accessibility]: add support for tslint member-access config options #214

@Hotell

Description

@Hotell

TSlint member-access supports following config:

  • "no-public" forbids public accessibility to be specified, because this is the default.
  • "check-accessor" enforces explicit visibility on get/set accessors
  • "check-constructor" enforces explicit visibility on constructors
  • "check-parameter-property" enforces explicit visibility on parameter properties

Currently this rule follows only all or nothing rule. It would be nice to implement at least no-public config to prevent devs to use public which is a default in TS.

Repro

{
  "rules": {
    "@typescript-eslint/explicit-member-accessibility": ["error", "no-public"]
  }
}
class Test {
 // Expect lint error
 public render(){
   return `<div>Hello</div>`
 }

 private handleClick = () => { /*...*/ }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions