Skip to content

Commit

Permalink
Consolidate tsconfig.json file (#1279)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Apr 26, 2024
1 parent 7bd17bb commit c9d3a39
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 31 deletions.
15 changes: 7 additions & 8 deletions packages/ansible-language-server/src/utils/yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,14 @@ export function getYamlMapKeys(mapNode: YAMLMap): Array<string> {
export function getOrigRange(
node: Node | null | undefined,
): [number, number] | undefined {
if (node?.range) {
const range = node.range;
if (range[0] === undefined || range[1] === undefined) {
return undefined;
}
return [range[0], range[1]];
} else {
return undefined;
if (
node?.range &&
node.range[0] !== undefined &&
node.range[1] !== undefined
) {
return [node.range[0], node.range[1]];
}
return undefined;
}

/** Parsing with the YAML library tailored to the needs of this extension */
Expand Down
13 changes: 2 additions & 11 deletions packages/ansible-language-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"strict": true,
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2022"],
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./out/server",
"skipLibCheck": true,
"sourceMap": true,
"target": "ES2022"
"outDir": "./out/server"
},
"exclude": ["node_modules", "out", "vscode-ansible"]
}
14 changes: 14 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"composite": true,
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"moduleResolution": "node",
"skipLibCheck": true,
"sourceMap": false,
"strict": true,
"target": "ES2022"
}
}
15 changes: 3 additions & 12 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"composite": true,
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2020", "DOM"],
"module": "commonjs",
"moduleResolution": "node",
"outDir": "out/client",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES2020"
"lib": ["ES2022", "DOM"],
"outDir": "out/client"
},
"include": ["src", "test", "*.js", "*.ts"],
"exclude": ["node_modules", "test-resources"]
Expand Down

0 comments on commit c9d3a39

Please sign in to comment.