Skip to content

Module Boundaries #248

@LavanyaBurlagadda

Description

@LavanyaBurlagadda

Currently, I am doing a POC with NX along with module boundaries. all the projects are react projects

When I am doing I have a use case that no imports should happen between projects. How can we stop developers from importing those files?

In the root .eslintrc.json file I gave the below code, here main is able to load files even from other libs which I haven't listed. It is not showing any errors

 "@nrwl/nx/enforce-module-boundaries": [
          "error",
          {
            "enforceBuildableLibDependency": true,
            "allow": [],
            "depConstraints": [
              {
                "sourceTag": "scope:main",
                "onlyDependOnLibsWithTags": ["scope:shared-data-access"]
              },
              {
                "sourceTag": "scope:discussions",
                "onlyDependOnLibsWithTags": ["scope:shared-data-access"]
              },
              {
                "sourceTag": "scope:sub-app-mf",
                "onlyDependOnLibsWithTags": ["scope:shared-data-access"]
              },
              {
                "sourceTag": "scope:shared-data-access",
                "onlyDependOnLibsWithTags": ["scope:shared-data-access"]
              }
            ]
          }]

Is there an example referring to all the above cases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions