antonmedv/finder

custom penalty

dbenson24 opened this issue · 3 comments

I'd like to customize the penalty so that the selectors this generates primarily use a specific attribute, but if that attribute isn't present on a descendant fallback to using a classname.

What are your thoughts on adding a new option called penalties that could look like this for example

penalties: { tag: 10, attr: 0, id: 8, classname: 10, any: 20 }

I think 🤔 it’s okay.

I am also interested in this feature
Cause sometimes we don't that want something 'XXX-hover' in the path since it is pretty hard to record the 'hover' event..