marcoroth / stimulus-parser

Statically analyze Stimulus controllers in your project.

Home Page:https://hotwire.io/ecosystem/tooling/stimulus-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error parsing private getters

mguidetti opened this issue · comments

An unexpected token error will be raised if a Stimulus controller has a private getter defined, such as:

get #activeItems () {
    return this.itemTargets.filter(div => !div.classList.contains('destroying'))
}

Hey @mguidetti, thanks for reporting this. I was able to reproduce this here: 3c33188

I'm not quite sure why this doesn't work though. We are using acorn-private-methods and acorn-class-fields which should cover this syntax. I'm wondering if it's time to actually swap out the parser (see #15) so we can better support new ECMAScript features like this.

Glad this could help! Thank you!