sindresorhus/eslint-plugin-unicorn
Rule proposal: `max-nested-calls`
Closed
#1,274 opened on May 14, 2021
help wantednew rule
Repository metrics
- Stars
- (5,022 stars)
- PR merge metrics
- (Avg merge 1d 16h) (399 merged PRs in 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"
CallExpressionChainExpression > CallExpressionNewExpressionAwaitExpression > NodeTypesListedAbove.argument