Add Husky pre-commit with eslint and Sentry env convention (M0).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Mauricio Barragan
2026-06-10 23:51:52 -06:00
parent fbfa6e3ba6
commit b5ff33d716
7 changed files with 2191 additions and 3 deletions
+3
View File
@@ -22,3 +22,6 @@ DEMO_MODE=false
# Feed recorder (NDJSON to data/)
RECORD_FEED=false
# Sentry — https://sentry.io (project: arbpulse)
SENTRY_DSN=
+1
View File
@@ -0,0 +1 @@
npx lint-staged
+6
View File
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"tabWidth": 2
}
+7
View File
@@ -343,6 +343,13 @@ Eso no indica que el bot “no funcione”: indica que el filtro económico es e
---
## Production practices
- **Pre-commit:** Husky runs lint-staged (`eslint --fix`, `prettier --write`) on staged `*.ts` / `*.tsx` in `src/` and `web/src/`.
- **Observability:** Sentry planned — set `SENTRY_DSN` in `.env` after creating the `arbpulse` project in Sentry.
---
## Licencia
MIT — ver archivo `LICENSE` cuando se añada al repositorio.
+31
View File
@@ -0,0 +1,31 @@
import eslint from "@eslint/js";
import reactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
{ ignores: ["web/dist/**", "data/**", "**/node_modules/**"] },
{
files: ["src/**/*.ts"],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: globals.node,
},
},
{
files: ["web/src/**/*.{ts,tsx}"],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
plugins: { "react-hooks": reactHooks },
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: globals.browser,
parserOptions: { ecmaFeatures: { jsx: true } },
},
rules: {
...reactHooks.configs.recommended.rules,
},
},
);
+2121 -1
View File
File diff suppressed because it is too large Load Diff
+22 -2
View File
@@ -12,7 +12,19 @@
"start": "tsx src/index.ts",
"build": "npm --prefix web install && npm --prefix web run build",
"typecheck": "tsc --noEmit && npm --prefix web run typecheck",
"test": "node scripts/run-tests.mjs"
"test": "node scripts/run-tests.mjs",
"lint": "eslint .",
"prepare": "husky"
},
"lint-staged": {
"src/**/*.ts": [
"eslint --fix",
"prettier --write"
],
"web/src/**/*.{ts,tsx}": [
"eslint --fix",
"prettier --write"
]
},
"dependencies": {
"express": "^4.21.2",
@@ -21,11 +33,19 @@
"ws": "^8.18.0"
},
"devDependencies": {
"@eslint/js": "^9.18.0",
"@types/express": "^4.17.21",
"@types/node": "^22.10.5",
"@types/swagger-ui-express": "^4.1.8",
"@types/ws": "^8.5.13",
"eslint": "^9.18.0",
"eslint-plugin-react-hooks": "^5.1.0",
"globals": "^15.14.0",
"husky": "^9.1.7",
"lint-staged": "^16.4.0",
"openapi-types": "^12.1.3",
"typescript": "^5.7.3"
"prettier": "^3.8.3",
"typescript": "^5.7.3",
"typescript-eslint": "^8.26.0"
}
}