mrseanryan / tslint-folders

:file_folder: Use tslint to check for invalid imports between packages and folders in your TypeScript project. Automatic validation and documentation of package architecture.
MIT License
9 stars 1 forks source link

Multicomponent path from tsconfig.json #26

Closed WiseBird closed 3 years ago

WiseBird commented 4 years ago

/ in tsconfig mapping is not supported.

    // tsconfig.json
    "paths": {
      "test/dal/*": [
        "./src/dal/*"
      ]
    },
    // tslint.json
    "packages": [
      {
        "importPath": "interfaces",
        "allowedToImport": [],
        "subFolders": []
      },
      {
        "importPath": "test/dal",
        "allowedToImport": ["interfaces"],
        "subFolders": []
      }
    ]
    // ts file
    import {Dto} from 'test/dal/dto'; // no error

Sample repository

First part of the mapping is used to distinguish imports from the application itself. Also @ is often used, e.g.

    "paths": {
      "@app/dal/*": [
        "./src/dal/*"
      ]
    },
mrseanryan commented 4 years ago

Thanks for logging it!

mrseanryan commented 3 years ago

:tada: This issue has been resolved in version 4.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: