sindresorhus/eslint-plugin-unicorn

Do you want to work on this issue?

You can request for a bounty in order to promote it!


1 active bounty request

$33.39
Solve someone else's bounty request by clicking on it and completing the funding to earn additional credits

Missing functions in `consistent-function-scoping` #931

fisker posted onGitHub

Arrow function (throws error):

// ESLint: Move arrow function to the outer scope.(unicorn/consistent-function-scoping)
//
//                              here
//                              ⬇
export const someAction = () => (dispatch) =>
  dispatch({
    type: SOME_TYPE,
  });

Function declaration (no error):

export function someAction() {
  return (dispatch) =>
    dispatch({
      type: SOME_TYPE,
    });
}

The arrow function in the second one should be reported.


Original posted by @Arttse https://github.com/sindresorhus/eslint-plugin-unicorn/issues/596#issuecomment-628711205


@fregante has funded $46.61 to this issue.


posted by issuehunt-app[bot] over 1 year ago

I'd really like this rule to actually report as many functions as possible. Currently it feels like it's ignoring a lot of cases, with more exceptions mentioned in https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1074

posted by fregante over 1 year ago

Fund this Issue

$46.61
Funded
Only logged in users can fund an issue

Pull requests

Recent activities

fregante funded 46.61 for sindresorhus/eslint-plugin-unicorn# 931
over 1 year ago