mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[vscode] Set typescript.enablePromptUseWorkspaceTsdk (#113476)
To prompt users to use the workspace configured version of Typescript. Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
parent
de8bb8f7d8
commit
14e65bf05d
2 changed files with 8 additions and 4 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
export interface ManagedConfigKey {
|
||||
key: string;
|
||||
value: string | Record<string, any>;
|
||||
value: string | Record<string, any> | boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,4 +42,8 @@ export const MANAGED_CONFIG_KEYS: ManagedConfigKey[] = [
|
|||
// we use a relative path here so that it works with remote vscode connections
|
||||
value: './node_modules/typescript/lib',
|
||||
},
|
||||
{
|
||||
key: 'typescript.enablePromptUseWorkspaceTsdk',
|
||||
value: true,
|
||||
},
|
||||
];
|
||||
|
|
|
@ -69,10 +69,10 @@ const createObjectPropOfManagedValues = (key: string, value: Record<string, any>
|
|||
const addManagedProp = (
|
||||
ast: t.ObjectExpression,
|
||||
key: string,
|
||||
value: string | Record<string, any>
|
||||
value: string | Record<string, any> | boolean
|
||||
) => {
|
||||
ast.properties.push(
|
||||
typeof value === 'string'
|
||||
typeof value === 'string' || typeof value === 'boolean'
|
||||
? createManagedProp(key, value)
|
||||
: createObjectPropOfManagedValues(key, value)
|
||||
);
|
||||
|
@ -89,7 +89,7 @@ const addManagedProp = (
|
|||
const replaceManagedProp = (
|
||||
ast: t.ObjectExpression,
|
||||
existing: BasicObjectProp,
|
||||
value: string | Record<string, any>
|
||||
value: string | Record<string, any> | boolean
|
||||
) => {
|
||||
remove(ast.properties, existing);
|
||||
addManagedProp(ast, existing.key.value, value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue