{"_id":"@databits/dev-standards","_rev":"2-c0bcd4d54d8e83c25fe53da9041c12cd","name":"@databits/dev-standards","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@databits/dev-standards","version":"1.0.0","keywords":["eslint","typescript","standards","development","claude-code","databits","code-quality"],"author":{"name":"Databits"},"license":"MIT","_id":"@databits/dev-standards@1.0.0","maintainers":[{"name":"databits","email":"info@databits.com.au"}],"homepage":"https://github.com/amitsaddi/databits-dev-standards#readme","bugs":{"url":"https://github.com/amitsaddi/databits-dev-standards/issues"},"bin":{"dev-standards":"bin/cli.js","databits-standards":"bin/cli.js"},"dist":{"shasum":"c6f8a19f93a5bce9b13b948072375ea249161b73","tarball":"https://registry.npmjs.org/@databits/dev-standards/-/dev-standards-1.0.0.tgz","fileCount":18,"integrity":"sha512-Me+5yV505Lczc2PdFsM3Tt19MYQClo7xxb6u/jfYoy4YGOqJKdqpeeBscSyRY4KkgbPvKfXeJ2NZbSVExv1tbQ==","signatures":[{"sig":"MEUCIQD936hcYdHaZpVYiW4Pc3KujV8zKszMeDu0yx0OASPaLQIgP4tzZeKKf9t2cjI7BJVYa9TKL5bnyT4WstrACeh2g70=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102996},"main":"index.js","type":"commonjs","gitHead":"1d08656aaea75d256ae9e84c4ac091dcf3fc84f3","scripts":{"sync":"node bin/sync.js","test":"echo \"Tests not yet implemented\" && exit 0","version":"echo \"Version bump to $(node -p 'require(\"./package.json\").version')\" && git add package.json"},"_npmUser":{"name":"databits","email":"info@databits.com.au"},"repository":{"url":"git+https://github.com/amitsaddi/databits-dev-standards.git","type":"git"},"_npmVersion":"11.6.2","description":"Shared development standards, ESLint configs, TypeScript configs, and workflows for consistent code quality across all Databits projects","directories":{"doc":"docs"},"_nodeVersion":"22.21.0","dependencies":{"chalk":"^4.1.2","fs-extra":"^11.1.0","commander":"^11.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.50.0","typescript":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/dev-standards_1.0.0_1761719318468_0.7855340612729829","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@databits/dev-standards","version":"1.1.0","description":"Shared development standards, ESLint configs, TypeScript configs, and workflows for consistent code quality across all Databits projects","main":"index.js","type":"commonjs","bin":{"databits-standards":"bin/cli.js","dev-standards":"bin/cli.js"},"exports":{".":"./index.js","./configs/eslint/base":{"import":"./configs/eslint/base.mjs","require":"./configs/eslint/base.js"},"./configs/eslint/react":{"import":"./configs/eslint/react.mjs","require":"./configs/eslint/react.js"},"./configs/eslint/typescript":{"import":"./configs/eslint/typescript.mjs","require":"./configs/eslint/typescript.js"},"./configs/typescript/base":"./configs/typescript/base.json","./configs/typescript/nextjs":"./configs/typescript/nextjs.json","./configs/typescript/react":"./configs/typescript/react.json"},"scripts":{"sync":"node bin/sync.js","test":"echo \"Tests not yet implemented\" && exit 0","version":"echo \"Version bump to $(node -p 'require(\"./package.json\").version')\" && git add package.json"},"keywords":["eslint","typescript","standards","development","claude-code","databits","code-quality"],"author":{"name":"Databits"},"license":"MIT","dependencies":{"chalk":"^4.1.2","commander":"^11.0.0","fs-extra":"^11.1.0"},"peerDependencies":{"eslint":"^8.50.0 || ^9.0.0","@typescript-eslint/parser":"^6.0.0 || ^7.0.0 || ^8.0.0","@typescript-eslint/eslint-plugin":"^6.0.0 || ^7.0.0 || ^8.0.0","eslint-plugin-react":"^7.33.0","eslint-plugin-react-hooks":"^4.6.0 || ^5.0.0"},"peerDependenciesMeta":{"@typescript-eslint/parser":{"optional":true},"@typescript-eslint/eslint-plugin":{"optional":true},"eslint-plugin-react":{"optional":true},"eslint-plugin-react-hooks":{"optional":true}},"devDependencies":{"eslint":"^9.36.0","typescript":"^5.2.0","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0","eslint-plugin-react":"^7.33.0","eslint-plugin-react-hooks":"^5.0.0"},"repository":{"type":"git","url":"git+https://github.com/amitsaddi/databits-dev-standards.git"},"bugs":{"url":"https://github.com/amitsaddi/databits-dev-standards/issues"},"homepage":"https://github.com/amitsaddi/databits-dev-standards#readme","directories":{"doc":"docs"},"gitHead":"23546c9bd55f2cb422325ad9ab373ad6125f7079","_id":"@databits/dev-standards@1.1.0","_nodeVersion":"22.21.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-S5u37dOgOP4voUk1L+PttZ6v6GmyVdHiL7NPv5KmzZ1cxumK8ywPcoZbfDNDIr70k9dvmgfRbqsymgBqH43tgw==","shasum":"e3523e8d38d5e89572371dd64e43ddded5a8661a","tarball":"https://registry.npmjs.org/@databits/dev-standards/-/dev-standards-1.1.0.tgz","fileCount":23,"unpackedSize":118659,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDtAGWAnnXR4K4kwC8PN+OvpxL4+2f9vTqEhwN6tX+ntAiABjygtD6zXiLoyjkx6mJqMbNFFCwfogvpTApf1xWiyrQ=="}]},"_npmUser":{"name":"databits","email":"info@databits.com.au"},"maintainers":[{"name":"databits","email":"info@databits.com.au"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dev-standards_1.1.0_1761730741024_0.7977286146887999"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-29T06:28:38.359Z","modified":"2025-10-29T09:39:01.360Z","1.0.0":"2025-10-29T06:28:38.641Z","1.1.0":"2025-10-29T09:39:01.196Z"},"bugs":{"url":"https://github.com/amitsaddi/databits-dev-standards/issues"},"author":{"name":"Databits"},"license":"MIT","homepage":"https://github.com/amitsaddi/databits-dev-standards#readme","keywords":["eslint","typescript","standards","development","claude-code","databits","code-quality"],"repository":{"type":"git","url":"git+https://github.com/amitsaddi/databits-dev-standards.git"},"description":"Shared development standards, ESLint configs, TypeScript configs, and workflows for consistent code quality across all Databits projects","maintainers":[{"name":"databits","email":"info@databits.com.au"}],"readme":"# Databits Development Standards\n\nShared development standards, ESLint configs, TypeScript configs, and workflows for consistent code quality across all Databits projects.\n\n## Features\n\n- 📚 **Comprehensive Documentation** - Claude Code instructions, ESLint rules, development workflows\n- ⚙️ **Shareable Configs** - ESLint, TypeScript, and Prettier configurations\n- 🔧 **Validation Scripts** - Automated code quality and architecture checks\n- 🚀 **Easy Integration** - Simple CLI to sync standards across projects\n- 📦 **Version Control** - Semantic versioning for all standard updates\n\n## Installation\n\n```bash\nnpm install --save-dev @databits/dev-standards\n```\n\n## Quick Start\n\n### Initialize in a New Project\n\n```bash\n# Install the package\nnpm install --save-dev @databits/dev-standards\n\n# Initialize standards\nnpx databits-standards init\n\n# Or manually sync\nnpx databits-standards sync\n```\n\n### Add NPM Scripts\n\nAdd these to your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"standards:sync\": \"databits-standards sync\",\n    \"standards:update\": \"npm update @databits/dev-standards && npm run standards:sync\",\n    \"standards:check\": \"npm outdated @databits/dev-standards\",\n    \"validate\": \"./.claude/scripts/validate-code.sh\"\n  }\n}\n```\n\n## Usage\n\n### Syncing Standards\n\n```bash\n# Sync everything (docs, scripts)\nnpx databits-standards sync\n\n# Sync only documentation\nnpx databits-standards sync --docs-only\n\n# Sync only scripts\nnpx databits-standards sync --scripts-only\n\n# Force overwrite existing files\nnpx databits-standards sync --force\n```\n\n### Checking for Updates\n\n```bash\n# Check if updates are available\nnpx databits-standards update\n# Or use npm directly\nnpm outdated @databits/dev-standards\n```\n\n### Updating Standards\n\n```bash\n# Update package and sync\nnpm run standards:update\n\n# Or manually\nnpm update @databits/dev-standards\nnpx databits-standards sync\n```\n\n## Configuration\n\n### Extending ESLint Config\n\n> **Note**: This package supports both ESLint 8.x (legacy) and ESLint 9.x (flat config) formats.\n\n#### ESLint 9.x (Flat Config) - Recommended\n\nFor projects using ESLint 9.x, create `eslint.config.mjs`:\n\n```javascript\n// Basic setup\nimport baseConfig from '@databits/dev-standards/configs/eslint/base';\n\nexport default [\n  baseConfig,\n  // Your project-specific overrides\n];\n```\n\nFor TypeScript projects:\n\n```javascript\nimport baseConfig from '@databits/dev-standards/configs/eslint/base';\nimport typescriptConfig from '@databits/dev-standards/configs/eslint/typescript';\n\nexport default [\n  baseConfig,\n  typescriptConfig,\n  // Your project-specific overrides\n];\n```\n\nFor React/Next.js projects:\n\n```javascript\nimport baseConfig from '@databits/dev-standards/configs/eslint/base';\nimport typescriptConfig from '@databits/dev-standards/configs/eslint/typescript';\nimport reactConfig from '@databits/dev-standards/configs/eslint/react';\n\nexport default [\n  baseConfig,\n  typescriptConfig,\n  reactConfig,\n  // Your project-specific overrides\n];\n```\n\n#### ESLint 8.x (Legacy Config)\n\nFor projects using ESLint 8.x, create `.eslintrc.js`:\n\n```javascript\nmodule.exports = {\n  // Base JavaScript/TypeScript rules\n  extends: ['@databits/dev-standards/configs/eslint/base'],\n\n  // Project-specific overrides\n  rules: {\n    // Your custom rules here\n  },\n};\n```\n\nFor TypeScript projects:\n\n```javascript\nmodule.exports = {\n  extends: [\n    '@databits/dev-standards/configs/eslint/base',\n    '@databits/dev-standards/configs/eslint/typescript',\n  ],\n  // Project-specific overrides\n};\n```\n\nFor React/Next.js projects:\n\n```javascript\nmodule.exports = {\n  extends: [\n    '@databits/dev-standards/configs/eslint/base',\n    '@databits/dev-standards/configs/eslint/typescript',\n    '@databits/dev-standards/configs/eslint/react',\n  ],\n  // Project-specific overrides\n};\n```\n\n#### Required Peer Dependencies\n\nInstall the necessary peer dependencies based on your config:\n\n```bash\n# For TypeScript projects\nnpm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin\n\n# For React projects (in addition to above)\nnpm install --save-dev eslint-plugin-react eslint-plugin-react-hooks\n```\n\n### Extending TypeScript Config\n\nCreate `tsconfig.json` in your project:\n\n```json\n{\n  \"extends\": \"@databits/dev-standards/configs/typescript/tsconfig.base.json\",\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"./src/*\"]\n    }\n  },\n  \"include\": [\"src\"],\n  \"exclude\": [\"node_modules\", \"dist\"]\n}\n```\n\n### Using Prettier Config\n\nCreate `.prettierrc.json` in your project:\n\n```json\n\"@databits/dev-standards/configs/prettier/.prettierrc.json\"\n```\n\nOr extend it:\n\n```json\n{\n  \"extends\": \"@databits/dev-standards/configs/prettier/.prettierrc.json\",\n  \"printWidth\": 120\n}\n```\n\n## What Gets Synced\n\n### Documentation (→ `.claude/`)\n\n- `CLAUDE.md` - AI agent instructions (synced to project root)\n- `DEVELOPMENT_GUARDRAILS.md` - 4-layer enforcement system\n- `ESLINT_RULES.md` - Complete ESLint rules reference\n- `CODE_CHECKLIST.md` - Step-by-step development workflow\n- `SUB_AGENT_LINT_FIX_TEMPLATE.md` - Template for lint fix sub-agents\n\n### Scripts (→ `.claude/scripts/`)\n\n- `validate-code.sh` - Code validation script\n- `architecture-check.js` - Architecture rules checker\n\n### Configuration Files\n\n- ESLint configs (extended, not copied)\n- TypeScript configs (extended, not copied)\n- Prettier config (extended, not copied)\n\n## Validation\n\nRun validation to ensure code quality:\n\n```bash\n# Validate entire codebase\n./.claude/scripts/validate-code.sh\n\n# Validate specific files\n./.claude/scripts/validate-code.sh src/features/**/*.ts\n\n# Auto-fix ESLint issues\n./.claude/scripts/validate-code.sh --fix\n```\n\n## Development Standards\n\nThis package enforces the following standards:\n\n### TypeScript\n\n- ❌ **ZERO TOLERANCE** for `any` types\n- ❌ **ZERO TOLERANCE** for type assertions (`as`)\n- ✅ Explicit return types on all functions\n- ✅ Zod validation for all API responses\n- ✅ Type guards from `@/lib/type-guards`\n\n### Code Quality\n\n- Functions < 150 lines\n- Cyclomatic complexity < 15\n- Nesting depth < 3\n- Statements < 35 per function\n\n### Formatting\n\n- Single quotes (except to avoid escaping)\n- Semicolons required\n- Trailing commas in multiline structures\n- Strict equality (`===`)\n\n### Security\n\n- No `console.log` (use logger)\n- No hardcoded secrets in comments\n- No data leakage patterns\n\n## Project-Specific Overrides\n\nYou can override any rule in your project's config:\n\n```javascript\n// .eslintrc.js\nmodule.exports = {\n  extends: ['@databits/dev-standards/configs/eslint/base'],\n  rules: {\n    // OVERRIDE: This project needs longer functions for form handling\n    // See: docs/architecture/form-architecture.md\n    'max-lines-per-function': ['warn', { max: 200 }],\n  },\n};\n```\n\n**Important:** Always document why you're overriding a standard.\n\n## Version Updates\n\n### Semantic Versioning\n\n- **Patch** (1.2.3 → 1.2.4): Bug fixes, typo corrections\n- **Minor** (1.2.3 → 1.3.0): New rules (non-breaking), new docs\n- **Major** (1.2.3 → 2.0.0): Breaking changes, removed rules\n\n### Update Workflow\n\n```bash\n# 1. Check for updates (weekly/monthly)\nnpm run standards:check\n\n# 2. Update package\nnpm run standards:update\n\n# 3. Review changes\ngit diff .claude/\n\n# 4. Test validation\nnpm run validate\n\n# 5. Commit\ngit add .claude/ CLAUDE.md package.json package-lock.json\ngit commit -m \"chore: update dev standards to v1.3.0\"\n```\n\n## CLI Commands\n\n```bash\n# Sync standards to current project\ndatabits-standards sync [options]\n\n# Initialize standards in new project\ndatabits-standards init\n\n# Check for updates\ndatabits-standards update\n\n# Show version\ndatabits-standards --version\n\n# Show help\ndatabits-standards --help\n```\n\n### Sync Options\n\n- `--docs-only` - Only sync documentation files\n- `--scripts-only` - Only sync scripts\n- `--configs-only` - Only show config info (configs are extended)\n- `--force` - Overwrite existing files without prompting\n\n## Troubleshooting\n\n### Package Not Found\n\n```bash\n# Check registry configuration\nnpm config get registry\n\n# For GitHub Packages\nnpm config set @databits:registry https://npm.pkg.github.com\n```\n\n### Sync Overwrites Local Changes\n\n```bash\n# Use specific sync flags\nnpx databits-standards sync --docs-only\n\n# Or skip force flag (default behavior)\nnpx databits-standards sync  # Will skip existing files\n```\n\n### ESLint Config Not Working\n\nMake sure you have the required dependencies:\n\n```bash\nnpm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin\n```\n\nFor React projects:\n\n```bash\nnpm install --save-dev eslint-plugin-react eslint-plugin-react-hooks\n```\n\n## Contributing\n\nTo update these standards:\n\n1. Make changes in this repository\n2. Update version: `npm version [patch|minor|major]`\n3. Publish: `npm publish`\n4. Push tags: `git push --follow-tags`\n\nProjects will get updates on their next `npm update`.\n\n## License\n\nMIT\n\n## Support\n\n- **Issues**: https://github.com/databits/dev-standards/issues\n- **Documentation**: See `/docs` directory\n- **Team**: Contact development team lead\n\n---\n\n**Version**: 1.0.0\n**Last Updated**: 2025-01-29\n**Maintained by**: Databits Development Team\n","readmeFilename":"README.md"}