flaviostutz / monolint

Linter for monorepos. Checks folder structure, module contents, file contents and naming conventions
MIT License
7 stars 4 forks source link
lint

Monolint

npm

This is a Poppins project first-timers-only

Linter for monorepos. Checks folder structure, module contents, file contents and naming conventions of a monorepo.

This tool will look for modules inside the repo (which are folders with a certain "marker file", like package.json). After discovering the module folders, it will run a set a rules to check if the modules are well structured and show the results.

Some example of the rules are: check if all modules are inside a certain folder, check if module names comply to a specific naming convention, check if certain file between modules have the same contents, check if github actions workflow name contains the name of the corresponding module...

This is a friendly project for first-time contributors and open source beginners

This project follows the Poppins manifesto guidelines as part of it's community principles and policies, focusing all the decisions and interactions on providing open source beginners mentorship with real and relevant experiences, respecting each learning pace, background experience, academic formation, questions, suggestions, doubts and opinion.

Contribute now!

So, let's start contributing! Open an issue asking for a task to be done by you. A mentor/maintainer will come and provide a technical overview of the project and what are the possibles ways of contributing to the project. You will discuss the options and a suitable issue will be assigned or created to you.

Monolint was implemented in an extensible way for creating more and more rules as needed, so if you new a new feature, contribute to our project! Read CONTRIBUTING.md for more details.

If you work or know a good public monorepo, please let us now so we can use it as a reference test for this tool!

Check rules documentation here

Usage

{
  "module-markers": ["package.json"],
  "rules": {
    "packagejson-same-name": false
  }
}

Show command line help: npx monolint --help

Concepts

.monolint.json

{
  "extends": ["monolint:basic", "monolint:serverless"]
  "module-markers": ["package.json"],
  "use-gitignore": true,
  "rules": {
    "packagejson-same-name": true
  }
}

.monolintignore

modules/
  ⌞ auth-svc/
  ⌞ todo-web/
shared/
  ⌞ utils/
lib/test/external/
  ⌞ legacy
  ⌞ platform
.monolintignore
**/legacy
modules/auth-svc
shared
modules/
  ⌞ todo-web/
lib/test/external/
  ⌞ platform

Rules

Each check that you want to do in the monorepo is done by a "rule". You can enable/disable/configure then in .monolint.json configuration file.

Check rules documentation here

Awesome list of other Poppins projects for you to go

Awesome