From 7aa4466b699573f9e99480df327a1224c305cf78 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 31 Jan 2024 14:19:01 +0530 Subject: [PATCH 1/2] chore: Add interface naming --- .eslintrc.cjs | 11 +++++++++++ .../src/diagrams/quadrant-chart/quadrantBuilder.ts | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 49e1aaaa66..fca001dc22 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -63,6 +63,17 @@ module.exports = { minimumDescriptionLength: 10, }, ], + '@typescript-eslint/naming-convention': [ + 'error', + { + selector: 'interface', + format: ['PascalCase'], + custom: { + regex: '^I[A-Z]', + match: false, + }, + }, + ], 'json/*': ['error', 'allowComments'], '@cspell/spellchecker': [ 'error', diff --git a/packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts b/packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts index 380a79f190..9f5e3933a1 100644 --- a/packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts +++ b/packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts @@ -53,7 +53,7 @@ export interface QuadrantBuildType { borderLines?: QuadrantLineType[]; } -export interface quadrantBuilderData { +export interface QuadrantBuilderData { titleText: string; quadrant1Text: string; quadrant2Text: string; @@ -116,7 +116,7 @@ interface CalculateSpaceData { export class QuadrantBuilder { private config: QuadrantBuilderConfig; private themeConfig: QuadrantBuilderThemeConfig; - private data: quadrantBuilderData; + private data: QuadrantBuilderData; constructor() { this.config = this.getDefaultConfig(); @@ -124,7 +124,7 @@ export class QuadrantBuilder { this.data = this.getDefaultData(); } - getDefaultData(): quadrantBuilderData { + getDefaultData(): QuadrantBuilderData { return { titleText: '', quadrant1Text: '', @@ -194,7 +194,7 @@ export class QuadrantBuilder { log.info('clear called'); } - setData(data: Partial) { + setData(data: Partial) { this.data = { ...this.data, ...data }; } From e9680e086e1f9a3a9d9963989fbfb82b7a9588cb Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 31 Jan 2024 14:27:46 +0530 Subject: [PATCH 2/2] Fix selector --- .eslintrc.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index fca001dc22..9b3426ce8f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -66,7 +66,7 @@ module.exports = { '@typescript-eslint/naming-convention': [ 'error', { - selector: 'interface', + selector: 'typeLike', format: ['PascalCase'], custom: { regex: '^I[A-Z]',