Skip to content

Commit

Permalink
fix(cli): fixed monorepo prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
kedrzu committed Apr 2, 2024
1 parent 9514cd5 commit db56638
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 36 deletions.
6 changes: 2 additions & 4 deletions packages/cli/src/commands/monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface TsConfig {
}

const tsConfigsCache: Record<string, TsConfig | undefined> = {};
let prettierConfig: prettier.Options | null = null;
const prettierConfig: prettier.Options | null = null;

async function run() {
const cwd = process.cwd();
Expand Down Expand Up @@ -196,9 +196,7 @@ async function loadTsConfigCore(filePath: string) {
}

async function saveTsConfig(tsconfig: TsConfig) {
if (!prettierConfig) {
prettierConfig = (await prettier.resolveConfig(process.cwd())) || {};
}
const prettierConfig = await prettier.resolveConfig(tsconfig.path);

let configJson = json.stringify(tsconfig.config, undefined, 2);
configJson = await prettier.format(configJson, {
Expand Down
32 changes: 16 additions & 16 deletions packages/i18n/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*.ts", "src/**/*.json"],
"references": [
{
"path": "../ioc/tsconfig.json"
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
{
"path": "../types/tsconfig.json"
},
{
"path": "../utils/tsconfig.json"
}
]
"include": ["src/**/*.ts", "src/**/*.json"],
"references": [
{
"path": "../ioc/tsconfig.json"
},
{
"path": "../types/tsconfig.json"
},
{
"path": "../utils/tsconfig.json"
}
]
}
32 changes: 16 additions & 16 deletions packages/validation/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*.ts", "src/**/*.json"],
"references": [
{
"path": "../i18n/tsconfig.json"
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
{
"path": "../types/tsconfig.json"
},
{
"path": "../utils/tsconfig.json"
}
]
"include": ["src/**/*.ts", "src/**/*.json"],
"references": [
{
"path": "../i18n/tsconfig.json"
},
{
"path": "../types/tsconfig.json"
},
{
"path": "../utils/tsconfig.json"
}
]
}

0 comments on commit db56638

Please sign in to comment.