flaviostutz / monolint

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

module-required-files: Add advanced configurations #20

Open flaviostutz opened 1 year ago

flaviostutz commented 1 year ago

We already have a basic configuration like this (see #4):

{
  "rules": {
    "module-required-files": {
      "strict": false,
      "files": ["README.md", "Makefile"]
     }
  }

Let's add a more advanced configuration option for when you want to configure conditional rules for file requirements (the basic config stays the same):

{
   "rules":{
      "module-required-files":{
         "files":[
            {
               "all":[
                  "README.md",
                  "Makefile"
               ],
               "strict": false
            },
            {
               "package.json":[
                  "tsconfig.json",
                  "jest.config.js",
                  ".eslintrc.js"
               ],
               "strict": false
            },
            {
               "go.mod":[
                  "go.sum"
               ],
               "strict": true
            }
         ]
      }
   }
}