javascript
javascript copied to clipboard
Add Class Private Identifier
Include Private Class Member (# name)
Hi Maintainers👋
I would like to make a modification for private class members. ECMA2022 standardized the private identifier #
. It marks class members as private.
Additional Section:
- 9.8 Class members should use
#
to mark them as private members.
Modified Section:
- 23.4 Do not use trailing or leading underscores.
References:
This isn't something the guide can support until babel-preset-airbnb transforms them, and until eslint fully supports linting them with ecmaVersion 2022, which I don't think it quite does yet.
This isn't something the guide can support until babel-preset-airbnb transforms them, and until eslint fully supports linting them with ecmaVersion 2022, which I don't think it quite does yet.
I did some research and found out that ESLint seems to lint private class member since v8.1.0
.
That’s great - but our eslint config still supports eslint 7, so we wouldn’t be able to recommend using private fields (which are great) until we drop eslint < 8.1.
Understood. Thanks for taking the time:)
@Jassi10000 while that's technically true, it's not that important until the PR is ready to be merged - and it's something maintainers can often take care of.