eslint-plugin-prefer-arrow-functions icon indicating copy to clipboard operation
eslint-plugin-prefer-arrow-functions copied to clipboard

Fix removes the function name

Open cornellouis opened this issue 1 year ago • 1 comments

Description

Before Fix: export default async function fetchFoo(

After Fix: export default async (signal: AbortSignal): Promise<ResponseStyles> => {

This is horrible because that function is called in the code, so it breaks the code.

Suggested Solution

Stop removing the name.

Help Needed

cornellouis avatar May 03 '24 19:05 cornellouis

This should be fixed to

const fetchFoo = (signal: AbortSignal): Promise => {
   …
};
export default fetchFoo;

andersk avatar Jun 07 '24 20:06 andersk

Currently the plugin is ignoring default exports when they are a named function.

JamieMason avatar Jan 09 '25 23:01 JamieMason