Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Missing semicolon doesn't warn for arrow functions in class properties #1542

Closed
pablonete opened this issue Sep 8, 2016 · 1 comment
Closed

Comments

@pablonete
Copy link
Contributor

Bug Report

  • TSLint version: 3.15.1
  • TypeScript version: 1.8.10
  • Running TSLint via: VSCode

TypeScript code being linted

class A {
    private f = function() { return "f"; }
    private g = () => { return "g"; }
    private h = () => "h"
}

with tslint.json configuration:

"semicolon": [true, "always"],

Actual behavior

Property f gets a warning Missing semicolon.
Properties g and h doesn't.

Expected behavior

Properties g and h should get the same warning.

I can understand that somebody may want to opt-out of this rule, but it seems inconsistent as is.

@jkillian
Copy link
Contributor

This was an intentional change actually, to allow arrow functions to be declared like class methods: #1081

In #1081, we decided that the complexity of adding another option wasn't worth it for this small edge case, sorry!

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