From 9e199b7dffe9905040829325ee2354a6f6ede283 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Fri, 24 May 2024 21:49:25 +0200 Subject: [PATCH] config: format json hbs as json (#540) --- tooling/prettier/index.mjs | 8 ++++ turbo/generators/templates/package.json.hbs | 44 ++++++++++++++++---- turbo/generators/templates/tsconfig.json.hbs | 16 +++++-- 3 files changed, 56 insertions(+), 12 deletions(-) diff --git a/tooling/prettier/index.mjs b/tooling/prettier/index.mjs index bbda4c6b8..06a15ac4c 100644 --- a/tooling/prettier/index.mjs +++ b/tooling/prettier/index.mjs @@ -18,6 +18,14 @@ const config = { importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"], printWidth: 120, importOrderTypeScriptVersion: "4.4.0", + overrides: [ + { + files: "*.json.hbs", + options: { + parser: "json", + }, + }, + ], }; export default config; diff --git a/turbo/generators/templates/package.json.hbs b/turbo/generators/templates/package.json.hbs index 6aebece9c..fd1754a76 100644 --- a/turbo/generators/templates/package.json.hbs +++ b/turbo/generators/templates/package.json.hbs @@ -1,9 +1,35 @@ -{ "name": "@homarr/{{name}}", "private": true, "version": "0.1.0", "exports": { -".": "./index.ts" }, "typesVersions": { "*": { "*": [ "src/*" ] } }, "license": -"MIT", "scripts": { "clean": "rm -rf .turbo node_modules", "lint": "eslint .", -"format": "prettier --check . --ignore-path ../../.gitignore", "typecheck": "tsc ---noEmit" }, "devDependencies": { "@homarr/eslint-config": "workspace:^0.2.0", -"@homarr/prettier-config": "workspace:^0.1.0", "@homarr/tsconfig": -"workspace:^0.1.0", "eslint": "^8.57.0", "typescript": "^5.4.5" }, -"eslintConfig": { "extends": [ "@homarr/eslint-config/base" ] }, "prettier": -"@homarr/prettier-config" } \ No newline at end of file +{ + "name": "@homarr/{{name}}", + "private": true, + "version": "0.1.0", + "exports": { + ".": "./index.ts" + }, + "typesVersions": { + "*": { + "*": [ + "src/*" + ] + } + }, + "license": "MIT", + "scripts": { + "clean": "rm -rf .turbo node_modules", + "lint": "eslint .", + "format": "prettier --check . --ignore-path ../../.gitignore", + "typecheck": "tsc --noEmit" + }, + "devDependencies": { + "@homarr/eslint-config": "workspace:^0.2.0", + "@homarr/prettier-config": "workspace:^0.1.0", + "@homarr/tsconfig": "workspace:^0.1.0", + "eslint": "^8.57.0", + "typescript": "^5.4.5" + }, + "eslintConfig": { + "extends": [ + "@homarr/eslint-config/base" + ] + }, + "prettier": "@homarr/prettier-config" +} \ No newline at end of file diff --git a/turbo/generators/templates/tsconfig.json.hbs b/turbo/generators/templates/tsconfig.json.hbs index 2592044fa..50200e007 100644 --- a/turbo/generators/templates/tsconfig.json.hbs +++ b/turbo/generators/templates/tsconfig.json.hbs @@ -1,3 +1,13 @@ -{ "extends": "@homarr/tsconfig/base.json", "compilerOptions": { -"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, "include": ["*.ts", -"src"], "exclude": ["node_modules"] } \ No newline at end of file +{ + "extends": "@homarr/tsconfig/base.json", + "compilerOptions": { + "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" + }, + "include": [ + "*.ts", + "src" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file