[QOTD-4] Configure ESLint #4
@ -42,8 +42,10 @@ quote-of-the-day-api/
|
||||
├── src/ # TypeScript source
|
||||
│ └── placeholder.test.ts # harness smoke test
|
||||
├── dist/ # compiled output (git-ignored)
|
||||
├── eslint.config.mjs # ESLint flat config (@typescript-eslint recommended)
|
||||
├── package.json
|
||||
├── package-lock.json
|
||||
├── tsconfig.json
|
||||
├── .gitignore
|
||||
├── README.md # Project overview (currently a stub)
|
||||
└── CLAUDE.md # This file
|
||||
@ -61,9 +63,7 @@ quote-of-the-day-api/
|
||||
|
||||
## Code Style
|
||||
|
||||
> Update this section once a linter/formatter config is committed (`.eslintrc`, etc.).
|
||||
|
||||
- **TypeScript**: `strict: true`, `target: "ES2020"` recommended in `tsconfig.json`
|
||||
- **Linting**: ESLint with `@typescript-eslint` rules; `npm run lint` must exit cleanly
|
||||
- **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
|
||||
- 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.
|
||||
|
||||
12
eslint.config.mjs
Normal file
12
eslint.config.mjs
Normal 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,
|
||||
},
|
||||
},
|
||||
];
|
||||
@ -6,6 +6,7 @@
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "ts-node src/index.ts",
|
||||
"lint": "eslint src",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest"
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user