[QOTD-4] Configure ESLint #4

Open
ai-implementer wants to merge 1 commits from ssmp/qotd-4-r6 into main
3 changed files with 17 additions and 4 deletions

View File

@ -42,8 +42,10 @@ quote-of-the-day-api/
├── src/ # TypeScript source ├── src/ # TypeScript source
│ └── placeholder.test.ts # harness smoke test │ └── placeholder.test.ts # harness smoke test
├── dist/ # compiled output (git-ignored) ├── dist/ # compiled output (git-ignored)
├── eslint.config.mjs # ESLint flat config (@typescript-eslint recommended)
├── package.json ├── package.json
├── package-lock.json ├── package-lock.json
├── tsconfig.json
├── .gitignore ├── .gitignore
├── README.md # Project overview (currently a stub) ├── README.md # Project overview (currently a stub)
└── CLAUDE.md # This file └── CLAUDE.md # This file
@ -61,9 +63,7 @@ quote-of-the-day-api/
## Code Style ## Code Style
> Update this section once a linter/formatter config is committed (`.eslintrc`, etc.). - **TypeScript**: `strict: true`, `target: "ES2020"` in `tsconfig.json`
- **Linting**: ESLint 10 flat config (`eslint.config.mjs`) using `@typescript-eslint/eslint-plugin` `flat/recommended` rules; run `npm run lint` — must exit 0
- **TypeScript**: `strict: true`, `target: "ES2020"` recommended in `tsconfig.json`
- **Linting**: ESLint with `@typescript-eslint` rules; `npm run lint` must exit cleanly
- Follow the conventions of the chosen language's ecosystem formatter (e.g., Prettier for JS/TS). - Follow the conventions of the chosen language's ecosystem formatter (e.g., Prettier for JS/TS).
- Keep controllers thin; put business logic in service or domain layers. - Keep controllers thin; put business logic in service or domain layers.

12
eslint.config.mjs Normal file
View File

@ -0,0 +1,12 @@
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
export default [
...tsPlugin.configs['flat/recommended'],
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
},
},
];

View File

@ -6,6 +6,7 @@
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"dev": "ts-node src/index.ts", "dev": "ts-node src/index.ts",
"lint": "eslint src",
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest" "test:watch": "vitest"
}, },