JamieMason / eslint-plugin-prefer-arrow-functions

Auto-fix plain Functions into Arrow Functions, in all cases where conversion would result in the same behaviour
https://www.npmjs.com/package/eslint-plugin-prefer-arrow-functions
MIT License
43 stars 11 forks source link

Fix removes the function name #35

Open cornellouis opened 1 month ago

cornellouis commented 1 month ago

Description

Before Fix: export default async function fetchFoo(

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

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

Suggested Solution

Stop removing the name.

Help Needed

andersk commented 3 weeks ago

This should be fixed to

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