chore: add ESLint with TypeScript support and baseline config
Install eslint, @eslint/js, and typescript-eslint as dev dependencies. Add eslint.config.js (flat config) with rules tuned to zero errors on the current codebase, add ESLint local hook to .pre-commit-config.yaml, and update the lint:ts npm script to use ESLint directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,3 +44,12 @@ repos:
|
||||
args: [--config-file=pyproject.toml]
|
||||
pass_filenames: false
|
||||
additional_dependencies: []
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: eslint
|
||||
name: eslint
|
||||
entry: npx eslint --fix
|
||||
language: node
|
||||
types: [ts]
|
||||
files: ^src/
|
||||
|
||||
19
eslint.config.js
Normal file
19
eslint.config.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import eslint from "@eslint/js";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
export default tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
files: ["src/**/*.ts"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
||||
"@typescript-eslint/no-unsafe-function-type": "off",
|
||||
"preserve-caught-error": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ["dist/", "node_modules/", "**/*.js", "!eslint.config.js"],
|
||||
},
|
||||
);
|
||||
1154
package-lock.json
generated
1154
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@
|
||||
"test:py": "pytest tests/ -v",
|
||||
"test:coverage": "pytest tests/ --cov=python --cov-report=html --cov-report=term",
|
||||
"lint": "npm run lint:ts && npm run lint:py",
|
||||
"lint:ts": "eslint src/ || echo 'ESLint not configured'",
|
||||
"lint:ts": "eslint src/",
|
||||
"lint:py": "cd python && black . && mypy . && flake8 .",
|
||||
"format": "prettier --write 'src/**/*.ts' && black python/",
|
||||
"prepare": "npm run build",
|
||||
@@ -40,11 +40,14 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cfworker/json-schema": "^4.1.1",
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/express": "^5.0.5",
|
||||
"@types/glob": "^8.1.0",
|
||||
"@types/node": "^20.19.0",
|
||||
"eslint": "^10.1.0",
|
||||
"nodemon": "^3.0.1",
|
||||
"prettier": "^3.8.1",
|
||||
"typescript": "^5.9.3"
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.57.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user