3x071c
3x071c

Reputation: 1016

Syncing linting and configuration files between git repositories

I'm trying to keep my root configuration files (.editorconfig, .prettierrc.js, .eslintrc.js, release.config.js, .browserslistrc, ...) synced between multiple repos (10 at the moment). I considered switching to a monorepo architecture as this would also bring other benefits with it, but tooling still remains insufficient.
Is it possible to write a GitHub Action that automatically pushes changes to any of these files in one repo to all the others? I've heard a post-commit hook is what I'm looking for. Is this a scalable approach? (e.g. will this behave reliably with 20, 30 synced repos?) Are there any resources on how such a script should be written?
Is there another way I can keep my configuration files synced? I want to enforce the same branching model, linting and testing rules across all my repositories.

Upvotes: 3

Views: 659

Answers (1)

Mike Parkhill
Mike Parkhill

Reputation: 5551

I haven't actually implemented this but creating an npm package of your common js configs/rules could work. Each repo would then need to import that package.

extends: '@yourDomain/lint-rules'

Upvotes: 2

Related Questions