Development & Contributing
This section describes how the package @mohammad_obed/config is built, how to contribute, and how to extend it safely.
1. Cloning and setup
Clone the repo and install dependencies:
git clone <your-repo-url>
cd config
npm install
2. Project structure
The package is designed to be minimal and centralized.
Key files include:
eslint.config.ts— shared ESLint configurationprettier.config.js— shared Prettier configurationtsconfig.base.json— base TypeScript configurationvscode.settings.json— VS Code workspace settingsbin/— small CLI helpers (moc-lint,moc-check-types)tsup.config.js— build configuration for packaging
3. Making changes
When modifying configs:
- TypeScript: Edit
tsconfig.base.jsononly for rules that should apply globally. Projects can extend it in their owntsconfig.jsonif needed. - ESLint: Add or adjust rules in
eslint.config.ts. Keep them general and framework-agnostic. - Prettier: Update
prettier.config.jsfor formatting rules. Ensure consistency across all supported projects. - VS Code: Edit
vscode.settings.jsononly for defaults that should be consistent across all projects. - CLI Helpers: Add commands in
bin/for common tasks like linting and type-checking. - Build Config: Modify
tsup.config.jsif you need to change how the package is built or published. package.json— update dependencies, scripts, and versioning as needed.
4. Testing changes
After making edits:
-
Run the local CLI helpers to verify everything still works:
npx moc-lint
npx moc-check-types -
In VS Code, verify with:
- TypeScript:
Ctrl+Shift+P → TypeScript: Restart TS Server - ESLint:
Ctrl+Shift+P → ESLint: Restart ESLint Server - General:
Ctrl+Shift+P → Developer: Reload Window
- TypeScript:
5. Versioning and publishing
When ready to publish a new version:
- Update version in
package.json. - run
npm installto update version inpackage-lock.json. - Commit changes.
- Run:
npm publish --access public
This makes the new version available on npm.
6. Contribution guidelines
- Keep configs minimal and consistent.
- Avoid project-specific rules — those should be extended in consuming apps.
- Always test Prettier, ESLint, and TypeScript in a sample project before publishing.
- Document changes in
CHANGELOG.md.