Implemented settings type

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 8 years ago
parent 6d455a46e2
commit f5c85c26e2
  1. 6
      BuildServer/lib/tasks/dotnetcompile.ts
  2. 6
      BuildServer/lib/tasks/dotnetrewrite.ts
  3. 12
      BuildServer/lib/tasks/eslintbrowser.ts
  4. 3
      BuildServer/types/index.ts
  5. 63
      BuildServer/types/settings-types.ts

@ -3,10 +3,12 @@
import { join } from "path";
import * as _ from "underscore";
import settings from "../../settings";
import { Task } from "../../types";
import rawSettings from "../../settings";
import { Settings, Task } from "../../types";
import dotnetbuilderwrapper from "./dotnetbuilderwrapper";
const settings: Settings = rawSettings;
export default ((params, processor) => {
if (settings.isCodeAnalysisUnsupported && params.forceCodeAnalysis) {
processor.onError("Code analysis is not supported");

@ -5,11 +5,13 @@ import { readFile, writeFile } from "fs";
import * as glob from "glob";
import { join } from "path";
import settings from "../../settings";
import { Task } from "../../types";
import rawSettings from "../../settings";
import { Settings, Task } from "../../types";
const flagDoneName = "dotnetrewriterDone";
const settings: Settings = rawSettings;
const processAssemblyInfo = (params, processor, appendInformationalVersion) => (originalContent, cb) => {
const processInternalsVisible = (content) => {
if (params.skipCodeSigning || settings.skipCodeSigning) {

@ -3,14 +3,20 @@
import { CLIEngine } from "eslint";
import { join } from "path";
import settings from "../../settings";
import { Task } from "../../types";
import rawSettings from "../../settings";
import { Settings, Task } from "../../types";
const cli = new CLIEngine({ configFile: settings.eslintBrowserConfig });
const settings: Settings = rawSettings;
const errorSeverity = 2;
export default ((params, processor) => () => {
if (settings.isCodeAnalysisUnsupported) {
return;
}
const cli = new CLIEngine({ configFile: settings.eslintBrowserConfig });
const filePath = join(processor.context.exported, params.filename);
const result = cli.executeOnFiles([filePath]);

@ -1,4 +1,5 @@
import * as ReportTypes from "./report-types";
import * as SettingsTypes from "./settings-types";
import * as TaskProcessorTypes from "./task-processor-types";
export type Message = ReportTypes.IMessage;
@ -7,6 +8,8 @@ export type MessagesRoot = ReportTypes.MessagesRoot;
export type Report = ReportTypes.IReport;
export type ReportResult = ReportTypes.IReportResult;
export type Settings = SettingsTypes.Settings;
export type Task = TaskProcessorTypes.Task;
export type TaskInfo = TaskProcessorTypes.ITaskInfo;
export type TaskProcessor = TaskProcessorTypes.ITaskProcessor;

@ -0,0 +1,63 @@
import * as Github from "github";
interface IBuilderSettings {
builderExecutable: string;
}
interface ICodeAnalysisSettingsUnsupported {
isCodeAnalysisUnsupported: true;
}
interface ICodeAnalysisSettingsSupported {
eslintBrowserConfig: string;
ignoreCodeAnalysisByDefault: boolean;
isCodeAnalysisUnsupported: false;
}
type CodeAnalysisSettings = ICodeAnalysisSettingsUnsupported | ICodeAnalysisSettingsSupported;
interface ICodeSigningSettingsUnsupported {
skipCodeSigning: true;
}
interface ICodeSigningSettingsSupported {
codeSigningKeyFile: string;
codeSigningPublicKey: string;
skipCodeSigning: false;
}
type CodeSigningSettings = ICodeSigningSettingsUnsupported | ICodeSigningSettingsSupported;
interface IStorageSettings {
gitpath: string;
releasepath: string;
tmpcodepath: string;
}
interface INugetSettings {
nugetApiKey: string;
nugetHost: string;
}
interface ISmtpSettings {
smtp: {
auth: {
pass: string;
user: string;
},
host: string;
receiver: string;
sender: string;
};
}
interface ISiteSettings {
port: number | string;
siteRoot: string;
}
interface IGithubSettings {
createGithub: (repoOwner: string) => Github;
}
export type Settings = IBuilderSettings & CodeAnalysisSettings & CodeSigningSettings & IStorageSettings & INugetSettings & ISmtpSettings & ISiteSettings & IGithubSettings;
Loading…
Cancel
Save