Skip to content

Commit 1840865

Browse files
nicklemmonclaude
andauthored
Harden static analysis checks (#317)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 7fbd2ca commit 1840865

46 files changed

Lines changed: 1631 additions & 3792 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,43 @@ jobs:
4040
- name: Install dependencies
4141
run: npm ci
4242
- name: Type check
43-
run: npm run lint:types
43+
run: npm run typecheck
44+
45+
format:
46+
runs-on: ubuntu-latest
47+
timeout-minutes: 10
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
51+
with:
52+
persist-credentials: false
53+
- name: Setup Node.js
54+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
55+
with:
56+
node-version: '24'
57+
cache: 'npm'
58+
- name: Install dependencies
59+
run: npm ci
60+
- name: Check formatting
61+
run: npm run format:check
62+
63+
lint:
64+
runs-on: ubuntu-latest
65+
timeout-minutes: 10
66+
steps:
67+
- name: Checkout code
68+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
69+
with:
70+
persist-credentials: false
71+
- name: Setup Node.js
72+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
73+
with:
74+
node-version: '24'
75+
cache: 'npm'
76+
- name: Install dependencies
77+
run: npm ci
78+
- name: Lint
79+
run: npm run lint
4480

4581
playwright-version:
4682
runs-on: ubuntu-latest

.oxfmtrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 100,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"semi": false,
7+
"proseWrap": "always",
8+
"sortPackageJson": false,
9+
"ignorePatterns": ["CLAUDE.md", ".github/dependabot.yml"]
10+
}

.oxlintrc.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"options": {
4+
"typeAware": true,
5+
"maxWarnings": 0
6+
},
7+
"plugins": ["typescript", "react", "jsx-a11y", "import", "promise", "vitest", "oxc"],
8+
"categories": {
9+
"correctness": "error",
10+
"suspicious": "error"
11+
},
12+
"rules": {
13+
"typescript/no-explicit-any": "error",
14+
"typescript/no-non-null-assertion": "error",
15+
"typescript/no-unsafe-assignment": "error",
16+
"typescript/no-unsafe-argument": "error",
17+
"typescript/no-unsafe-call": "error",
18+
"typescript/no-unsafe-member-access": "error",
19+
"typescript/no-floating-promises": "error",
20+
"typescript/no-misused-promises": "error",
21+
"typescript/switch-exhaustiveness-check": "error",
22+
"react/rules-of-hooks": "error",
23+
"react/exhaustive-deps": "error",
24+
"react/react-in-jsx-scope": "off",
25+
"typescript/no-unsafe-type-assertion": "off",
26+
"typescript/no-duplicate-type-constituents": "off",
27+
"react/refs": "off",
28+
"react/purity": "off",
29+
"jsx-a11y/alt-text": "off",
30+
"jsx-a11y/control-has-associated-label": "off",
31+
"jsx-a11y/label-has-associated-control": "off",
32+
"jsx-a11y/click-events-have-key-events": "off",
33+
"jsx-a11y/no-static-element-interactions": "off",
34+
"jsx-a11y/prefer-tag-over-role": "off",
35+
"import/no-unassigned-import": "off",
36+
"eslint/no-shadow": "off"
37+
}
38+
}

.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["oxc.oxc-vscode"]
3+
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"editor.formatOnSave": true,
3-
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.defaultFormatter": "oxc.oxc-vscode",
44
"[shellscript]": {
55
"editor.defaultFormatter": "foxundermoon.shell-format"
66
}

CLAUDE.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ repository.
88
- `npm start` - Start development server using Vite
99
- `npm run build` - Build production bundle
1010
- `npm run preview` - Preview production build locally
11-
- `npm run prettier:write` - Format all files with Prettier
11+
- `npm run format` - Format all files with Oxfmt
12+
- `npm run typecheck` - Check TypeScript types
1213

1314
## Code Quality
1415

@@ -55,6 +56,14 @@ entity-name/
5556

5657
- Use `type` over `interface`
5758

59+
### JSDoc conventions
60+
61+
- Add a JSDoc description when you add or extract a function with a domain rule, a side effect, or
62+
a failure condition.
63+
- Use Simplified Technical English: use short, direct sentences in the present tense.
64+
- Describe intent and observable behavior. Do not repeat type information in `@param`, `@returns`,
65+
or prose; TypeScript already provides it.
66+
5867
### Adding New Game Content
5968

6069
- **Cards**: Create folder in `src/cards/` with config.ts using `defineCard()` helper

0 commit comments

Comments
 (0)