flaviostutz / monolint

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

Create rule "module-same-contents" #8

Closed flaviostutz closed 1 year ago

flaviostutz commented 1 year ago

Checks if specified files have the same content in all the modules, when they exist. For example, if enabled for file "tsconfig.json", all modules that have this file have to have the same contents.

{
  "rules": {
    "module-same-contents": true
  }
}
{
  "rules": {
    "module-same-contents": {
       "reference-module":"todo-svc",
       "files": {
            "test/abracadabra.txt": {
              "min-similarity": 50
            },
            "tsconfig.json": { 
              "min-similarity": 50
            },
            "package.json": {
              "selector": ["/engines","/license","/scripts/lint"]
            }
            "serverless.yml": {
              "selector": ["/useDotenv","/provider/runtime"]
            }
       }
    }
  }
}
flaviostutz commented 1 year ago

Ideas: