mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 11:49:38 +00:00
Merge pull request #261560 from microsoft/copilot/fix-260168
Enable strict by default in implicit js/ts projects
This commit is contained in:
@@ -64,6 +64,7 @@ export class ImplicitProjectConfiguration {
|
||||
public readonly experimentalDecorators: boolean;
|
||||
public readonly strictNullChecks: boolean;
|
||||
public readonly strictFunctionTypes: boolean;
|
||||
public readonly strict: boolean;
|
||||
|
||||
constructor(configuration: vscode.WorkspaceConfiguration) {
|
||||
this.target = ImplicitProjectConfiguration.readTarget(configuration);
|
||||
@@ -72,6 +73,7 @@ export class ImplicitProjectConfiguration {
|
||||
this.experimentalDecorators = ImplicitProjectConfiguration.readExperimentalDecorators(configuration);
|
||||
this.strictNullChecks = ImplicitProjectConfiguration.readImplicitStrictNullChecks(configuration);
|
||||
this.strictFunctionTypes = ImplicitProjectConfiguration.readImplicitStrictFunctionTypes(configuration);
|
||||
this.strict = ImplicitProjectConfiguration.readImplicitStrict(configuration);
|
||||
}
|
||||
|
||||
public isEqualTo(other: ImplicitProjectConfiguration): boolean {
|
||||
@@ -101,6 +103,10 @@ export class ImplicitProjectConfiguration {
|
||||
private static readImplicitStrictFunctionTypes(configuration: vscode.WorkspaceConfiguration): boolean {
|
||||
return configuration.get<boolean>('js/ts.implicitProjectConfig.strictFunctionTypes', true);
|
||||
}
|
||||
|
||||
private static readImplicitStrict(configuration: vscode.WorkspaceConfiguration): boolean {
|
||||
return configuration.get<boolean>('js/ts.implicitProjectConfig.strict', true);
|
||||
}
|
||||
}
|
||||
|
||||
export interface TypeScriptServiceConfiguration {
|
||||
|
||||
@@ -55,6 +55,10 @@ export function inferredProjectCompilerOptions(
|
||||
projectConfig.strictFunctionTypes = true;
|
||||
}
|
||||
|
||||
if (serviceConfig.implicitProjectConfiguration.strict) {
|
||||
projectConfig.strict = true;
|
||||
}
|
||||
|
||||
if (serviceConfig.implicitProjectConfiguration.module) {
|
||||
projectConfig.module = serviceConfig.implicitProjectConfiguration.module as Proto.ModuleKind;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user