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
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: