diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbe92f1..c4d575b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,7 @@ jobs: - uses: actions/checkout@v6 - uses: oven-sh/setup-bun@v2 - run: bun install - - run: bun tsc --noEmit - - run: bunx eslint . --config eslint.config.js --max-warnings=999999 + - run: bun run lint test: name: Test diff --git a/AGENTS.md b/AGENTS.md index eb46901..5672b1c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,7 +33,10 @@ bun test bun test --watch # Lint and type check -bun run lint # Runs TypeScript type checking and ESLint with auto-fix +bun run lint # Runs TypeScript type checking and ESLint without modifying files + +# Apply ESLint auto-fixes intentionally +bun run lint:fix ``` ## Architecture @@ -136,7 +139,7 @@ Default to using Bun instead of Node.js: 2. `postbuild`: Runs scripts/replace-version.ts to replace `__PACKAGE_VERSION__` placeholder with actual version from package.json - **ESLint configuration**: Uses flat config format (eslint.config.js) with TypeScript and React plugins - **Dependencies**: All runtime dependencies are bundled using `--packages=external` for npm package -- **Type checking and linting**: Only run via `bun run lint` command, never using `npx eslint` or `eslint` directly. Never run `tsx`, `bun tsc` or any other variation +- **Type checking and linting**: Run checks via `bun run lint` and use `bun run lint:fix` only when you intentionally want ESLint auto-fixes. Never use `npx eslint`, `eslint`, `tsx`, `bun tsc`, or any other variation directly - **Lint rules**: Never disable a lint rule via a comment, no matter how benign the lint warning or error may seem - **Testing**: Uses Vitest (via Bun) with 6 test files and ~40 test cases covering: - Model context detection and token calculation (src/utils/__tests__/model-context.test.ts) diff --git a/README.md b/README.md index 5f711d0..f918b7e 100644 --- a/README.md +++ b/README.md @@ -673,9 +673,12 @@ bun run example # Run tests bun test -# Run typecheck + eslint autofix +# Run typecheck + eslint checks without modifying files bun run lint +# Apply ESLint auto-fixes intentionally +bun run lint:fix + # Build for distribution bun run build diff --git a/package.json b/package.json index 2989ddd..350234e 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "postbuild": "bun run scripts/replace-version.ts", "example": "cat scripts/payload.example.json | bun start", "prepublishOnly": "bun run build", - "lint": "bun tsc --noEmit && eslint . --config eslint.config.js --max-warnings=999999 --fix", + "lint": "bun tsc --noEmit && eslint . --config eslint.config.js --max-warnings=0", + "lint:fix": "bun tsc --noEmit && eslint . --config eslint.config.js --max-warnings=0 --fix", "docs": "typedoc", "docs:clean": "rm -rf docs" },