-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): removed value from abstract property nodes #3765
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
feat(eslint-plugin): removed value from abstract property nodes #3765
Conversation
Thanks for the PR, @JoshuaKGoldberg! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
03e02ce
to
8354f15
Compare
8354f15
to
72dd026
Compare
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.24 to 27.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
72dd026
to
714266f
Compare
Codecov Report
@@ Coverage Diff @@
## v5 #3765 +/- ##
=======================================
Coverage 92.57% 92.58%
=======================================
Files 325 327 +2
Lines 11283 11294 +11
Branches 3181 3183 +2
=======================================
+ Hits 10445 10456 +11
Misses 384 384
Partials 454 454
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Hmm - I wonder - instead of removing the property altogether, do we instead want to just set value: null
?
I'm trying to figure out if it's better to make the AST nodes different shapes or not.
We will want to switch ClassProperty
to PropertyDefinition
to match the ESTree spec for the next version.
So it stands to reason that we'd also rename TSAbstractClassProperty
to TSAbstractPropertyDefinition
to match.
However - I wonder - do we want to keep that node still?
Or do we want to just add a modifier boolean on to PropertyDefinition
?
I'm not entirely sure which is the 100% correct thing to do.
I'm guessing that it's probably better to keep them split as it means it's trivial for existing rules to not false-positive match on them.
Hmmmmmmmmmmm.
I think for now - what we should do is leave the value
property on TSAbstractClassProperty
and just set it to be "always null". The benefit of this change is that you can iterate through the similar nodes (props and abstract props) without doing if (node.type === 'ClassProperty') { // use node.value }
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.
two small comments - otherwise lgtm - thanks for doing this!
Ah, thanks - I didn't end up having time to get to the changes this week. Much appreciated! |
* chore: bump @types/jest from 26.0.24 to 27.0.1 (#3748) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.24 to 27.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: address comments Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
* chore: bump @types/jest from 26.0.24 to 27.0.1 (#3748) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.24 to 27.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: address comments Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
Continues #3606 by removing the
value
forTSAbstractClassProperty
nodes.There are a few places that check for that member so I figured it's probably reasonable to go the extra mile.