{"_id":"@drimo/eslint-config","name":"@drimo/eslint-config","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@drimo/eslint-config","version":"1.0.0","description":"Configuración ESLint compartida para todos los proyectos frontend de Drimo","type":"module","main":"index.js","exports":{".":"./index.js","./base":"./configs/base.js","./nextjs":"./configs/nextjs.js","./react-query":"./configs/react-query.js"},"keywords":["eslint","eslint-config","drimo","typescript","nextjs","react-query"],"author":{"name":"Drimo","email":"dev@drimo.com"},"license":"MIT","homepage":"https://github.com/rokket-labs/eslint-config#readme","repository":{"type":"git","url":"git+https://github.com/rokket-labs/eslint-config.git"},"bugs":{"url":"https://github.com/rokket-labs/eslint-config/issues"},"peerDependencies":{"@eslint/js":">=9.0.0","@next/eslint-plugin-next":">=14.0.0","@typescript-eslint/eslint-plugin":">=8.0.0","@typescript-eslint/parser":">=8.0.0","eslint":">=9.0.0","eslint-plugin-react":">=7.0.0","eslint-plugin-react-hooks":">=5.0.0"},"peerDependenciesMeta":{"@next/eslint-plugin-next":{"optional":true}},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"gitHead":"1fb88120a8cf1f02985d042891d5a1edc9bac6e4","_id":"@drimo/eslint-config@1.0.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-GuzJTup+Q1LWc4wMB/jT2q9JNNSTNuEE8wIatIZXCD6KZI1ttsHU+rEVE++3m6GyIksb2DVIwa6Vnm1tb5SIVg==","shasum":"a0ab9eebdc19feb0bec8a47881792e919506ec2b","tarball":"https://registry.npmjs.org/@drimo/eslint-config/-/eslint-config-1.0.0.tgz","fileCount":9,"unpackedSize":58366,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCUshnXDgp8qB9RK//IbOqUxq3+COVvLnV/DMb0GGPJ2QIhALUTqKUymuzhg1iZ0ZTQdGbCnU7MepCVQjCnGKB44TcS"}]},"_npmUser":{"name":"mauricio.martinez.drimo","email":"mauricio.martinez@drimo.com"},"directories":{},"maintainers":[{"name":"mauricio.martinez.drimo","email":"mauricio.martinez@drimo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-config_1.0.0_1779828639618_0.07611358631003307"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-26T20:50:39.450Z","1.0.0":"2026-05-26T20:50:39.817Z","modified":"2026-05-26T20:50:40.065Z"},"maintainers":[{"name":"mauricio.martinez.drimo","email":"mauricio.martinez@drimo.com"}],"description":"Configuración ESLint compartida para todos los proyectos frontend de Drimo","homepage":"https://github.com/rokket-labs/eslint-config#readme","keywords":["eslint","eslint-config","drimo","typescript","nextjs","react-query"],"repository":{"type":"git","url":"git+https://github.com/rokket-labs/eslint-config.git"},"author":{"name":"Drimo","email":"dev@drimo.com"},"bugs":{"url":"https://github.com/rokket-labs/eslint-config/issues"},"license":"MIT","readme":"# @drimo/eslint-config\n\n[![npm](https://img.shields.io/npm/v/@drimo/eslint-config)](https://www.npmjs.com/package/@drimo/eslint-config)\n\nConfiguración ESLint oficial para todos los proyectos frontend de Drimo. Requiere **ESLint 9** con flat config.\n\nIncluye reglas para TypeScript, React, Next.js, React Query y dos reglas custom que detectan anti-patrones recurrentes en la organización.\n\n---\n\n## Instalación\n\n```bash\nyarn add -D @drimo/eslint-config \\\n  eslint \\\n  @typescript-eslint/eslint-plugin \\\n  @typescript-eslint/parser \\\n  eslint-plugin-react \\\n  eslint-plugin-react-hooks\n\n# Solo si el proyecto usa Next.js:\nyarn add -D @next/eslint-plugin-next\n```\n\n---\n\n## Uso\n\n### Proyecto Next.js + React Query (stack completo Drimo)\n\n```js\n// eslint.config.js\nimport { base, nextjs, reactQuery } from '@drimo/eslint-config'\n\nexport default [\n  ...base,\n  ...nextjs,\n  ...reactQuery,\n  {\n    ignores: ['node_modules/', '.next/', 'dist/', 'build/', 'public/'],\n  },\n]\n```\n\nCrear también `src/libs/queryClient.ts` con la factory estándar:\n\n```ts\nimport { QueryClient } from 'react-query'\n\nexport function createQueryClient() {\n  return new QueryClient({\n    defaultOptions: {\n      queries: {\n        staleTime: 5 * 60 * 1000,\n        cacheTime: 10 * 60 * 1000,\n        refetchOnWindowFocus: false,\n        refetchOnReconnect: 'stale',\n        retry: 1,\n        retryDelay: 1000,\n      },\n    },\n  })\n}\n```\n\n### Solo TypeScript / NestJS (sin React)\n\n```js\nimport { base } from '@drimo/eslint-config'\n\nexport default [\n  ...base,\n  { ignores: ['node_modules/', 'dist/'] },\n]\n```\n\n---\n\n## Configs disponibles\n\n| Config | Contenido |\n|---|---|\n| `base` | Reglas TypeScript generales: unused-vars, no-explicit-any, prefer-const, no-console, no-empty, max-lines |\n| `nextjs` | React hooks, jsx-key, no-img-element, setTimeout cleanup, new QueryClient() con opciones |\n| `reactQuery` | Plugin custom con reglas `no-zero-query-cache` y `no-limit-hack` |\n\n---\n\n## Reglas custom\n\n### `drimo-react-query/no-zero-query-cache` — error\n\nDetecta `staleTime: 0` y `cacheTime: 0` / `gcTime: 0` en `QueryClient` y en hooks (`useQuery`, `useInfiniteQuery`, etc.).\n\n```ts\n// ❌ Error\nconst queryClient = new QueryClient({\n  defaultOptions: { queries: { staleTime: 0 } }\n})\n\n// ✅ Correcto\nimport { createQueryClient } from '@/libs/queryClient'\nconst queryClient = createQueryClient()\n```\n\n### `drimo-react-query/no-limit-hack` — warning\n\nDetecta `limit > 200` en argumentos de funciones. Indica paginación fingida.\n\n```ts\n// ⚠️ Warning\napi.getRooms({ page: 1, limit: 1000 })\n\n// ✅ Correcto — paginación real o endpoint /options\napi.getRoomOptions()\n```\n\n---\n\n## Integración CI/CD\n\n```json\n// package.json\n{\n  \"scripts\": {\n    \"lint\": \"next lint\",\n    \"lint:ci\": \"next lint --max-warnings 0\"\n  }\n}\n```\n\nUsar `lint` en PRs y `lint:ci` en merge a `main`.\n\n---\n\n## Documentación completa\n\nVer [RULES.md](./RULES.md) para la documentación técnica de cada regla con ejemplos reales de código encontrado en producción.\n\n---\n\n## Contribuir\n\nSi identificás un anti-patrón recurrente en más de un proyecto, abrí un issue con el ejemplo real (proyecto + archivo + línea) para evaluar agregarlo al paquete.\n\nVersionado semver: `patch` para nuevos `warn`, `minor` para nuevos `error`, `major` para breaking changes en la API de configuración.\n","readmeFilename":"README.md","_rev":"1-33dc8d57f8a06af5d87d4b2a1c335dc4"}