sindresorhus/eslint-plugin-unicorn

Rule proposal: `max-nested-calls`

Fechada

#1.274 aberto em 14 de mai. de 2021

 (3 comentários) (7 reações) (0 responsável)JavaScript (468 forks)user submission
help wantednew rule

Métricas do repositório

Stars
 (5.022 estrelas)
Métricas de merge de PR
 (Mesclagem média 4h 30m) (26 fundiu PRs em 30d)

Description

Got the idea from this line.

Fail

mergeReports(await pMap(await mergeWithFileConfigs(uniq(paths), inputOptions, configFiles), async ({files, options, prettierOptions}) => runEslint(files, buildConfig(options, prettierOptions), {isQuiet: options.quiet})));

Pass

const uniqPaths = uniq(paths);
const mergedConfigs = await mergeWithFileConfigs(
  uniqPaths,
  inputOptions,
  configFiles
);
const reports = await pMap(
  mergedConfigs,
  async ({ files, options, prettierOptions }) =>
    runEslint(
      files, 
      buildConfig(options, prettierOptions),
      {isQuiet: options.quiet}
    )
);

mergeReports(reports);

Maybe with a configurable depth option.

These should all considered as "call"

  • CallExpression
  • ChainExpression > CallExpression
  • NewExpression
  • AwaitExpression > NodeTypesListedAbove.argument

Guia do colaborador