Declared best practices for TypeScript projects.
Sync your projects with the latest and greatest best practices with codemods powered by declapract.
This package contains battle-tested TypeScript best practices from the ehmpathy org, packaged for automated enforcement via codemods through declapract.
Instead of adhoc configuration of linters, formatters, test frameworks, cicd pipelines, and infrastructure for every project, this package provides:
- 40+ declared practices covering TypeScript development, testing, CI/CD, AWS infrastructure, and more
- Automated checking to verify your repo follows best practices - and avoids bad practices
- Automatic fixes for most common issues
- Project templates to bootstrap new projects with everything configured
npm install --save-dev declapractCreate declapract.use.yml in your repo:
declarations: npm:declapract-typescript-ehmpathy
useCase: typescript-project # Choose from: typescript-project, npm-package, lambda-service, lambda-service-with-rds, lambda-service-with-dynamodb, app-react-native-expo
variables:
organizationName: 'my-org'
projectName: 'my-project'
infrastructureNamespaceId: 'prod-abc123'
slackReleaseWebHook: 'https://hooks.slack.com/...'# plan all practices
declapract plan
# or scope to one
declapract plan --practice# apply all practices
declapract apply
# or scope to one
declapract apply --practiceAll projects follow the same patterns, making it easy to switch between codebases
Enforced best practices catch issues before code review
Bootstrap new projects in minutes instead of hours
Update best practices across all repos by updating one dependency
Practices are explicitly declared and versioned, serving as living documentation
This package defines complete sets of practices for common project types:
Base configuration for any TypeScript project (18 core practices)
TypeScript packages published to npm (adds CI/CD for publishing)
AWS Lambda microservices (adds AWS infrastructure, handlers, config, logging)
Lambda services with PostgreSQL database (adds RDS provisioning and DAOs)
Lambda services with DynamoDB (adds DynamoDB DAOs)
React Native mobile apps with Expo
- typescript - Strict TypeScript configuration
- lint - ESLint with TypeScript rules (airbnb-typescript)
- format - Prettier configuration
- domain - Domain-driven design with
domain-objects - directory-structure-src - Consistent project structures
- runtime-type-checking - Type-safe validation with
domain-objects - errors - Structured error handling with
helpful-errors - etc
- tests - Jest configuration for unit, integration, and acceptance tests
- conventional-commits - Enforced commit message standards
- husky - Git hooks for pre-commit validation
- etc
- cicd-common - GitHub Actions workflows for testing
- cicd-package - Publishing workflows for npm packages
- cicd-service - Deployment workflows for services
- lambda-handlers - Standard Lambda function structure
- lambda-clients - Type-safe Lambda client wrappers
- config - Environment configuration with AWS Parameter Store
- logs - Structured logging with
simple-log-methods - uuid - UUID generation standards
- etc
- terraform-common - Common Terraform patterns
- terraform-aws - AWS-specific Terraform modules
- declastruct-github - GitHub repository configuration
- environments-aws - Multi-environment setup (dev/test/prod)
- etc
- persist-with-rds - PostgreSQL with
sql-dao-generator - persist-with-dynamodb - DynamoDB DAO patterns
- app-react-native-expo - Expo app configuration
- lint-react - React-specific linting
- lint-react-native - React Native linting