-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
Vuex and Pinia support for no-undef-properties
#2513
Conversation
I think this rule should be supported by pinia or 3rd party plugin. |
Sure but it looks like the maintainers are welcoming these kinds of enhancements, as a similar fix was added for |
This is much required. Thanks to @marcjfj-vmlyr for working on this. Please merge as soon as possible. |
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.
Really nice, thank you!
I have a few small suggestions.
… set, use isStringLiteral util
@FloEdelmann Thanks for reviewing! I've made the requested changes. |
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.
Thanks! I have one more change request, then it's good to go from my side 🙂
Invalid test cases have been added. |
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.
Thanks! One more minor thing I just noticed.
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.
Looks good to me now 🙂
this looks great, can't wait for it to ship! |
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.
LGTM! Thank you!
There is a problem with this fix - it works only if created()
{
if (this.getCountries.length === 0) this.fetchCountries();
},
methods:
{
...mapMutations(['setCountries']),
fetchCountries()
{
// ... fetching from server
this.setCountries(data);
}
} However, in the following code a linting error created()
{
if (this.getCountries.length === 0)
{
// ... fetching from server
this.setCountries(data); // <==== linting error - but it should not be
}
},
methods:
{
...mapMutations(['setCountries']),
} |
Please open a new issue following the bug template. |
This PR adds support for Vuex and Pinia methods to the
no-undef-properties
rule, allowing properties defined bymapState
,mapActions
,mapGetters
,mapMutations
, andmapWritableState
to be recognized as defined properties.Test cases have been included for this enhancement.