robatwilliams / es-compat

Check JavaScript code compatibility with target runtime environments
MIT License
64 stars 13 forks source link

Private methods and private fields separation #79

Closed jonathanKingston closed 6 months ago

jonathanKingston commented 1 year ago

Currently it appears there is not ability to disambiguate between class fields and class methods (please correct me if I'm wrong).

Rationale

robatwilliams commented 1 year ago

The plugin is using https://eslint-community.github.io/eslint-plugin-es-x/rules/no-class-fields.html whose scope includes methods and fields (full list seen in their test source).

In my join-up of that rule with compat DB features, I have only referred to fields - which is a bug.

To enable distinguishing, the es-x plugin's rule would need splitting, or a custom one written here. I can't see them splitting it for this use case.

robatwilliams commented 9 months ago

Bug part of this needs fixing, but the enhancement won't be due to limitation of no-class-fields as described above.