Skip to content

Commit 16156b1

Browse files
authoredSep 19, 2022
Add rules from eslint's recommended set that triggered good lints (#50422)
1 parent a11c416 commit 16156b1

34 files changed

+54
-48
lines changed
 

‎.eslintrc.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"parser": "@typescript-eslint/parser",
33
"parserOptions": {
44
"warnOnUnsupportedTypeScriptVersion": false,
5-
"ecmaVersion": 6,
65
"sourceType": "module"
76
},
87
"env": {
@@ -27,6 +26,7 @@
2726
"rules": {
2827
"@typescript-eslint/adjacent-overload-signatures": "error",
2928
"@typescript-eslint/array-type": "error",
29+
"@typescript-eslint/no-array-constructor": "error",
3030

3131
"brace-style": "off",
3232
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
@@ -62,12 +62,14 @@
6262
"@typescript-eslint/prefer-for-of": "error",
6363
"@typescript-eslint/prefer-function-type": "error",
6464
"@typescript-eslint/prefer-namespace-keyword": "error",
65+
"@typescript-eslint/prefer-as-const": "error",
6566

6667
"quotes": "off",
6768
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
6869

6970
"semi": "off",
7071
"@typescript-eslint/semi": "error",
72+
"@typescript-eslint/no-extra-semi": "error",
7173

7274
"space-before-function-paren": "off",
7375
"@typescript-eslint/space-before-function-paren": ["error", {
@@ -80,6 +82,8 @@
8082
"@typescript-eslint/type-annotation-spacing": "error",
8183
"@typescript-eslint/unified-signatures": "error",
8284

85+
"@typescript-eslint/no-extra-non-null-assertion": "error",
86+
8387
// scripts/eslint/rules
8488
"local/object-literal-surrounding-space": "error",
8589
"local/no-type-assertion-whitespace": "error",
@@ -143,6 +147,9 @@
143147
"quote-props": ["error", "consistent-as-needed"],
144148
"space-in-parens": "error",
145149
"unicode-bom": ["error", "never"],
146-
"use-isnan": "error"
150+
"use-isnan": "error",
151+
"no-prototype-builtins": "error",
152+
"no-self-assign": "error",
153+
"no-dupe-else-if": "error"
147154
}
148155
}

‎scripts/word2md.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function convertDocumentToMarkdown(doc: Word.Document): string {
185185

186186
function setProperties(target: any, properties: any) {
187187
for (const name in properties) {
188-
if (properties.hasOwnProperty(name)) {
188+
if (Object.prototype.hasOwnProperty.call(properties, name)) {
189189
const value = properties[name];
190190
if (typeof value === "object") {
191191
setProperties(target[name], value);

‎src/compiler/binder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3044,7 +3044,7 @@ namespace ts {
30443044
return;
30453045
}
30463046
const rootExpr = getLeftmostAccessExpression(node.left);
3047-
if (isIdentifier(rootExpr) && lookupSymbolForName(container, rootExpr.escapedText)!?.flags & SymbolFlags.Alias) {
3047+
if (isIdentifier(rootExpr) && lookupSymbolForName(container, rootExpr.escapedText)?.flags! & SymbolFlags.Alias) {
30483048
return;
30493049
}
30503050
// Fix up parent pointers since we're going to use these nodes before we bind into them

‎src/compiler/checker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9219,7 +9219,7 @@ namespace ts {
92199219
if (container && (container.kind === SyntaxKind.Constructor || isJSConstructor(container))) {
92209220
return container as ConstructorDeclaration;
92219221
}
9222-
};
9222+
}
92239223
}
92249224

92259225
/** Create a synthetic property access flow node after the last statement of the file */
@@ -29892,7 +29892,7 @@ namespace ts {
2989229892
return !!s && getMinArgumentCount(s) >= 1 && isTypeAssignableTo(keyedType, getTypeAtPosition(s, 0));
2989329893
}
2989429894
return false;
29895-
};
29895+
}
2989629896

2989729897
const suggestedMethod = isAssignmentTarget(expr) ? "set" : "get";
2989829898
if (!hasProp(suggestedMethod)) {

‎src/compiler/commandLineParser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3709,7 +3709,7 @@ namespace ts {
37093709
export function convertCompilerOptionsForTelemetry(opts: CompilerOptions): CompilerOptions {
37103710
const out: CompilerOptions = {};
37113711
for (const key in opts) {
3712-
if (opts.hasOwnProperty(key)) {
3712+
if (hasProperty(opts, key)) {
37133713
const type = getOptionFromName(key);
37143714
if (type !== undefined) { // Ignore unknown options
37153715
out[key] = getOptionValueWithEmptyStrings(opts[key], type);

‎src/compiler/debug.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ namespace ts {
279279
if (typeof func !== "function") {
280280
return "";
281281
}
282-
else if (func.hasOwnProperty("name")) {
282+
else if (hasProperty(func, "name")) {
283283
return (func as any).name;
284284
}
285285
else {
@@ -625,7 +625,7 @@ namespace ts {
625625
];
626626

627627
for (const ctor of nodeConstructors) {
628-
if (!ctor.prototype.hasOwnProperty("__debugKind")) {
628+
if (!hasProperty(ctor, "__debugKind")) {
629629
Object.defineProperties(ctor.prototype, {
630630
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
631631
__tsDebuggerDisplay: {

‎src/compiler/factory/nodeFactory.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5639,7 +5639,7 @@ namespace ts {
56395639
setOriginalNode(clone, node);
56405640

56415641
for (const key in node) {
5642-
if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) {
5642+
if (hasProperty(clone, key) || !hasProperty(node, key)) {
56435643
continue;
56445644
}
56455645

‎src/compiler/parser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ namespace ts {
744744
return visitNodes(cbNode, cbNodes, node.typeParameters) ||
745745
visitNodes(cbNode, cbNodes, node.parameters) ||
746746
visitNode(cbNode, node.type);
747-
};
747+
}
748748

749749
function forEachChildInUnionOrIntersectionType<T>(node: UnionTypeNode | IntersectionTypeNode, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
750750
return visitNodes(cbNode, cbNodes, node.types);

‎src/compiler/program.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ namespace ts {
503503
/* @internal */ imports: SourceFile["imports"];
504504
/* @internal */ moduleAugmentations: SourceFile["moduleAugmentations"];
505505
impliedNodeFormat?: SourceFile["impliedNodeFormat"];
506-
};
506+
}
507507

508508
/**
509509
* Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly

‎src/compiler/scanner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ namespace ts {
361361

362362
/* @internal */
363363
export function computeLineStarts(text: string): number[] {
364-
const result: number[] = new Array();
364+
const result: number[] = [];
365365
let pos = 0;
366366
let lineStart = 0;
367367
while (pos < text.length) {

‎src/compiler/tracing.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace ts { // eslint-disable-line local/one-namespace-per-file
2525
// The actual constraint is that JSON.stringify be able to serialize it without throwing.
2626
interface Args {
2727
[key: string]: string | number | boolean | null | undefined | Args | readonly (string | number | boolean | null | undefined | Args)[];
28-
};
28+
}
2929

3030
/** Starts tracing for the given project. */
3131
export function startTracing(tracingMode: Mode, traceDir: string, configFilePath?: string) {

‎src/compiler/transformers/declarations.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ namespace ts {
218218
}
219219

220220
function reportNonlocalAugmentation(containingFile: SourceFile, parentSymbol: Symbol, symbol: Symbol) {
221-
const primaryDeclaration = parentSymbol.declarations?.find(d => getSourceFileOfNode(d) === containingFile)!;
221+
const primaryDeclaration = parentSymbol.declarations?.find(d => getSourceFileOfNode(d) === containingFile);
222222
const augmentingDeclarations = filter(symbol.declarations, d => getSourceFileOfNode(d) !== containingFile);
223-
if (augmentingDeclarations) {
223+
if (primaryDeclaration && augmentingDeclarations) {
224224
for (const augmentations of augmentingDeclarations) {
225225
context.addDiagnostic(addRelatedInfo(
226226
createDiagnosticForNode(augmentations, Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized),

‎src/compiler/tsbuildPublic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ namespace ts {
487487
// TODO(rbuckton): Should be a `Set`, but that requires changing the code below that uses `mutateMapSkippingNewValues`
488488
const currentProjects = new Map(
489489
getBuildOrderFromAnyBuildOrder(buildOrder).map(
490-
resolved => [toResolvedConfigFilePath(state, resolved), true as true])
490+
resolved => [toResolvedConfigFilePath(state, resolved), true as const])
491491
);
492492

493493
const noopOnDelete = { onDeleteValue: noop };

‎src/compiler/utilities.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ namespace ts {
563563

564564
interface ScriptTargetFeatures {
565565
[key: string]: { [key: string]: string[] | undefined };
566-
};
566+
}
567567

568568
export function getScriptTargetFeatures(): ScriptTargetFeatures {
569569
return {
@@ -5558,7 +5558,7 @@ namespace ts {
55585558

55595559
export function isWatchSet(options: CompilerOptions) {
55605560
// Firefox has Object.prototype.watch
5561-
return options.watch && options.hasOwnProperty("watch");
5561+
return options.watch && hasProperty(options, "watch");
55625562
}
55635563

55645564
export function closeFileWatcher(watcher: FileWatcher) {

‎src/compiler/utilitiesPublic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ namespace ts {
11211121

11221122
/* @internal */
11231123
export function isNodeArray<T extends Node>(array: readonly T[]): array is NodeArray<T> {
1124-
return array.hasOwnProperty("pos") && array.hasOwnProperty("end");
1124+
return hasProperty(array, "pos") && hasProperty(array, "end");
11251125
}
11261126

11271127
// Literals

‎src/executeCommandLine/executeCommandLine.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ namespace ts {
431431
function getHeader(sys: System, message: string) {
432432
const colors = createColors(sys);
433433
const header: string[] = [];
434-
const terminalWidth = sys.getWidthOfTerminal?.() ?? 0;;
434+
const terminalWidth = sys.getWidthOfTerminal?.() ?? 0;
435435
const tsIconLength = 5;
436436

437437
const tsIconFirstLine = colors.blueBackground(padLeft("", tsIconLength));

‎src/harness/fourslashImpl.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2737,7 +2737,7 @@ namespace FourSlash {
27372737
const identifier = this.classificationToIdentifier(a.classificationType as number);
27382738
const text = this.activeFile.content.slice(a.textSpan.start, a.textSpan.start + a.textSpan.length);
27392739
replacement.push(` c2.semanticToken("${identifier}", "${text}"), `);
2740-
};
2740+
}
27412741
replacement.push(");");
27422742

27432743
throw new Error("You need to change the source code of fourslash test to use replaceWithSemanticClassifications");

‎src/harness/fourslashInterfaceImpl.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1900,11 +1900,11 @@ namespace FourSlashInterface {
19001900
};
19011901
export interface DiagnosticIgnoredInterpolations {
19021902
template: string
1903-
};
1903+
}
19041904
export type RenameLocationOptions = FourSlash.Range | { readonly range: FourSlash.Range, readonly prefixText?: string, readonly suffixText?: string };
19051905
export interface RenameOptions {
19061906
readonly findInStrings?: boolean;
19071907
readonly findInComments?: boolean;
19081908
readonly providePrefixAndSuffixTextForRename?: boolean;
1909-
};
1909+
}
19101910
}

‎src/harness/harnessIO.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ namespace Harness {
335335

336336
export function setCompilerOptionsFromHarnessSetting(settings: TestCaseParser.CompilerSettings, options: ts.CompilerOptions & HarnessOptions): void {
337337
for (const name in settings) {
338-
if (settings.hasOwnProperty(name)) {
338+
if (ts.hasProperty(settings, name)) {
339339
const value = settings[name];
340340
if (value === undefined) {
341341
throw new Error(`Cannot have undefined value for compiler option '${name}'.`);
@@ -1496,7 +1496,7 @@ namespace Harness {
14961496

14971497
export function getConfigNameFromFileName(filename: string): "tsconfig.json" | "jsconfig.json" | undefined {
14981498
const flc = ts.getBaseFileName(filename).toLowerCase();
1499-
return ts.find(["tsconfig.json" as "tsconfig.json", "jsconfig.json" as "jsconfig.json"], x => x === flc);
1499+
return ts.find(["tsconfig.json" as const, "jsconfig.json" as const], x => x === flc);
15001500
}
15011501

15021502
if (Error) (Error as any).stackTraceLimit = 100;

‎src/harness/harnessUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ namespace Utils {
314314

315315
function findChildName(parent: any, child: any) {
316316
for (const name in parent) {
317-
if (parent.hasOwnProperty(name) && parent[name] === child) {
317+
if (ts.hasProperty(parent, name) && parent[name] === child) {
318318
return name;
319319
}
320320
}

‎src/harness/vfsUtil.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,6 @@ namespace vfs {
916916
if (this._shadowRoot) {
917917
this._copyShadowLinks(this._shadowRoot._getRootLinks(), this._lazy.links);
918918
}
919-
this._lazy.links = this._lazy.links;
920919
}
921920
return this._lazy.links;
922921
}
@@ -1578,7 +1577,7 @@ namespace vfs {
15781577
const entry = normalizeFileSetEntry(container[name]);
15791578
const file = dirname ? vpath.combine(dirname, name) : name;
15801579
// eslint-disable-next-line no-null/no-null
1581-
if (entry === null || entry === undefined || entry instanceof Unlink || entry instanceof Rmdir) {
1580+
if (entry === null || entry === undefined || entry instanceof Unlink) {
15821581
text += `//// [${file}] unlink\r\n`;
15831582
}
15841583
else if (entry instanceof Rmdir) {

‎src/loggedIO/loggedIO.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ namespace Playback { // eslint-disable-line local/one-namespace-per-file
9494
function memoize<T>(func: (s: string) => T): Memoized<T> {
9595
let lookup: { [s: string]: T } = {};
9696
const run: Memoized<T> = ((s: string) => {
97-
if (lookup.hasOwnProperty(s)) return lookup[s];
97+
if (ts.hasProperty(lookup, s)) return lookup[s];
9898
return lookup[s] = func(s);
9999
}) as Memoized<T>;
100100
run.reset = () => {

‎src/server/editorServices.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ namespace ts.server {
940940
// raw is now fixed and ready
941941
this.safelist = raw.typesMap;
942942
for (const key in raw.simpleMap) {
943-
if (raw.simpleMap.hasOwnProperty(key)) {
943+
if (hasProperty(raw.simpleMap, key)) {
944944
this.legacySafelist.set(key, raw.simpleMap[key].toLowerCase());
945945
}
946946
}

‎src/server/session.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ namespace ts.server {
297297
interface ProjectNavigateToItems {
298298
project: Project;
299299
navigateToItems: readonly NavigateToItem[];
300-
};
300+
}
301301

302302
function createDocumentSpanSet(): Set<DocumentSpan> {
303303
return createSet(({textSpan}) => textSpan.start + 100003 * textSpan.length, documentSpansEqual);

‎src/services/completions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ namespace ts.Completions {
11071107

11081108
return { isSnippet, insertText, labelDetails };
11091109

1110-
};
1110+
}
11111111

11121112
function createObjectLiteralMethod(
11131113
symbol: Symbol,
@@ -4335,7 +4335,7 @@ namespace ts.Completions {
43354335

43364336
function isArrowFunctionBody(node: Node) {
43374337
return node.parent && isArrowFunction(node.parent) && node.parent.body === node;
4338-
};
4338+
}
43394339

43404340
/** True if symbol is a type or a module containing at least one type. */
43414341
function symbolCanBeReferencedAtTypeLocation(symbol: Symbol, checker: TypeChecker, seenModules = new Map<SymbolId, true>()): boolean {

‎src/services/formatting/rules.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -411,23 +411,23 @@ namespace ts.formatting {
411411
}
412412

413413
function isOptionEnabled(optionName: keyof FormatCodeSettings): (context: FormattingContext) => boolean {
414-
return (context) => context.options && context.options.hasOwnProperty(optionName) && !!context.options[optionName];
414+
return (context) => context.options && hasProperty(context.options, optionName) && !!context.options[optionName];
415415
}
416416

417417
function isOptionDisabled(optionName: keyof FormatCodeSettings): (context: FormattingContext) => boolean {
418-
return (context) => context.options && context.options.hasOwnProperty(optionName) && !context.options[optionName];
418+
return (context) => context.options && hasProperty(context.options, optionName) && !context.options[optionName];
419419
}
420420

421421
function isOptionDisabledOrUndefined(optionName: keyof FormatCodeSettings): (context: FormattingContext) => boolean {
422-
return (context) => !context.options || !context.options.hasOwnProperty(optionName) || !context.options[optionName];
422+
return (context) => !context.options || !hasProperty(context.options, optionName) || !context.options[optionName];
423423
}
424424

425425
function isOptionDisabledOrUndefinedOrTokensOnSameLine(optionName: keyof FormatCodeSettings): (context: FormattingContext) => boolean {
426-
return (context) => !context.options || !context.options.hasOwnProperty(optionName) || !context.options[optionName] || context.TokensAreOnSameLine();
426+
return (context) => !context.options || !hasProperty(context.options, optionName) || !context.options[optionName] || context.TokensAreOnSameLine();
427427
}
428428

429429
function isOptionEnabledOrUndefined(optionName: keyof FormatCodeSettings): (context: FormattingContext) => boolean {
430-
return (context) => !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName];
430+
return (context) => !context.options || !hasProperty(context.options, optionName) || !!context.options[optionName];
431431
}
432432

433433
function isForContext(context: FormattingContext): boolean {

‎src/services/refactors/convertExport.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace ts.refactor {
5454
readonly exportName: Identifier; // This is exportNode.name except for VariableStatement_s.
5555
readonly wasDefault: boolean;
5656
readonly exportingModuleSymbol: Symbol;
57-
};
57+
}
5858

5959
function getInfo(context: RefactorContext, considerPartialSpans = true): ExportInfo | RefactorErrorInfo | undefined {
6060
const { file, program } = context;

‎src/services/refactors/convertToOptionalChainExpression.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace ts.refactor.convertToOptionalChainExpression {
5151
finalExpression: PropertyAccessExpression | ElementAccessExpression | CallExpression,
5252
occurrences: Occurrence[],
5353
expression: ValidExpression,
54-
};
54+
}
5555

5656
type ValidExpressionOrStatement = ValidExpression | ValidStatement;
5757

@@ -119,7 +119,7 @@ namespace ts.refactor.convertToOptionalChainExpression {
119119
function getBinaryInfo(expression: BinaryExpression): OptionalChainInfo | RefactorErrorInfo | undefined {
120120
if (expression.operatorToken.kind !== SyntaxKind.AmpersandAmpersandToken) {
121121
return { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_logical_AND_access_chains) };
122-
};
122+
}
123123
const finalExpression = getFinalExpressionInChain(expression.right);
124124

125125
if (!finalExpression) return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) };

‎src/services/refactors/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace ts.refactor {
55
*/
66
export interface RefactorErrorInfo {
77
error: string;
8-
};
8+
}
99

1010
/**
1111
* Checks if some refactor info has refactor error info.

‎src/services/refactors/moveToNewFile.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace ts.refactor {
9797
// Filters imports and prologue directives out of the range of statements to move.
9898
// Imports will be copied to the new file anyway, and may still be needed in the old file.
9999
// Prologue directives will be copied to the new file and should be left in the old file.
100-
return !isPureImport(statement) && !isPrologueDirective(statement);;
100+
return !isPureImport(statement) && !isPrologueDirective(statement);
101101
}
102102

103103
function isPureImport(node: Node): boolean {

‎src/services/stringCompletions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ namespace ts.Completions.StringCompletions {
935935
const dependencies: object | undefined = (contents as any)[key];
936936
if (!dependencies) continue;
937937
for (const dep in dependencies) {
938-
if (dependencies.hasOwnProperty(dep) && !startsWith(dep, "@types/")) {
938+
if (hasProperty(dependencies, dep) && !startsWith(dep, "@types/")) {
939939
result.push(dep);
940940
}
941941
}

‎src/testRunner/unittests/tsbuild/outputPaths.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace ts {
1919

2020
it("verify getOutputFileNames", () => {
2121
const sys = new fakes.System(input.fs().makeReadonly(), { executingFilePath: "/lib/tsc" }) as TscCompileSystem;
22-
;
22+
2323
assert.deepEqual(
2424
getOutputFileNames(
2525
parseConfigFileWithSystem("/src/tsconfig.json", {}, /*extendedConfigCache*/ undefined, {}, sys, noop)!,

‎src/testRunner/unittests/tsserver/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ namespace ts.projectSystem {
836836
checkAllErrors(request);
837837
}
838838

839-
interface SkipErrors { semantic?: true; suggestion?: true };
839+
interface SkipErrors { semantic?: true; suggestion?: true }
840840
export interface CheckAllErrors extends VerifyGetErrRequestBase {
841841
files: readonly any[];
842842
skip?: readonly (SkipErrors | undefined)[];

‎src/testRunner/unittests/tsserver/projects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ namespace ts.projectSystem {
567567
path: "/a/b/file1.js",
568568
content: "var x = 10;",
569569
fileName: "/a/b/file1.js",
570-
scriptKind: "JS" as "JS"
570+
scriptKind: "JS" as const
571571
};
572572

573573
const host = createServerHost([]);

0 commit comments

Comments
 (0)
Please sign in to comment.