From f94aafc7e830521ea09677cf418da7dfda4ea32e Mon Sep 17 00:00:00 2001 From: Vladimir Drayling Date: Wed, 5 Aug 2026 14:05:48 +0200 Subject: [PATCH] feat(desktop): add lint and typecheck coverage - add eslint lint target to apps/desktop/project.json - scope tailwindcss rules to apps/app: desktop has no styles.css - add typecheck target running tsc on apps/desktop/tsconfig.json - relax 2 flags for desktop only, blocked on electrobun#516 - wire typecheck into CI --- .github/workflows/ci.yml | 2 +- apps/desktop/project.json | 9 +++++++++ apps/desktop/tsconfig.json | 9 ++++++++- eslint.config.ts | 39 ++++++++++++++++---------------------- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d25a8df..5919f04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,5 +15,5 @@ jobs: with: bun-version: latest - run: bun i --frozen-lockfile - - run: bunx nx run-many -t lint test + - run: bunx nx run-many -t lint test typecheck - run: bunx nx build desktop --configuration=dev diff --git a/apps/desktop/project.json b/apps/desktop/project.json index 1866518..6725f97 100644 --- a/apps/desktop/project.json +++ b/apps/desktop/project.json @@ -15,6 +15,15 @@ "command": "\"node_modules/.bin/electrobun\" dev" } }, + "lint": { + "executor": "@nx/eslint:lint" + }, + "typecheck": { + "executor": "nx:run-commands", + "options": { + "command": "tsc -p apps/desktop/tsconfig.json --noEmit" + } + }, "build": { "executor": "nx:run-commands", "dependsOn": [{ "target": "build", "projects": ["app"] }], diff --git a/apps/desktop/tsconfig.json b/apps/desktop/tsconfig.json index 8426f22..b4173a9 100644 --- a/apps/desktop/tsconfig.json +++ b/apps/desktop/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { "lib": ["DOM"] }, + "compilerOptions": { + "lib": ["DOM"], + // ponytail: electrobun/bun ships raw .ts source that fails these two + // flags (blackboardsh/electrobun#516) — relax here, not workspace-wide. + // Drop once that lands upstream. + "exactOptionalPropertyTypes": false, + "noImplicitReturns": false + }, "include": ["src/**/*.ts"] } diff --git a/eslint.config.ts b/eslint.config.ts index c0828d0..9e962c8 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -14,23 +14,9 @@ export default [ plugins: { 'simple-import-sort': simpleImportSort, 'unused-imports': unusedImports, - tailwindcss, - }, - // Resolved relative to the nearest eslint.config.ts/package.json above - // the linted file — that's apps/app/, not the workspace root. - settings: { - tailwindcss: { cssConfigPath: './src/styles.css' }, }, // Override the preset's severities and add the workspace's own rules. rules: { - 'tailwindcss/classnames-order': 'error', - 'tailwindcss/no-arbitrary-value': 'error', - 'tailwindcss/no-unnecessary-arbitrary-value': 'error', - 'tailwindcss/no-custom-classname': [ - 'error', - // { whitelist: ['custom\\-*'] }, - ], - 'tailwindcss/no-contradicting-classname': 'error', '@nx/enforce-module-boundaries': [ 'error', { @@ -61,13 +47,28 @@ export default [ }, }, { - files: ['**/*.html'], + // Scoped to apps/app: it's the only project with Tailwind CSS. + // apps/desktop is a Bun main-process shell with no styles.css to check against. + files: ['apps/app/**/*.ts', 'apps/app/**/*.html'], plugins: { tailwindcss, }, settings: { tailwindcss: { cssConfigPath: './src/styles.css' }, }, + rules: { + 'tailwindcss/classnames-order': 'error', + 'tailwindcss/no-arbitrary-value': 'error', + 'tailwindcss/no-unnecessary-arbitrary-value': 'error', + 'tailwindcss/no-custom-classname': [ + 'error', + // { whitelist: ['custom\\-*'] }, + ], + 'tailwindcss/no-contradicting-classname': 'error', + }, + }, + { + files: ['**/*.html'], rules: { '@angular-eslint/template/attributes-order': [ 'error', @@ -83,14 +84,6 @@ export default [ ], }, ], - 'tailwindcss/classnames-order': 'error', - 'tailwindcss/no-arbitrary-value': 'error', - 'tailwindcss/no-unnecessary-arbitrary-value': 'error', - 'tailwindcss/no-custom-classname': [ - 'error', - // { whitelist: ['custom\\-*'] }, - ], - 'tailwindcss/no-contradicting-classname': 'error', }, }, ];