Skip to content

Commit 627211b

Browse files
committed
quotes
1 parent 713d6ec commit 627211b

File tree

9 files changed

+55
-56
lines changed

9 files changed

+55
-56
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"prefer-const": "off",
116116
"prefer-object-spread": "error",
117117
"quote-props": ["error", "consistent-as-needed"],
118-
"quotes": "off",
118+
"quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
119119
"radix": "off",
120120
"sort-keys": "off",
121121
"space-before-function-paren": "off",

scripts/authors.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import fs = require('fs');
2-
import path = require('path');
1+
import fs = require("fs");
2+
import path = require("path");
33
import child_process = require("child_process");
44

55
interface Author {
@@ -169,14 +169,14 @@ namespace Commands {
169169

170170
var args = process.argv.slice(2);
171171
if (args.length < 1) {
172-
console.log('Usage: node authors.js [command]');
173-
console.log('List of commands: ');
172+
console.log("Usage: node authors.js [command]");
173+
console.log("List of commands: ");
174174
Object.keys(Commands).forEach(k => console.log(` ${k}: ${(Commands as any)[k].description}`));
175175
}
176176
else {
177177
var cmd: Function = (Commands as any)[args[0]];
178178
if (cmd === undefined) {
179-
console.log('Unknown command ' + args[1]);
179+
console.log("Unknown command " + args[1]);
180180
}
181181
else {
182182
cmd.apply(undefined, args.slice(1));

scripts/bisect-test.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,62 @@
22
* You should have ts-node installed globally before executing this, probably!
33
* Otherwise you'll need to compile this script before you start bisecting!
44
*/
5-
import cp = require('child_process');
6-
import fs = require('fs');
5+
import cp = require("child_process");
6+
import fs = require("fs");
77

88
// Slice off 'node bisect-test.js' from the command line args
99
var args = process.argv.slice(2);
1010

1111
function tsc(tscArgs: string, onExit: (exitCode: number) => void) {
12-
var tsc = cp.exec('node built/local/tsc.js ' + tscArgs,() => void 0);
13-
tsc.on('close', tscExitCode => {
12+
var tsc = cp.exec("node built/local/tsc.js " + tscArgs,() => void 0);
13+
tsc.on("close", tscExitCode => {
1414
onExit(tscExitCode);
1515
});
1616
}
1717

1818
// TODO: Rewrite bisect script to handle the post-jake/gulp swap period
19-
var jake = cp.exec('jake clean local', () => void 0);
20-
jake.on('close', jakeExitCode => {
19+
var jake = cp.exec("jake clean local", () => void 0);
20+
jake.on("close", jakeExitCode => {
2121
if (jakeExitCode === 0) {
2222
// See what we're being asked to do
23-
if (args[1] === 'compiles' || args[1] === '!compiles') {
23+
if (args[1] === "compiles" || args[1] === "!compiles") {
2424
tsc(args[0], tscExitCode => {
25-
if ((tscExitCode === 0) === (args[1] === 'compiles')) {
26-
console.log('Good');
25+
if ((tscExitCode === 0) === (args[1] === "compiles")) {
26+
console.log("Good");
2727
process.exit(0); // Good
2828
}
2929
else {
30-
console.log('Bad');
30+
console.log("Bad");
3131
process.exit(1); // Bad
3232
}
3333
});
3434
}
35-
else if (args[1] === 'emits' || args[1] === '!emits') {
35+
else if (args[1] === "emits" || args[1] === "!emits") {
3636
tsc(args[0], tscExitCode => {
37-
fs.readFile(args[2], 'utf-8', (err, data) => {
37+
fs.readFile(args[2], "utf-8", (err, data) => {
3838
var doesContains = data.indexOf(args[3]) >= 0;
39-
if (doesContains === (args[1] === 'emits')) {
40-
console.log('Good');
39+
if (doesContains === (args[1] === "emits")) {
40+
console.log("Good");
4141
process.exit(0); // Good
4242
}
4343
else {
44-
console.log('Bad');
44+
console.log("Bad");
4545
process.exit(1); // Bad
4646
}
4747
});
4848
});
4949
}
5050
else {
51-
console.log('Unknown command line arguments.');
52-
console.log('Usage (compile errors): git bisect run ts-node scripts\bisect-test.ts "../failure.ts --module amd" !compiles');
53-
console.log('Usage (emit check): git bisect run ts-node scripts\bisect-test.ts bar.ts emits bar.js "_this = this"');
51+
console.log("Unknown command line arguments.");
52+
console.log("Usage (compile errors): git bisect run ts-node scripts\bisect-test.ts '../failure.ts --module amd' !compiles");
53+
console.log("Usage (emit check): git bisect run ts-node scripts\bisect-test.ts bar.ts emits bar.js '_this = this'");
5454
// Aborts the 'git bisect run' process
5555
process.exit(-1);
5656
}
5757
}
5858
else {
5959
// Compiler build failed; skip this commit
60-
console.log('Skip');
60+
console.log("Skip");
6161
process.exit(125); // bisect skip
6262
}
6363
});

scripts/buildProtocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptSer
140140
if (protocolDts === undefined) {
141141
const diagHost: ts.FormatDiagnosticsHost = {
142142
getCanonicalFileName(f) { return f; },
143-
getCurrentDirectory() { return '.'; },
143+
getCurrentDirectory() { return "."; },
144144
getNewLine() { return "\r\n"; }
145145
};
146146
const diags = emitResult.diagnostics.map(d => ts.formatDiagnostic(d, diagHost)).join("\r\n");

scripts/errorCheck.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
declare var require: any;
2-
let fs = require('fs');
3-
let async = require('async');
4-
let glob = require('glob');
2+
let fs = require("fs");
3+
let async = require("async");
4+
let glob = require("glob");
55

6-
fs.readFile('src/compiler/diagnosticMessages.json', 'utf-8', (err, data) => {
6+
fs.readFile("src/compiler/diagnosticMessages.json", "utf-8", (err, data) => {
77
if (err) {
88
throw err;
99
}
1010

1111
let messages = JSON.parse(data);
1212
let keys = Object.keys(messages);
13-
console.log('Loaded ' + keys.length + ' errors');
13+
console.log("Loaded " + keys.length + " errors");
1414

1515
for (let k of keys) {
1616
messages[k].seen = false;
1717
}
1818

1919
let errRegex = /\(\d+,\d+\): error TS([^:]+):/g;
2020

21-
let baseDir = 'tests/baselines/reference/';
21+
let baseDir = "tests/baselines/reference/";
2222
fs.readdir(baseDir, (err, files) => {
23-
files = files.filter(f => f.indexOf('.errors.txt') > 0);
23+
files = files.filter(f => f.indexOf(".errors.txt") > 0);
2424
let tasks: Array<(callback: () => void) => void> = [];
2525
files.forEach(f => tasks.push(done => {
26-
fs.readFile(baseDir + f, 'utf-8', (err, baseline) => {
26+
fs.readFile(baseDir + f, "utf-8", (err, baseline) => {
2727
if (err) throw err;
2828

2929
let g: string[];
@@ -38,49 +38,49 @@ fs.readFile('src/compiler/diagnosticMessages.json', 'utf-8', (err, data) => {
3838
}));
3939

4040
async.parallelLimit(tasks, 25, done => {
41-
console.log('== List of errors not present in baselines ==');
41+
console.log("== List of errors not present in baselines ==");
4242
let count = 0;
4343
for (let k of keys) {
4444
if (messages[k].seen !== true) {
4545
console.log(k);
4646
count++;
4747
}
4848
}
49-
console.log(count + ' of ' + keys.length + ' errors are not in baselines');
49+
console.log(count + " of " + keys.length + " errors are not in baselines");
5050
});
5151
});
5252
});
5353

54-
fs.readFile('src/compiler/diagnosticInformationMap.generated.ts', 'utf-8', (err, data) => {
54+
fs.readFile("src/compiler/diagnosticInformationMap.generated.ts", "utf-8", (err, data) => {
5555
let errorRegexp = /\s(\w+): \{ code/g;
5656
let errorNames: string[] = [];
5757
let errMatch: string[];
5858
while (errMatch = errorRegexp.exec(data)) {
5959
errorNames.push(errMatch[1]);
6060
}
6161

62-
let allSrc = '';
63-
glob('./src/**/*.ts', {}, (err, files) => {
64-
console.log('Reading ' + files.length + ' source files');
62+
let allSrc = "";
63+
glob("./src/**/*.ts", {}, (err, files) => {
64+
console.log("Reading " + files.length + " source files");
6565
for (let file of files) {
66-
if (file.indexOf('diagnosticInformationMap.generated.ts') > 0) {
66+
if (file.indexOf("diagnosticInformationMap.generated.ts") > 0) {
6767
continue;
6868
}
6969

70-
let src = fs.readFileSync(file, 'utf-8');
70+
let src = fs.readFileSync(file, "utf-8");
7171
allSrc = allSrc + src;
7272
}
7373

74-
console.log('Consumed ' + allSrc.length + ' characters of source');
74+
console.log("Consumed " + allSrc.length + " characters of source");
7575

7676
let count = 0;
77-
console.log('== List of errors not used in source ==');
77+
console.log("== List of errors not used in source ==");
7878
for (let errName of errorNames) {
7979
if (allSrc.indexOf(errName) < 0) {
8080
console.log(errName);
8181
count++;
8282
}
8383
}
84-
console.log(count + ' of ' + errorNames.length + ' errors are not used in source');
84+
console.log(count + " of " + errorNames.length + " errors are not used in source");
8585
});
8686
});

scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function importDefinitelyTypedTest(tscPath: string, rwcTestPath: string, testCas
9595
//console.log("\r\n");
9696

9797
})
98-
.on('error', (error: any) => {
98+
.on("error", (error: any) => {
9999
console.log("==> error " + JSON.stringify(error));
100100
console.log("\r\n");
101101
});

scripts/processDiagnosticMessages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function checkForUniqueCodes(diagnosticTable: InputDiagnosticMessageTable) {
6060
function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, inputFilePathRel: string, thisFilePathRel: string): string {
6161
let result =
6262
"// <auto-generated />\r\n" +
63-
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel.replace(/\\/g, '/') + "'\r\n" +
63+
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel.replace(/\\/g, "/") + "'\r\n" +
6464
"/* @internal */\r\n" +
6565
"namespace ts {\r\n" +
6666
" function diag(code: number, category: DiagnosticCategory, key: string, message: string, reportsUnnecessary?: {}): DiagnosticMessage {\r\n" +

scripts/produceLKG.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// <reference types="node" />
22

3-
import childProcess = require('child_process');
4-
import fs = require('fs-extra');
5-
import path = require('path');
6-
import removeInternal = require('remove-internal');
7-
import glob = require('glob');
3+
import childProcess = require("child_process");
4+
import fs = require("fs-extra");
5+
import path = require("path");
6+
import removeInternal = require("remove-internal");
7+
import glob = require("glob");
88

99
const root = path.join(__dirname, "..");
1010
const source = path.join(root, "built/local");
@@ -30,7 +30,6 @@ async function copyLocalizedDiagnostics() {
3030
for (const d of dir) {
3131
const fileName = path.join(source, d);
3232
if (fs.statSync(fileName).isDirectory()) {
33-
if (d === 'tslint') continue;
3433
await fs.copy(fileName, path.join(dest, d));
3534
}
3635
}

src/lib/es2018.intl.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
declare namespace Intl {
22
interface PluralRulesOptions {
3-
localeMatcher?: 'lookup' | 'best fit';
4-
type?: 'cardinal' | 'ordinal';
3+
localeMatcher?: "lookup" | "best fit";
4+
type?: "cardinal" | "ordinal";
55
}
66

77
interface ResolvedPluralRulesOptions {
88
locale: string;
99
pluralCategories: string[];
10-
type: 'cardinal' | 'ordinal';
10+
type: "cardinal" | "ordinal";
1111
minimumIntegerDigits: number;
1212
minimumFractionDigits: number;
1313
maximumFractionDigits: number;

0 commit comments

Comments
 (0)