Replacement/improvement of func-name-matching
eslint rule
#57899
Labels
tools
Issues and PRs related to the tools directory.
There are quite a few places where a property is defined like this:
As result, we end up with quite a few functions named
value
:There is a
func-name-matching
rule in eslint that enforces function names to match the property names. However, in these cases, this rule rejects correct code and insists that these functions must be namedvalue
, to the point that in some places we have them explicitly named like this:node/lib/test/reporters.js
Line 56 in cb5f671
I think, it would be nice to have a custom linter rule that:
func-name-matching
everywhere outside ofObjectDefineProperty
,ObjectDefineProperties
, andReflectDefineProperty
value
I'm not familiar with eslint rules definitions but the original
func-name-matching
rule seems to be defined here: https://github.com/eslint/eslint/blob/e8f8d57bd6c0d95f9f25db8c5b3ff72de42488b7/lib/rules/func-name-matching.js.The rule already has
considerPropertyDescriptor
option, but it's not applicable here because:Object.defineProperty
) but not primordials (ObjectDefineProperty
)value: function() {
) and concise notation (value() {
)Object.create()
The text was updated successfully, but these errors were encountered: