Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Type check
run: npx tsc --noEmit

- name: Lint
run: npm run lint

- name: Build
run: npm run build

Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# 4. Run a few checks
npx tsc --noEmit
npm run lint
npx vitest run src/

# 5. Link globally (optional, for testing `opencli` command)
Expand Down Expand Up @@ -94,7 +95,7 @@
})()
`);

return data.slice(0, Number(limit)).map((item: any) => ({

Check warning on line 98 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
title: item.title,
url: item.url,
date: item.created_at,
Expand Down Expand Up @@ -130,7 +131,8 @@

## Code Style

- **TypeScript strict mode** β€” avoid `any` where possible.
- **ESLint** β€” enforced via [`@antfu/eslint-config`](https://github.com/antfu/eslint-config) (flat config). Run `npm run lint` to check, `npm run lint:fix` to auto-fix.
- **TypeScript strict mode** β€” avoid `any` where possible (currently `warn`, will be tightened to `error`).
- **ES Modules** β€” use `.js` extensions in imports (TypeScript output).
- **Naming**: `kebab-case` for files, `camelCase` for variables/functions, `PascalCase` for types/classes.
- **No default exports** β€” use named exports.
Expand All @@ -156,6 +158,7 @@
3. Run the checks that apply:
```bash
npx tsc --noEmit # Type check
npm run lint # ESLint
npx vitest run src/ # Unit tests
opencli validate # YAML validation (if applicable)
```
Expand Down
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import antfu from '@antfu/eslint-config'

export default antfu({
typescript: {
tsconfigPath: './tsconfig.json',
},
ignores: [
'dist/**',
'scripts/**',
'**/*.cjs',
// E2E/smoke tests and vitest.config.ts are outside tsconfig.json include path
'tests/**',
'vitest.config.ts',
],
rules: {
// Phase 1: warn on any β€” tighten to error incrementally
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// CLI tool needs console output
'no-console': 'off',
},
}, {
// Disable opinionated jsonc sort-keys for config files
files: ['**/*.json', '**/*.jsonc'],
rules: {
'jsonc/sort-keys': 'off',
},
})
Loading
Loading