Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
style: disable cognitive complexity ESLint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
jordimarimon committed Dec 2, 2023
1 parent 1c0b43e commit 21e3da4
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 10 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
"import/no-named-as-default-member": "off",

"sonarjs/no-duplicate-string": "off",
"sonarjs/cognitive-complexity": "off",

"jsdoc/require-jsdoc": "off",
"jsdoc/tag-lines": [
Expand Down
2 changes: 0 additions & 2 deletions packages/comment/src/symbols/block-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export function blockTag(): ParserSymbol {
let pos = 0;

return {
// eslint-disable-next-line sonarjs/cognitive-complexity
next(token: Token): ParserStatus {
const symbol = symbols[pos] as ParserSymbol;
const status = symbol.next(token);
Expand Down Expand Up @@ -104,7 +103,6 @@ export function blockTag(): ParserSymbol {
return pos > 4;
},

// eslint-disable-next-line sonarjs/cognitive-complexity
serialize(): CommentPart[] {
if (pos <= 4) {
return [];
Expand Down
3 changes: 0 additions & 3 deletions packages/comment/src/symbols/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function description(): ParserSymbol {
};
}

// eslint-disable-next-line sonarjs/cognitive-complexity
export function descriptionLine(options: DescriptionLineOptions): ParserSymbol {
const symbols = [
options.startPadding
Expand Down Expand Up @@ -83,7 +82,6 @@ export function descriptionLine(options: DescriptionLineOptions): ParserSymbol {
let tokens: Token[] = [];

return {
// eslint-disable-next-line sonarjs/cognitive-complexity
next(token: Token): ParserStatus {
tokens.push(token);

Expand Down Expand Up @@ -169,7 +167,6 @@ export function descriptionLine(options: DescriptionLineOptions): ParserSymbol {
};
}

// eslint-disable-next-line sonarjs/cognitive-complexity
export function serializeDescription(parts: CommentPart[]): string | CommentPart[] {
const result: CommentPart[] = [];
const isEmptyOrNewLine = parts.every(p => p.kind === 'text' && (p.text === '' || p.text === '\n'));
Expand Down
2 changes: 0 additions & 2 deletions packages/comment/src/symbols/inline-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function inlineTagWithSquareBracket(): ParserSymbol {
let isValid = true;

return {
// eslint-disable-next-line sonarjs/cognitive-complexity
next(token: Token): ParserStatus {
const symbol = symbols[pos] as ParserSymbol;
const status = symbol.next(token);
Expand Down Expand Up @@ -170,7 +169,6 @@ function inlineTagWithoutSquareBracket(): ParserSymbol {
let isValid = true;

return {
// eslint-disable-next-line sonarjs/cognitive-complexity
next(token: Token): ParserStatus {
const symbol = symbols[pos] as ParserSymbol;
const status = symbol.next(token);
Expand Down
1 change: 0 additions & 1 deletion packages/comment/src/symbols/one-of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export function oneOf(branches: Branch[]): ParserSymbol {
let acceptedBranch: number | null = null;

return {
// eslint-disable-next-line sonarjs/cognitive-complexity
next(token: Token): ParserStatus {
for (let i = 0; i < branches.length; i++) {
const state = branchesState[i] as BranchState;
Expand Down
1 change: 0 additions & 1 deletion packages/comment/src/symbols/one-or-more.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function oneOrMore(factory: (index: number) => ParserSymbol): ParserSymbo
let tokens: Token[] = [];

return {
// eslint-disable-next-line sonarjs/cognitive-complexity
next(token: Token): ParserStatus {
tokens.push(token);

Expand Down
1 change: 0 additions & 1 deletion packages/core/src/nodes/comment-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export class CommentNode {
return this._parts;
}

// eslint-disable-next-line sonarjs/cognitive-complexity
private _parseComments(node: ts.Node): void {
const isSourceFile = ts.isSourceFile(node);

Expand Down

0 comments on commit 21e3da4

Please sign in to comment.