From 650600c5e4d7d5a617e40ec65449bb8665676d69 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Fri, 14 Jun 2019 11:58:42 +0300 Subject: [PATCH] linebreak-style --- .eslintrc | 2 +- .../generateLocalizedDiagnosticMessages.ts | 354 +++++++++--------- src/lib/es2019.symbol.d.ts | 12 +- 3 files changed, 184 insertions(+), 184 deletions(-) diff --git a/.eslintrc b/.eslintrc index 4cf339e94d8..7855d4f6277 100644 --- a/.eslintrc +++ b/.eslintrc @@ -71,7 +71,7 @@ "eol-last": "off", "eqeqeq": "error", "guard-for-in": "off", - "linebreak-style": "off", + "linebreak-style": ["error", "windows"], "max-classes-per-file": "off", "max-len": "off", "new-parens": "error", diff --git a/scripts/generateLocalizedDiagnosticMessages.ts b/scripts/generateLocalizedDiagnosticMessages.ts index 98bae170baa..abfe6a3cff9 100644 --- a/scripts/generateLocalizedDiagnosticMessages.ts +++ b/scripts/generateLocalizedDiagnosticMessages.ts @@ -1,177 +1,177 @@ -import * as fs from "fs"; -import * as path from "path"; -import * as xml2js from "xml2js"; - -function main(): void { - const args = process.argv.slice(2); - if (args.length !== 3) { - console.log("Usage:"); - console.log("\tnode generateLocalizedDiagnosticMessages.js "); - return; - } - - const inputPath = args[0]; - const outputPath = args[1]; - const diagnosticsMapFilePath = args[2]; - - // generate the lcg file for enu - generateLCGFile(); - - // generate other langs - fs.readdir(inputPath, (err, files) => { - handleError(err); - files.forEach(visitDirectory); - }); - - return; - - function visitDirectory(name: string) { - const inputFilePath = path.join(inputPath, name, "diagnosticMessages", "diagnosticMessages.generated.json.lcl"); - - fs.readFile(inputFilePath, (err, data) => { - handleError(err); - xml2js.parseString(data.toString(), (err, result) => { - handleError(err); - if (!result || !result.LCX || !result.LCX.$ || !result.LCX.$.TgtCul) { - console.error("Unexpected XML file structure. Expected to find result.LCX.$.TgtCul."); - process.exit(1); - } - const outputDirectoryName = getPreferredLocaleName(result.LCX.$.TgtCul).toLowerCase(); - if (!outputDirectoryName) { - console.error(`Invalid output locale name for '${result.LCX.$.TgtCul}'.`); - process.exit(1); - } - writeFile(path.join(outputPath, outputDirectoryName, "diagnosticMessages.generated.json"), xmlObjectToString(result)); - }); - }); - } - - /** - * A locale name is based on the language tagging conventions of RFC 4646 (Windows Vista - * and later), and is represented by LOCALE_SNAME. - * Generally, the pattern - is used. Here, language is a lowercase ISO 639 - * language code. The codes from ISO 639-1 are used when available. Otherwise, codes from - * ISO 639-2/T are used. REGION specifies an uppercase ISO 3166-1 country/region identifier. - * For example, the locale name for English (United States) is "en-US" and the locale name - * for Divehi (Maldives) is "dv-MV". - * - * If the locale is a neutral locale (no region), the LOCALE_SNAME value follows the - * pattern . If it is a neutral locale for which the script is significant, the - * pattern is -