vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.42k stars 659 forks source link

Rule proposal: `private-property-names` #246

Open michalsnik opened 6 years ago

michalsnik commented 6 years ago

According to the Style Guide we should warn about following keys:

and encourage to prefix private properties with $_ (e.g. $_foo).

This rule could live alongside no-reserved-keys, but we might as well keep only this rule, to not duplicate warnings.

chrisvfritz commented 6 years ago

I would hold off on this one for a little bit, as I'd like Evan to first approve this convention when he reviews the style guide.

michalsnik commented 6 years ago

@chrisvfritz do we know more now?

chrisvfritz commented 6 years ago

I don't think we've had a definitive ruling yet, but I'll ping @yyx990803. 🙂

chrisvfritz commented 5 years ago

Still no word from Evan, but let's move forward on this anyway. I think no-reserved-keys can still be useful in conjunction with this, since the $_ is only for private property names, like in plugins. There are probably two scenarios we can catch:

What do you think @michalsnik?