Skip to content

Commit 9dcf6cf

Browse files
committed
feat: add eslint and stricter typescript checks
1 parent 4285053 commit 9dcf6cf

10 files changed

Lines changed: 1153 additions & 24 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ jobs:
2222

2323
- run: npm ci
2424
- run: npm run typecheck
25+
- run: npm run lint
2526
- run: npm run test

CLAUDE.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ CLI for searching, managing, and configuring AI-ready documentation on Yavy.
55
## Commands
66

77
```bash
8-
pnpm install # Install dependencies
9-
pnpm run build # Build with tsup
10-
pnpm run dev # Build in watch mode
11-
pnpm test # Run tests (vitest)
12-
pnpm run typecheck # Type check without emitting
13-
pnpm run format:check # Check formatting (prettier)
14-
pnpm run format # Fix formatting
8+
npm install # Install dependencies
9+
npm run build # Build with tsup
10+
npm run dev # Build in watch mode
11+
npm run check # Run all checks (typecheck + lint + format + test)
12+
npm run typecheck # TypeScript strict type checking
13+
npm run lint # ESLint with typescript-eslint
14+
npm run lint:fix # ESLint auto-fix
15+
npm run test # Run tests (vitest)
16+
npm run format:check # Check formatting (prettier)
17+
npm run format # Fix formatting
1518
```
1619

1720
## Architecture
@@ -28,6 +31,8 @@ See [docs/architecture.md](docs/architecture.md) for details.
2831
## Key Design Decisions
2932

3033
- `@/` path aliases throughout (configured in tsconfig, tsup, vitest).
34+
- Strict TypeScript: `strict`, `noUncheckedIndexedAccess`, `noUnusedLocals`, `noUnusedParameters`, `noFallthroughCasesInSwitch`.
35+
- ESLint with typescript-eslint: `consistent-type-imports`, `no-floating-promises`, `no-explicit-any`.
3136
- Commands set `process.exitCode` instead of calling `process.exit()` directly - keeps code testable.
3237
- Two auth patterns coexist: OAuth (login flow) and token-based (API token via env or config file).
3338
- Interactive mode activates when required CLI flags are missing; flags always take precedence.

eslint.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
4+
export default tseslint.config(
5+
eslint.configs.recommended,
6+
...tseslint.configs.recommended,
7+
{
8+
languageOptions: {
9+
parserOptions: {
10+
projectService: true,
11+
tsconfigRootDir: import.meta.dirname,
12+
},
13+
},
14+
rules: {
15+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
16+
'@typescript-eslint/no-explicit-any': 'error',
17+
'@typescript-eslint/consistent-type-imports': 'error',
18+
'@typescript-eslint/no-floating-promises': 'error',
19+
},
20+
},
21+
{
22+
ignores: ['dist/', 'node_modules/', '*.config.*'],
23+
},
24+
);

0 commit comments

Comments
 (0)