From 70f4c9c34005e10bef912a8edf13bdd5ac9c151f Mon Sep 17 00:00:00 2001 From: Adela Homolova Date: Thu, 19 Sep 2019 15:05:54 +0200 Subject: [PATCH] fix: Interface of Config; add interface for EslintConfig and use it in PracticeContext --- src/contexts/IConfigProvider.ts | 8 +++++++- src/contexts/practice/PracticeContext.ts | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/contexts/IConfigProvider.ts b/src/contexts/IConfigProvider.ts index f2c6d8835..49ea2bbfd 100644 --- a/src/contexts/IConfigProvider.ts +++ b/src/contexts/IConfigProvider.ts @@ -10,10 +10,16 @@ export interface Config { [key in Practices]?: PracticeImpact; }; tokens?: { - [key in Service]: string; + [key in Service]: string | EslintConfig; }; } +export interface EslintConfig { + eslintIgnore?: string[]; + useEslintrc?: boolean; + impact?: string; +} + enum Service { Slack = 'Slack', } diff --git a/src/contexts/practice/PracticeContext.ts b/src/contexts/practice/PracticeContext.ts index edf0336b9..315f3eebd 100644 --- a/src/contexts/practice/PracticeContext.ts +++ b/src/contexts/practice/PracticeContext.ts @@ -4,6 +4,7 @@ import { IIssueTrackingInspector } from '../../inspectors/IIssueTrackingInspecto import { ProjectComponent } from '../../model'; import { IFileInspector } from '../../inspectors/IFileInspector'; import { ICollaborationInspector } from '../../inspectors/ICollaborationInspector'; +import { EslintConfig } from '../IConfigProvider'; export interface PracticeContext { projectComponent: ProjectComponent; @@ -12,5 +13,5 @@ export interface PracticeContext { issueTrackingInspector: IIssueTrackingInspector | undefined; collaborationInspector: ICollaborationInspector | undefined; fileInspector: IFileInspector | undefined; - config?: any; //Config + config?: EslintConfig; }