mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 05:55:11 -05:00
Update CodeQL workflow and configuration, fix found bugs (#51263)
This commit is contained in:
@@ -171,7 +171,7 @@ function main() {
|
||||
*/
|
||||
function getItemXML(key, value) {
|
||||
// escape entrt value
|
||||
value = value.replace(/]/, "]5D;");
|
||||
value = value.replace(/]/g, "]5D;");
|
||||
|
||||
return `
|
||||
<Item ItemId=";${key}" ItemType="0" PsrId="306" Leaf="true">
|
||||
|
||||
@@ -157,7 +157,7 @@ function importDefinitelyTypedTests(tscPath, rwcTestPath, definitelyTypedRoot) {
|
||||
|
||||
if (testFiles.length === 0) {
|
||||
// no test files but multiple d.ts's, e.g. winjs
|
||||
const regexp = new RegExp(d + "(([-][0-9])|([\.]d[\.]ts))");
|
||||
const regexp = new RegExp(d + "(([-][0-9])|(\\.d\\.ts))");
|
||||
if (tsFiles.length > 1 && tsFiles.every(t => filePathEndsWith(t, ".d.ts") && regexp.test(t))) {
|
||||
for (const fileName of tsFiles) {
|
||||
importDefinitelyTypedTest(tscPath, rwcTestPath, path.basename(fileName, ".d.ts"), [fileName], paramFile);
|
||||
|
||||
@@ -104,19 +104,15 @@ function buildInfoFileOutput(messageTable, inputFilePathRel, thisFilePathRel) {
|
||||
* @returns {string}
|
||||
*/
|
||||
function buildDiagnosticMessageOutput(messageTable) {
|
||||
let result = "{";
|
||||
/** @type {Record<string, string>} */
|
||||
const result = {};
|
||||
|
||||
messageTable.forEach(({ code }, name) => {
|
||||
const propName = convertPropertyName(name);
|
||||
result += `\r\n "${createKey(propName, code)}" : "${name.replace(/[\"]/g, '\\"')}",`;
|
||||
result[createKey(propName, code)] = name;
|
||||
});
|
||||
|
||||
// Shave trailing comma, then add newline and ending brace
|
||||
result = result.slice(0, result.length - 1) + "\r\n}";
|
||||
|
||||
// Assert that we generated valid JSON
|
||||
JSON.parse(result);
|
||||
|
||||
return result;
|
||||
return JSON.stringify(result, undefined, 2).replace(/\r?\n/g, "\r\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user