mirror of
https://github.com/mauricioabh/arbpulse.git
synced 2026-07-27 15:47:43 +00:00
Add Husky pre-commit with eslint and Sentry env convention (M0).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,3 +22,6 @@ DEMO_MODE=false
|
|||||||
|
|
||||||
# Feed recorder (NDJSON to data/)
|
# Feed recorder (NDJSON to data/)
|
||||||
RECORD_FEED=false
|
RECORD_FEED=false
|
||||||
|
|
||||||
|
# Sentry — https://sentry.io (project: arbpulse)
|
||||||
|
SENTRY_DSN=
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
npx lint-staged
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": false,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"tabWidth": 2
|
||||||
|
}
|
||||||
@@ -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
|
## Licencia
|
||||||
|
|
||||||
MIT — ver archivo `LICENSE` cuando se añada al repositorio.
|
MIT — ver archivo `LICENSE` cuando se añada al repositorio.
|
||||||
|
|||||||
@@ -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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
Generated
+2121
-1
File diff suppressed because it is too large
Load Diff
+22
-2
@@ -12,7 +12,19 @@
|
|||||||
"start": "tsx src/index.ts",
|
"start": "tsx src/index.ts",
|
||||||
"build": "npm --prefix web install && npm --prefix web run build",
|
"build": "npm --prefix web install && npm --prefix web run build",
|
||||||
"typecheck": "tsc --noEmit && npm --prefix web run typecheck",
|
"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": {
|
"dependencies": {
|
||||||
"express": "^4.21.2",
|
"express": "^4.21.2",
|
||||||
@@ -21,11 +33,19 @@
|
|||||||
"ws": "^8.18.0"
|
"ws": "^8.18.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.18.0",
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
"@types/node": "^22.10.5",
|
"@types/node": "^22.10.5",
|
||||||
"@types/swagger-ui-express": "^4.1.8",
|
"@types/swagger-ui-express": "^4.1.8",
|
||||||
"@types/ws": "^8.5.13",
|
"@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",
|
"openapi-types": "^12.1.3",
|
||||||
"typescript": "^5.7.3"
|
"prettier": "^3.8.3",
|
||||||
|
"typescript": "^5.7.3",
|
||||||
|
"typescript-eslint": "^8.26.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user