feat(lint): check descriptions of static members#29569
Conversation
|
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
| ruleName: 'static', | ||
| path, | ||
| actual, | ||
| expected: methodForm, |
There was a problem hiding this comment.
nit: perhaps?
| expected: methodForm, | |
| expected: `"${methodForm}" or "${propertyForm}"`, |
There was a problem hiding this comment.
The expected value is used by the fixer to set the description, so this is probably not what we want. But I've pinged Florian above to see how we handle this ambiguity.
6758f7b to
daf8af1
Compare
| } else if (featureName.endsWith('_static')) { | ||
| const memberName = featureName.slice(0, -'_static'.length); | ||
| const methodForm = `\`${memberName}()\` static method`; | ||
| const propertyForm = `\`${memberName}\` static property`; |
There was a problem hiding this comment.
@Elchi3 The Static API members guidelines only give an example of a static method, but there are 7 occurrences of _static being used for properties.
Should we update the guidelines to require the _static_property suffix for static properties? There is currently only 1 occurrence.
Edit: Otherwise this lint error won't be fixable.
There was a problem hiding this comment.
Should we update the guidelines to require the
_static_propertysuffix for static properties? There is currently only 1 occurrence.
Yes, I think this rule should apply to all members (methods and properties).
(another reason why type tags would help us, I guess :)
There was a problem hiding this comment.
I'm not sure I understand. Which of these rules should apply?
_staticfor both methods and properties_staticfor methods,_static_propertyfor properties_static_methodfor methods,_static_propertyfor properties
There was a problem hiding this comment.
I'm sorry, I got confused.
This is the way: 1. _static for both methods and properties
See also #16613 (comment)
Summary
Extend descriptions linter to check static members.
Test results and supporting details
Related issues
Fixes #29537.