Skip to content

Commit b9e48d0

Browse files
Albertclaude
andcommitted
chore: add ESLint, Prettier, Husky + GitHub Actions CI
- ESLint (typescript-eslint) with no-any, no-unused-vars rules - Prettier (120 width, double quotes, trailing commas) - Husky pre-commit hook running lint-staged - GitHub Actions CI: lint → format check → build on push/PR to main - Add types: ["node"] to tsconfig Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3fbaf37 commit b9e48d0

11 files changed

Lines changed: 1639 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint-format-build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
20+
- run: npm ci
21+
22+
- name: ESLint
23+
run: npm run lint
24+
25+
- name: Prettier check
26+
run: npm run format:check
27+
28+
- name: TypeScript build
29+
run: npm run build

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
package-lock.json

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"trailingComma": "all",
5+
"printWidth": 120,
6+
"tabWidth": 2
7+
}

eslint.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
ignores: ["dist/", "node_modules/"],
9+
},
10+
{
11+
rules: {
12+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
13+
"@typescript-eslint/no-explicit-any": "error",
14+
},
15+
},
16+
);

0 commit comments

Comments
 (0)