@typescript-eslint/semi

This commit is contained in:
Alexander T 2019-06-14 09:46:02 +03:00
parent 55b8a38d50
commit f6ccfb39cc
8 changed files with 19 additions and 19 deletions

View File

@ -46,7 +46,7 @@
"@typescript-eslint/prefer-interface": "off",
"@typescript-eslint/prefer-namespace-keyword": "off",
"semi": "off",
"@typescript-eslint/semi": "off",
"@typescript-eslint/semi": "error",
"@typescript-eslint/type-annotation-spacing": "off",
"@typescript-eslint/unified-signatures": "off",

View File

@ -71,7 +71,7 @@ function getKnownAuthorMaps() {
}
function deduplicate<T>(array: T[]): T[] {
let result: T[] = []
let result: T[] = [];
if (array) {
for (const item of array) {
if (result.indexOf(item) < 0) {

View File

@ -28,11 +28,11 @@ class DeclarationsWalker {
: "";
if (walker.removedTypes) {
text += "\ndeclare namespace ts {\n";
text += " // these types are empty stubs for types from services and should not be used directly\n"
text += " // these types are empty stubs for types from services and should not be used directly\n";
for (const type of walker.removedTypes) {
text += ` export type ${type.symbol!.name} = never;\n`;
}
text += "}"
text += "}";
}
return text;
}
@ -142,7 +142,7 @@ function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptSer
getCanonicalFileName: function (f) { return f; },
getCurrentDirectory: function() { return '.'; },
getNewLine: function() { return "\r\n"; }
}
};
const diags = emitResult.diagnostics.map(d => ts.formatDiagnostic(d, diagHost)).join("\r\n");
throw new Error(`Declaration file for protocol.ts is not generated:\r\n${diags}`);
}
@ -161,7 +161,7 @@ function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptSer
return ts.createSourceFile(fileName, protocolDts, options.target);
}
return originalGetSourceFile.apply(host, [fileName]);
}
};
const rootFiles = includeTypeScriptServices ? [protocolFileName, typeScriptServicesDts] : [protocolFileName];
return ts.createProgram(rootFiles, options, host);
}

View File

@ -48,7 +48,7 @@ function main(): void {
// Finally write the changes to disk.
// Modify the package.json structure
packageJsonValue.version = `${majorMinor}.${prereleasePatch}`;
writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4))
writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4));
writeFileSync(tsFilePath, modifiedTsFileContents);
}

View File

@ -11,16 +11,16 @@ declare var process: {
argv: string[];
env: Map<string>;
exit(exitCode?: number): void;
}
};
main();
function main() {
const [, progName, tscRoot, definitelyTypedRoot] = process.argv;
if (process.argv.length !== 4) {
if (process.argv.length < 2) {
throw "Expected at least 2 argv elements."
throw "Expected at least 2 argv elements.";
}
console.log("Usage:")
console.log("Usage:");
console.log(` node ${path.relative(__dirname, progName)} [TypeScript Repo Root] [DefinitelyTyped Repo Root]`);
return;
}
@ -52,7 +52,7 @@ function importDefinitelyTypedTest(tscPath: string, rwcTestPath: string, testCas
cmd += " @" + responseFile;
}
let testDirectoryName = testCaseName + "_" + Math.floor((Math.random() * 10000) + 1);
let testDirectoryName = testCaseName + "_" + Math.floor((Math.random() * 10000) + 1);
let testDirectoryPath = path.join(process.env["temp"], testDirectoryName);
if (fs.existsSync(testDirectoryPath)) {
throw new Error("Could not create test directory");
@ -156,6 +156,6 @@ function importDefinitelyTypedTests(tscPath: string, rwcTestPath: string, defini
}
}
});
})
});
});
}
}

View File

@ -34,7 +34,7 @@ async function main() {
logText = `Cherry-pick PR #${process.env.SOURCE_ISSUE} into ${process.env.TARGET_BRANCH}
Component commits:
${logText.trim()}`
${logText.trim()}`;
const logpath = path.join(__dirname, "../", "logmessage.txt");
runSequence([
["git", ["checkout", "-b", "temp-branch"]],
@ -51,7 +51,7 @@ ${logText.trim()}`
runSequence([
["git", ["checkout", process.env.TARGET_BRANCH]], // checkout the target branch
["git", ["checkout", "-b", branchName]], // create a new branch
["git", ["cherry-pick", squashSha.trim()]], //
["git", ["cherry-pick", squashSha.trim()]], //
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
["git", ["push", "--set-upstream", "fork", branchName, "-f"]] // push the branch
]);
@ -102,4 +102,4 @@ main().catch(async e => {
body: `Hey @${process.env.REQUESTING_USER}, I couldn't open a PR with the cherry-pick. ([You can check the log here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary)). You may need to squash and pick this PR into ${process.env.TARGET_BRANCH} manually.`
});
}
});
});

View File

@ -20,7 +20,7 @@ function main(): void {
function writeFile(fileName: string, contents: string) {
fs.writeFile(path.join(path.dirname(inputFilePath), fileName), contents, { encoding: "utf-8" }, err => {
if (err) throw err;
})
});
}
const inputFilePath = process.argv[2].replace(/\\/g, "/");

View File

@ -15,7 +15,7 @@ namespace ts.server.typingsInstaller {
isEnabled = () => {
return typeof this.logFile === "string";
}
};
writeLine = (text: string) => {
if (typeof this.logFile !== "string") return;
@ -25,7 +25,7 @@ namespace ts.server.typingsInstaller {
catch (e) {
this.logFile = undefined;
}
}
};
}
/** Used if `--npmLocation` is not passed. */