New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prefer-at
: Support private field
#1929
Conversation
|
Tests passed with There isn't |
I mean this part https://github.com/eslint/eslint/blob/94ba68d76a6940f68ff82eea7332c6505f93df76/lib/rules/utils/ast-utils.js#L420-L443, your solution isn't correct, it will cause |
With my last commit e95cec1, the tests on the private fields are successful. But 4 tests fail because messages are reported for valid codes:
I don't know how to correct this problem. 😞 I tested with the no-self-assign rule of ESLint (which uses the /* eslint no-self-assign: "error" */
let foo = ["a", "b", "c"];
let bar = 0;
let baz = 0;
/* 1 */ foo[bar] = foo[bar];
/* 2 */ foo[bar++] = foo[bar++];
/* 3 */ foo[bar + baz] = foo[bar + baz];
/* 4 */ foo[`${bar}`] = foo[`${bar}`];
|
prefer-at
: Support private field.prefer-at
: Support private field
Fix #1928
I added
case 'PrivateIdentifier':
inisSameReference()
(cf. #1928 (comment)) but the private fields are still not supported.