Skip to content

Commit e414279

Browse files
ESLint: error on function accepting more than 5 parameters (#3641)
1 parent 35bc6a5 commit e414279

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ rules:
348348
max-lines: off
349349
max-lines-per-function: off
350350
max-nested-callbacks: off
351-
max-params: off
351+
max-params: [error, 5] # TODO: drop to default number, which is 3
352352
max-statements: off
353353
max-statements-per-line: off
354354
multiline-comment-style: off

src/execution/collectFields.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function collectSubfields(
8686
return subFieldNodes;
8787
}
8888

89+
// eslint-disable-next-line max-params
8990
function collectFieldsImpl(
9091
schema: GraphQLSchema,
9192
fragments: ObjMap<FragmentDefinitionNode>,

src/execution/execute.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ import {
5555
import { mapAsyncIterator } from './mapAsyncIterator';
5656
import { getArgumentValues, getVariableValues } from './values';
5757

58+
/* eslint-disable max-params */
59+
// This file contains a lot of such errors but we plan to refactor it anyway
60+
// so just disable it for entire file.
61+
5862
/**
5963
* A memoized collection of relevant subfields with regard to the return
6064
* type. Memoizing ensures the subfields are not repeatedly calculated, which

src/language/ast.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export class Token {
9595
readonly prev: Token | null;
9696
readonly next: Token | null;
9797

98+
// eslint-disable-next-line max-params
9899
constructor(
99100
kind: TokenKind,
100101
start: number,

src/validation/rules/OverlappingFieldsCanBeMergedRule.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ import { typeFromAST } from '../../utilities/typeFromAST';
3333

3434
import type { ValidationContext } from '../ValidationContext';
3535

36+
/* eslint-disable max-params */
37+
// This file contains a lot of such errors but we plan to refactor it anyway
38+
// so just disable it for entire file.
39+
3640
function reasonMessage(reason: ConflictReasonMessage): string {
3741
if (Array.isArray(reason)) {
3842
return reason

0 commit comments

Comments
 (0)