Skip to content

Commit 4d23429

Browse files
committed
fix eslint errors
1 parent a292ae1 commit 4d23429

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ namespace ts {
814814
// We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks
815815
// `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`.
816816
let structuralIsReused: StructureIsReused | undefined;
817-
structuralIsReused = tryReuseStructureFromOldProgram();
817+
structuralIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const
818818
if (structuralIsReused !== StructureIsReused.Completely) {
819819
processingDefaultLibFiles = [];
820820
processingOtherFiles = [];

src/compiler/scanner.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,17 +2225,17 @@ namespace ts {
22252225
const size = str.length;
22262226
// Account for out-of-bounds indices:
22272227
if (i < 0 || i >= size) {
2228-
return undefined!; // String.codePointAt returns `undefined` for OOB indexes
2228+
return undefined!; // String.codePointAt returns `undefined` for OOB indexes
22292229
}
22302230
// Get the first code unit
22312231
const first = str.charCodeAt(i);
22322232
// check if it’s the start of a surrogate pair
22332233
if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { // high surrogate and there is a next code unit
2234-
const second = str.charCodeAt(i + 1);
2235-
if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
2236-
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
2237-
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
2238-
}
2234+
const second = str.charCodeAt(i + 1);
2235+
if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
2236+
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
2237+
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
2238+
}
22392239
}
22402240
return first;
22412241
};

src/compiler/transformers/declarations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace ts {
8383
let currentSourceFile: SourceFile;
8484
let refs: Map<SourceFile>;
8585
let libs: Map<boolean>;
86-
let emittedImports: readonly AnyImportSyntax[] | undefined; // must be declared in container so it can be `undefined` while transformer's first pass
86+
let emittedImports: ReadonlyArray<AnyImportSyntax> | undefined; // must be declared in container so it can be `undefined` while transformer's first pass
8787
const resolver = context.getEmitResolver();
8888
const options = context.getCompilerOptions();
8989
const newLine = getNewLineCharacter(options);

src/services/codefixes/importFixes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ namespace ts.codefix {
360360
case ModuleKind.UMD:
361361
if (isInJSFile(importingFile)) {
362362
return isExternalModule(importingFile) ? ImportKind.Namespace : ImportKind.ConstEquals;
363-
}
364-
return ImportKind.Equals;
363+
}
364+
return ImportKind.Equals;
365365
case ModuleKind.System:
366366
case ModuleKind.ES2015:
367367
case ModuleKind.ESNext:

src/testRunner/unittests/tsbuild/watchEnvironment.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ namespace ts.tscWatch {
2929
solutionBuilder.build();
3030
checkOutputErrorsInitial(system, emptyArray, /*disableConsoleClears*/ undefined, [
3131
`Projects in this build: \r\n${
32-
concatenate(
33-
pkgs(index => ` * pkg${index}/tsconfig.json`),
34-
[" * tsconfig.json"]
35-
).join("\r\n")}\n\n`,
32+
concatenate(
33+
pkgs(index => ` * pkg${index}/tsconfig.json`),
34+
[" * tsconfig.json"]
35+
).join("\r\n")}\n\n`,
3636
...flatArray(pkgs(index => [
3737
`Project 'pkg${index}/tsconfig.json' is out of date because output file 'pkg${index}/index.js' does not exist\n\n`,
3838
`Building project '${project}/pkg${index}/tsconfig.json'...\n\n`
@@ -70,7 +70,7 @@ namespace ts.tscWatch {
7070
system.writeFile(typing.path, `${typing.content}export const typing1 = 10;`);
7171
system.checkTimeoutQueueLength(0);
7272

73-
function flatArray<T>(arr: T[][]): readonly T[] {
73+
function flatArray<T>(arr: T[][]): ReadonlyArray<T> {
7474
return flatMap(arr, identity);
7575
}
7676
function pkgs<T>(cb: (index: number) => T): T[] {

0 commit comments

Comments
 (0)