Require access modifiers for typescript

  • description of the Rule. It should answer questions “why is there an issue?”, “what could be its impact?” and “what could happen in case of a successful attack?” (for Vulnerabilities and Security Hotspots)

Lack of an access modifier can lead to confusion as the defaults between languages differ. Also Explicit is better than implicit

  • snippet of Noncompliant Code
async function myFunc(a : number) { ....
  • snippet of Compilant Code (fixing the above noncompliant code)
public async function myFunc(a : number) { ....
  • exceptions to the Noncompliant Code, i.e. conditions in which the noncompliant code should not raise an issue so that we reduce the number of False Positives.

None

  • external references and/or language specifications
    Not sure what is wanted.

  • type :
    Code Smell, potential bug