-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Docs: func-style docs are confusing #18474
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
documentation
Relates to ESLint's documentation
Comments
Hi @camsteffen, thanks for the issue, a PR is welcome. |
Tanujkanti4441
added
the
accepted
There is consensus among the team that this change meets the criteria for inclusion
label
May 19, 2024
camsteffen
added a commit
to camsteffen/eslint
that referenced
this issue
May 19, 2024
camsteffen
added a commit
to camsteffen/eslint
that referenced
this issue
May 19, 2024
camsteffen
added a commit
to camsteffen/eslint
that referenced
this issue
May 21, 2024
camsteffen
added a commit
to camsteffen/eslint
that referenced
this issue
May 22, 2024
nzakas
added a commit
that referenced
this issue
May 27, 2024
* docs: clarify func-style Fixes #18474 * Update docs/src/rules/func-style.md Co-authored-by: Milos Djermanovic <[email protected]> --------- Co-authored-by: Nicholas C. Zakas <[email protected]> Co-authored-by: Milos Djermanovic <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
documentation
Relates to ESLint's documentation
Docs page(s)
https://eslint.org/docs/latest/rules/func-style
What documentation issue do you want to solve?
function
and arrow functions. That is kinda close but not quite right, and the docs do not anticipate this misconception.What do you think is the correct solution?
Do not use the term "function expression" to mean "function expression assigned to a variable". That is incorrect and confusing. In
const x = () => {}
, only the() => {}
part is a function expression. As a reference, see the Functions MDN page.For instance, I would change the summary line to
Maybe explicitly state that the lint does not apply to callback functions.
Participation
Additional comments
I admit the phrase "function expression assigned to a variable" is verbose. But brevity at the cost of technical correctness is not a good trade. It confused me and I doubt I'm the only one.
The text was updated successfully, but these errors were encountered: