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
fix(eslint-plugin)!: [explicit-member-accessibility] Stop checking parameter properties #631
Conversation
I am not sure why coverage went down. I added the test cited in the issue and worked my way of figuring out the solution. I am not sure if my approach is correct. Do let me know! Thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless I'm mistaken, a parameter property is always considered valid under this rule because it always MUST have an accessibility modifier, or else it's not a parameter property?
In that case can't you can just remove the TSParameterProperty
selector from the rule altogether, because there's no situation that this rule should check them?
74dfbaa
to
9761c1e
Compare
@bradzacher thanks, I didn't know about it! I've removed the selector, edited some failing tests and rebased the PR with master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one last change - remove the parameterProperties
option from the interface and the json schema
add check if param property is inside constructor and override is honored
920e9a8
to
cd47cd7
Compare
Done! |
I've to update the doc as well. Will do that and update here shortly. |
Parameter properties also can be declared with a class Foo {
constructor(readonly bar: string) {}
} So the change there should be: -if (paramPropCheck === 'no-public' && node.accessibility === 'public') {
+if (paramPropCheck === 'no-public' && node.accessibility === 'public' && !node.readonly) { It also currently doesn't enforce it with |
@ankeetmaini we are currently preparing the v2 release (i.e. breaking changes are currently eligible to be merged) when do you think you will have chance to make the change suggested by @ark120202? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment
I totally missed the above comment, apologies. So for the above mentioned change, I'll have to undo the removal of |
yes, I was wrong, sorry. Unless I'm mistaken - these should be the states: valid when
valid when
valid when
|
Closing this in favour of #912 |
BREAKING CHANGE: changes rule config
Fixes #617
Fixes #857