mirror of
https://github.com/cursorless-dev/cursorless.git
synced 2024-10-03 20:37:50 +03:00
Use new $configDir
setting in tsconfig (#2532)
This shipped in Typescript 5.5; see https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#the-configdir-template-variable-for-configuration-files ## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet
This commit is contained in:
parent
e1f1b276fa
commit
99969acf18
@ -1,8 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "out",
|
||||
"jsx": "react-jsx",
|
||||
"lib": ["es5", "es6", "dom"],
|
||||
"allowSyntheticDefaultImports": true,
|
||||
|
@ -1,8 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "out",
|
||||
"jsx": "react-jsx",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
|
@ -1,9 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "out",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"],
|
||||
"references": []
|
||||
}
|
||||
|
@ -1,9 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "out",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"],
|
||||
"references": [
|
||||
{
|
||||
|
@ -1,9 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"target": "es2020",
|
||||
"outDir": "out",
|
||||
"rootDir": "src"
|
||||
"target": "es2020"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"],
|
||||
"references": [
|
||||
|
@ -1,10 +1,8 @@
|
||||
{
|
||||
"extends": ["@tsconfig/docusaurus/tsconfig.json", "../../tsconfig.base.json"],
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"esModuleInterop": true,
|
||||
"emitDeclarationOnly": false,
|
||||
"outDir": "out"
|
||||
"emitDeclarationOnly": false
|
||||
},
|
||||
"references": [],
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"]
|
||||
|
@ -11,9 +11,7 @@
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"rootDir": "src",
|
||||
"outDir": "out"
|
||||
"incremental": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
|
@ -1,9 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "out",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../common"
|
||||
|
@ -1,9 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"target": "es2020",
|
||||
"outDir": "out",
|
||||
"rootDir": "src"
|
||||
"target": "es2020"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"],
|
||||
"references": [
|
||||
|
@ -5,7 +5,7 @@ import { pathExists } from "path-exists";
|
||||
import { PackageJson, TsConfigJson } from "type-fest";
|
||||
import { toPosixPath } from "./toPosixPath";
|
||||
import { Context } from "./Context";
|
||||
import { uniq } from "lodash-es";
|
||||
import { cloneDeep, isEqual, uniq } from "lodash-es";
|
||||
import { readFile } from "fs/promises";
|
||||
|
||||
/**
|
||||
@ -89,14 +89,18 @@ export async function updateTSConfig(
|
||||
references.push({ path: relativePath });
|
||||
}
|
||||
|
||||
const compilerOptions = {
|
||||
...(cloneDeep(input.compilerOptions) ?? {}),
|
||||
};
|
||||
delete compilerOptions.outDir;
|
||||
delete compilerOptions.rootDir;
|
||||
|
||||
return {
|
||||
...input,
|
||||
extends: getExtends(pathFromPackageToRoot, input.extends),
|
||||
compilerOptions: {
|
||||
...(input.compilerOptions ?? {}),
|
||||
rootDir: "src",
|
||||
outDir: "out",
|
||||
},
|
||||
|
||||
...(isEqual(compilerOptions, {}) ? {} : { compilerOptions }),
|
||||
|
||||
references: references.sort((r1, r2) => r1.path.localeCompare(r2.path)),
|
||||
include: [
|
||||
"src/**/*.ts",
|
||||
|
@ -1,8 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "out",
|
||||
"rootDir": "src",
|
||||
"target": "es2020",
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "node",
|
||||
|
@ -1,9 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "out"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"],
|
||||
"references": [
|
||||
{
|
||||
|
@ -1,9 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "out"
|
||||
},
|
||||
"references": [],
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"]
|
||||
}
|
||||
|
@ -1,9 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "out"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"],
|
||||
"references": [
|
||||
{
|
||||
|
@ -1,9 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "out",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"],
|
||||
"references": [
|
||||
{
|
||||
|
@ -1,9 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"target": "es2020",
|
||||
"outDir": "out",
|
||||
"rootDir": "src"
|
||||
"target": "es2020"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"],
|
||||
"references": [
|
||||
|
@ -11,6 +11,8 @@
|
||||
"composite": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"strict": true
|
||||
"strict": true,
|
||||
"rootDir": "${configDir}/src",
|
||||
"outDir": "${configDir}/out"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user