eslint-community / eslint-utils

Utilities for ESLint plugins and custom rules.
https://eslint-community.github.io/eslint-utils
MIT License
18 stars 7 forks source link

Add `getFunctionKind()` #201

Open fisker opened 8 months ago

fisker commented 8 months ago

When I work on unicorn/no-anonymous-default-export, I want to display function kind in error message, but I don't want display the function name default, make sense add getFunctionKind() to just return the function kind? Or maybe make getFunctionNameWithKind return kind and name separately?

voxpelli commented 7 months ago

Since getFunctionNameWithKind is already split up into three clear parts – modifiers, kinds and name – we could easily make a new method that returns those three parts separately and then have change getFunctionNameWithKind to simply concatenate those three together.

Want to do a PR?

Also: I guess you are one of the power users of this module outside of eslint-community, should we add you on as a co-maintainer for this one? Then we can help each other out more? Ping @MichaelDeBoey