Skip to content

Commit 8fa17ab

Browse files
committed
fix: address codex review — widen prettier globs, add lint warning ratchet, lint preload.cjs
1 parent 59d0c63 commit 8fa17ab

7 files changed

Lines changed: 143 additions & 54 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- 'v*'
77

88
permissions:
99
contents: write
@@ -31,7 +31,7 @@ jobs:
3131

3232
- uses: actions/setup-node@v4
3333
with:
34-
node-version: "lts/*"
34+
node-version: 'lts/*'
3535
cache: npm
3636

3737
- run: npm ci
@@ -54,7 +54,7 @@ jobs:
5454

5555
- uses: actions/setup-node@v4
5656
with:
57-
node-version: "lts/*"
57+
node-version: 'lts/*'
5858
cache: npm
5959

6060
- name: Import code signing certificate

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"recommendations": []}
1+
{ "recommendations": [] }

docs/plans/2026-02-21-eslint-prettier-ci.md

Lines changed: 57 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313
### Task 1: Install ESLint and plugins
1414

1515
**Files:**
16+
1617
- Modify: `package.json`
1718

1819
**Step 1: Install all ESLint-related packages**
1920

2021
Run:
22+
2123
```bash
2224
npm install -D eslint @eslint/js typescript-eslint eslint-plugin-solid @typescript-eslint/parser
2325
```
26+
2427
Expected: packages added to devDependencies in package.json
2528

2629
**Step 2: Commit**
@@ -35,14 +38,17 @@ git commit -m "chore: install eslint and typescript/solid plugins"
3538
### Task 2: Install Prettier and ESLint integration
3639

3740
**Files:**
41+
3842
- Modify: `package.json`
3943

4044
**Step 1: Install Prettier and eslint-config-prettier**
4145

4246
Run:
47+
4348
```bash
4449
npm install -D prettier eslint-config-prettier
4550
```
51+
4652
Expected: packages added to devDependencies
4753

4854
**Step 2: Commit**
@@ -57,23 +63,24 @@ git commit -m "chore: install prettier and eslint-config-prettier"
5763
### Task 3: Create ESLint flat config
5864

5965
**Files:**
66+
6067
- Create: `eslint.config.js`
6168

6269
**Step 1: Create the ESLint config file**
6370

6471
Create `eslint.config.js` at project root:
6572

