From ea04ed7d30e267d23f32897aa399a4e6c630e12e Mon Sep 17 00:00:00 2001 From: Florian Wendelborn <1133858+FlorianWendelborn@users.noreply.github.com> Date: Sat, 20 Apr 2024 17:37:40 +0200 Subject: [PATCH] chore(turbo): Fix Knip, Simplify turbo.json, Associate turbo.json with JSONC --- .vscode/settings.json | 5 ++++- internals/eslint-config/source/index.ts | 4 ++-- internals/eslint-config/turbo.json | 1 - internals/fake-root/turbo.json | 25 +++++++++++++------------ knip.json | 1 + packages/schemas/turbo.json | 1 - turbo.json | 3 ++- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3fef70a..7ef87ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,8 @@ "jsonc", "typescript", "typescriptreact" - ] + ], + "files.associations": { + "turbo.json": "jsonc" + } } diff --git a/internals/eslint-config/source/index.ts b/internals/eslint-config/source/index.ts index 5a74c13..69f2cb5 100644 --- a/internals/eslint-config/source/index.ts +++ b/internals/eslint-config/source/index.ts @@ -38,7 +38,7 @@ export default { json: tseslint.config( { files: ['**/*.json'], - ignores: ['**/tsconfig*.json'], + ignores: ['**/tsconfig*.json', '**/turbo.json'], languageOptions: { parser: jsoncEslintParser, }, @@ -62,7 +62,7 @@ export default { }, }, { - files: ['**/tsconfig*.json'], + files: ['**/tsconfig*.json', '**/turbo.json'], languageOptions: { parser: jsoncEslintParser, }, diff --git a/internals/eslint-config/turbo.json b/internals/eslint-config/turbo.json index 881bce0..ea37ffb 100644 --- a/internals/eslint-config/turbo.json +++ b/internals/eslint-config/turbo.json @@ -4,7 +4,6 @@ "pipeline": { "build": { "inputs": ["./scripts/**", "./source/**", "tsconfig.*"], - "outputMode": "new-only", "outputs": ["./dist/**"] } } diff --git a/internals/fake-root/turbo.json b/internals/fake-root/turbo.json index 7bbc944..089407a 100644 --- a/internals/fake-root/turbo.json +++ b/internals/fake-root/turbo.json @@ -5,26 +5,27 @@ "check:eslint": { "inputs": [ "../../*.{cjs,js,mjs,json,mjs,mts,ts}", + "../../.vscode/**/*", "../../eslint.config.mjs" ] }, + "check:knip": { + "inputs": [ + "../../internals/*/scripts/**/*", + "../../internals/*/source/**/*", + "../../knip.json", + "../../packages/*/scripts/**/*", + "../../packages/*/source/**/*" + ] + }, "check:prettier": { - "inputs": ["../../*.{cjs,js,mjs,json,mjs,mts,ts}"], - "outputMode": "new-only" + "inputs": ["../../*.{cjs,js,mjs,json,mjs,mts,ts}", "../../.vscode/**/*"] }, - "download": {}, "fix:eslint": { - "inputs": ["../../*.{cjs,js,mjs,json,mjs,mts,ts}"], - "outputMode": "new-only" + "inputs": ["../../*.{cjs,js,mjs,json,mjs,mts,ts}", "../../.vscode/**/*"] }, "fix:prettier": { - "inputs": ["../../*.{cjs,js,mjs,json,mjs,mts,ts}"], - "outputMode": "new-only" - }, - "watch": { - "cache": false, - "dependsOn": ["^build", "download"], - "persistent": true + "inputs": ["../../*.{cjs,js,mjs,json,mjs,mts,ts}", "../../.vscode/**/*"] } } } diff --git a/knip.json b/knip.json index beef2c7..a76b8f0 100644 --- a/knip.json +++ b/knip.json @@ -2,6 +2,7 @@ "$schema": "https://unpkg.com/knip@5/schema.json", "ignore": ["dist/**"], "ignoreBinaries": ["prettier", "publint"], + "ignoreDependencies": ["@arethetypeswrong/cli"], "workspaces": { "internals/*": { "entry": ["scripts/*.ts", "source/index.ts"], diff --git a/packages/schemas/turbo.json b/packages/schemas/turbo.json index 6b706fd..8481fe4 100644 --- a/packages/schemas/turbo.json +++ b/packages/schemas/turbo.json @@ -4,7 +4,6 @@ "pipeline": { "build": { "inputs": ["./source/**", "tsconfig.json"], - "outputMode": "new-only", "outputs": ["./dist/**"] }, "download": { diff --git a/turbo.json b/turbo.json index 02ba364..9eea9e1 100644 --- a/turbo.json +++ b/turbo.json @@ -3,7 +3,8 @@ "globalDependencies": ["bun.lockb"], "pipeline": { "build": { - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "outputMode": "new-only" }, "check": { "dependsOn": [