googlearchive / polylint

Lint polymer!
BSD 3-Clause "New" or "Revised" License
116 stars 19 forks source link

Update binding expression regex to full Polymer/polymer regex (Fixes #113) #117

Open jonvuri opened 8 years ago

jonvuri commented 8 years ago

Fixes #113

We grab the binding regex from https://github.com/Polymer/polymer/blob/d385873e3696aade3d122cb1c28f0ce8f6af4b35/src/lib/annotations/annotations.html#L92-L109 and modify it slightly to have only one capture group for the binding (which is what extractBindingExpression expects), and to handle the native event binding delimiter if present.

Big thanks to @TimvdLippe for help with the native binding expression and other feedback!

Among other things, the main thing this fixes is the greedy handling of binding expressions on the same line. This could also be solved by simply making the original inline regexes non-greedy, but this is a more thorough solution to handle most binding expression structures.

Also fixed two minor issues with the unit tests - those are the first two commits in this PR.

garlicnation commented 8 years ago

@jrajav Can you rebase this?