6673
```javascript
67-
import js from "@eslint/js";
68-
import tseslint from "typescript-eslint";
69-
import solid from "eslint-plugin-solid/configs/typescript";
70-
import * as tsParser from "@typescript-eslint/parser";
71-
import eslintConfigPrettier from "eslint-config-prettier/flat";
74+
import js from '@eslint/js';
75+
import tseslint from 'typescript-eslint';
76+
import solid from 'eslint-plugin-solid/configs/typescript';
77+
import * as tsParser from '@typescript-eslint/parser';
78+
import eslintConfigPrettier from 'eslint-config-prettier/flat';
7279

7380
export default [
7481
// Ignore build output
7582
{
76-
ignores: ["dist/**", "dist-electron/**", "release/**", "node_modules/**"],
83+
ignores: ['dist/**', 'dist-electron/**', 'release/**', 'node_modules/**'],
7784
},
7885

7986
// Base JS recommended rules
@@ -84,58 +91,58 @@ export default [
8491

8592
// SolidJS-specific rules for TSX files
8693
{
87-
files: ["src/**/*.{ts,tsx}"],
94+
files: ['src/**/*.{ts,tsx}'],
8895
...solid,
8996
languageOptions: {
9097
parser: tsParser,
9198
parserOptions: {
92-
project: "./tsconfig.json",
99+
project: './tsconfig.json',
93100
},
94101
},
95102
},
96103

97104
// Electron backend files use Node tsconfig
98105
{
99-
files: ["electron/**/*.ts"],
106+
files: ['electron/**/*.ts'],
100107
languageOptions: {
101108
parser: tsParser,
102109
parserOptions: {
103-
project: "./electron/tsconfig.json",
110+
project: './electron/tsconfig.json',
104111
},
105112
},
106113
},
107114

108115
// Custom strict rules
109116
{
110-
files: ["**/*.{ts,tsx}"],
117+
files: ['**/*.{ts,tsx}'],
111118
rules: {
112119
// Prevent `any` — use `unknown` instead
113-
"@typescript-eslint/no-explicit-any": "error",
120+
'@typescript-eslint/no-explicit-any': 'error',
114121

115122
// Require explicit return types on exported functions
116-
"@typescript-eslint/explicit-module-boundary-types": "off",
123+
'@typescript-eslint/explicit-module-boundary-types': 'off',
117124

118125
// No unused variables (underscore prefix allowed for intentional skips)
119-
"@typescript-eslint/no-unused-vars": [
120-
"error",
126+
'@typescript-eslint/no-unused-vars': [
127+
'error',
121128
{
122-
argsIgnorePattern: "^_",
123-
varsIgnorePattern: "^_",
124-
caughtErrorsIgnorePattern: "^_",
129+
argsIgnorePattern: '^_',
130+
varsIgnorePattern: '^_',
131+
caughtErrorsIgnorePattern: '^_',
125132
},
126133
],
127134

128135
// Consistency
129-
"prefer-const": "error",
130-
"no-var": "error",
131-
eqeqeq: ["error", "always"],
132-
curly: ["error", "multi-line"],
136+
'prefer-const': 'error',
137+
'no-var': 'error',
138+
eqeqeq: ['error', 'always'],
139+
curly: ['error', 'multi-line'],
133140

134141
// No console.log (allow warn/error for legitimate error reporting)
135-
"no-console": ["warn", { allow: ["warn", "error"] }],
142+
'no-console': ['warn', { allow: ['warn', 'error'] }],
136143

137144
// Prevent non-null assertions (prefer explicit checks)
138-
"@typescript-eslint/no-non-null-assertion": "warn",
145+
'@typescript-eslint/no-non-null-assertion': 'warn',
139146
},
140147
},
141148

@@ -147,9 +154,11 @@ export default [
147154
**Step 2: Verify ESLint runs without crashing**
148155

149156
Run:
157+
150158
```bash
151159
npx eslint --max-warnings 0 . 2>&1 | head -50
152160
```
161+
153162
Expected: Either clean output or lint errors (not config/parse errors). If there are errors, that's expected — we'll fix them in a later task.
154163

155164
**Step 3: Commit**
@@ -164,6 +173,7 @@ git commit -m "chore: add eslint flat config with strict typescript and solid ru
164173
### Task 4: Create Prettier config
165174

166175
**Files:**
176+
167177
- Create: `.prettierrc`
168178
- Create: `.prettierignore`
169179

@@ -196,9 +206,11 @@ package-lock.json
196206
**Step 3: Verify Prettier runs**
197207

198208
Run:
209+
199210
```bash
200211
npx prettier --check "src/**/*.{ts,tsx}" 2>&1 | tail -5
201212
```
213+
202214
Expected: list of files that would be reformatted (expected — we haven't formatted yet)
203215

204216
**Step 4: Commit**
@@ -213,11 +225,13 @@ git commit -m "chore: add prettier config"
213225
### Task 5: Add npm scripts for lint and format
214226

215227
**Files:**
228+
216229
- Modify: `package.json` (scripts section)
217230

218231
**Step 1: Add lint and format scripts**
219232

220233
Add these scripts to `package.json`:
234+
221235
```json
222236
{
223237
"scripts": {
@@ -244,22 +258,27 @@ git commit -m "chore: add lint, format, and check npm scripts"
244258
### Task 6: Format the entire codebase with Prettier
245259

246260
**Files:**
261+
247262
- Modify: all `.ts`, `.tsx`, `.css`, `.js`, `.json`, `.md` files
248263

249264
**Step 1: Run Prettier on the entire codebase**
250265

251266
Run:
267+
252268
```bash
253269
npm run format
254270
```
271+
255272
Expected: Prettier reformats files. This will be a large diff — that's expected and intentional.
256273

257274
**Step 2: Verify no files are left unformatted**
258275

259276
Run:
277+
260278
```bash
261279
npm run format:check
262280
```
281+
263282
Expected: all files pass
264283

265284
**Step 3: Commit the formatting separately**
@@ -276,25 +295,29 @@ This is a standalone commit so `git blame` can use `--ignore-rev` to skip it.
276295
### Task 7: Fix all ESLint errors
277296

278297
**Files:**
298+
279299
- Modify: various `.ts` and `.tsx` files (depends on what ESLint reports)
280300

281301
**Step 1: Run ESLint auto-fix first**
282302

283303
Run:
304+
284305
```bash
285306
npm run lint:fix
286307
```
287308

288309
**Step 2: Check remaining errors**
289310

290311
Run:
312+
291313
```bash
292314
npm run lint 2>&1
293315
```
294316

295317
**Step 3: Fix remaining errors manually**
296318

297319
For each error:
320+
298321
- `no-console` warnings on `console.log` — remove or change to `console.warn`/`console.error`
299322
- `@typescript-eslint/no-explicit-any` — replace with `unknown` or proper type
300323
- `@typescript-eslint/no-non-null-assertion` — add explicit null checks
@@ -306,17 +329,21 @@ For each error:
306329
**Step 4: Verify clean lint**
307330

308331
Run:
332+
309333
```bash
310334
npm run lint
311335
```
336+
312337
Expected: 0 errors, 0 warnings
313338

314339
**Step 5: Verify typecheck still passes**
315340

316341
Run:
342+
317343
```bash
318344
npm run typecheck
319345
```
346+
320347
Expected: no errors
321348

322349
**Step 6: Commit**
@@ -331,6 +358,7 @@ git commit -m "fix: resolve all eslint errors across codebase"
331358
### Task 8: Add CI quality gate workflow
332359

333360
**Files:**
361+
334362
- Create: `.github/workflows/ci.yml`
335363

336364
**Step 1: Create CI workflow**
@@ -354,7 +382,7 @@ jobs:
354382

355383
- uses: actions/setup-node@v4
356384
with:
357-
node-version: "lts/*"
385+
node-version: 'lts/*'
358386
cache: npm
359387

360388
- run: npm ci
@@ -383,17 +411,21 @@ git commit -m "ci: add quality gate workflow with typecheck, lint, and format ch
383411
**Step 1: Run the full quality check**
384412
385413
Run:
414+
386415
```bash
387416
npm run check
388417
```
418+
389419
Expected: typecheck passes, lint passes, format check passes — all three green.
390420

391421
**Step 2: Verify the app still builds**
392422

393423
Run:
424+
394425
```bash
395426
npm run build:frontend
396427
```
428+
397429
Expected: build succeeds without errors
398430

399431
---

0 commit comments

Comments
 (0)