diff --git a/tslint.json b/tslint.json index 4c945e3b16..4a9ffe21bb 100644 --- a/tslint.json +++ b/tslint.json @@ -333,7 +333,7 @@ "from": "lodash.*" }, { - "import": "^(?!(range|uniq|memoize|once|groupBy|countBy|flatten|isEqual|intersection|omit)$).*", + "import": "^(?!(range|uniq|memoize|once|groupBy|countBy|flatten|isEqual|intersection|omit|pick)$).*", "from": "lodash.*" }, { @@ -368,6 +368,11 @@ "filePattern": "^((?!(module|spec)\\.ts).)*$", "message": "Imports from (other) extensions are not allowed here." }, + { + "from": ".*/projects/.*", + "filePattern": "^((?!(module|spec)\\.ts).)*$", + "message": "Imports from (other) projects are not allowed here." + }, { "from": ".*/pages/[a-z][a-z0-9-]+/.*", "filePattern": "^((?!(cypress|\\.module\\.ts$)).)*$", @@ -376,8 +381,8 @@ { "import": "^SharedModule$", "from": "\\..*", - "filePattern": "^(?!.+(page|extensions/[a-z][a-z0-9-]+/[a-z][a-z0-9-]+\\.module)).+\\.module\\.ts$", - "message": "SharedModule must only be imported in page or extension modules." + "filePattern": "^(?!.+(page|extensions/[a-z][a-z0-9-]+/[a-z][a-z0-9-]+\\.module|projects/[a-z][a-z0-9-]+/src/app/[a-z][a-z0-9-]+\\.module)).+\\.module\\.ts$", + "message": "SharedModule must only be imported in page, extension or project modules." }, { "import": "pluck", @@ -509,19 +514,19 @@ "^.*/src/app/core/routing/([a-z0-9-]+)/\\1\\.route\\.ts", "^.*/src/app/core/routing/([a-z0-9-]+)/\\1\\-route\\.pipe\\.ts", // extra artifacts - "^.*/src/app/(core|extensions/[a-z][a-z0-9-]+)/(service)s/([a-z][a-z0-9-]+)/\\3(\\-[a-z0-9-]+|)\\.\\2[a-z0-9-\\.]*\\.ts", - "^.*/src/app/(core|extensions/[a-z][a-z0-9-]+)/(interceptor|guard|directive|pipe)s/[a-z][a-z0-9-]+.\\2\\.ts", + "^.*(/src/app/core|/src/app/extensions/[a-z][a-z0-9-]+|projects/[a-z][a-z0-9-]+/src/app)/(service)s/([a-z][a-z0-9-]+)/\\3(\\-[a-z0-9-]+|)\\.\\2[a-z0-9-\\.]*\\.ts", + "^.*(/src/app/core|/src/app/extensions/[a-z][a-z0-9-]+|projects/[a-z][a-z0-9-]+/src/app)/(interceptor|guard|directive|pipe)s/[a-z][a-z0-9-]+.\\2\\.ts", // models - "^.*/src/app/(core|extensions/[a-z][a-z0-9-]+)/models/([a-z][a-z0-9-]+)/\\2\\.(pipe|helper|interface|mapper|types)\\.ts$", + "^.*(/src/app/core|/src/app/extensions/[a-z][a-z0-9-]+|projects/[a-z][a-z0-9-]+/src/app)/models/([a-z][a-z0-9-]+)/\\2\\.(pipe|helper|interface|mapper|types)\\.ts$", // cms "^.*/src/app/shared/cms/sfe-adapter/.*\\.ts$", // facades - "^.*/src/app/(core|extensions/[a-z][a-z0-9-]+)/facades/(index|[a-z][a-z0-9-]+\\.facade)\\.ts$", + "^.*(/src/app/core|/src/app/extensions/[a-z][a-z0-9-]+|projects/[a-z][a-z0-9-]+/src/app)/facades/(index|[a-z][a-z0-9-]+\\.facade)\\.ts$", // ngrx - "^.*/src/app/.*/store/([a-z][a-z0-9-]+/|)([a-z][a-z0-9-]+)/\\2(\\-[a-z][a-z0-9-]+|)\\.(action|effects|reducer|selectors)\\.ts", - "^.*/src/app/.*/store/([a-z][a-z0-9-]+/|)([a-z][a-z0-9-]+)/index\\.ts", - "^.*/src/app/.*/store/([a-z][a-z0-9-]+)/\\1-store(\\.module|)\\.ts", - "^.*/([a-z][a-z0-9-]+)/store/\\1-store(\\.module|)\\.ts", + "^.*/store/([a-z][a-z0-9-]+/|)([a-z][a-z0-9-]+)/\\2(\\-[a-z][a-z0-9-]+|)\\.(actions|effects|reducer|selectors)\\.ts", + "^.*/store/([a-z][a-z0-9-]+/|)([a-z][a-z0-9-]+)/index\\.ts", + "^.*/store/([a-z][a-z0-9-]+)/\\1-store(\\.module|)\\.ts", + "^.*/([a-z][a-z0-9-]+)(/src/app|)/store/\\1-store(\\.module|)\\.ts", // ngrx router-store "^.*/src/app/core/store/router/router\\.(operators|serializer)\\.ts", // allow only app related content directly in src/app @@ -530,9 +535,10 @@ "^.*/src/app/shell/(header|footer)/([a-z][a-z0-9-]+)/\\2\\.component\\.ts$", "^.*/src/app/shell/[a-z][a-z0-9-]+/configurations/.*\\.ts$", // specific (lazy loaded) page modules - "^.*/src/app/(|extensions/[a-z][a-z0-9-]+/)pages/([a-z][a-z0-9-]+)/\\2-page\\.(module|component)\\.ts$", - "^.*/src/app/(|extensions/[a-z][a-z0-9-]+/)pages/[a-z][a-z0-9-]+/([a-z][a-z0-9-]+)/\\2\\.component\\.ts$", + "^.*(/src/app|/src/app/extensions/[a-z][a-z0-9-]+|projects/[a-z][a-z0-9-]+/src/app)/pages/([a-z][a-z0-9-]+)/\\2-page\\.(module|component)\\.ts$", + "^.*(/src/app|/src/app/extensions/[a-z][a-z0-9-]+|projects/[a-z][a-z0-9-]+/src/app)/pages/[a-z][a-z0-9-]+/([a-z][a-z0-9-]+)/\\2\\.component\\.ts$", "^.*/src/app/extensions/([a-z][a-z0-9-]+)/pages/\\1-routing\\.module\\.ts$", + "^.*/projects/([a-z][a-z0-9-]+)/src/app/pages/\\1-routing\\.module\\.ts$", "^.*/src/app/pages/app[a-z0-9-]*-routing\\.module\\.ts$", // enforce folder structure for shared components "^.*/src/app/extensions/[a-z][a-z0-9-]+/shared/[a-z][a-z0-9-]+/([a-z][a-z0-9-]+)/\\1\\.component\\.ts$", @@ -544,6 +550,7 @@ // aggregation modules "^.*/src/app/(shell|shared)/\\1\\.module\\.ts$", "^.*/src/app/extensions/([a-z][a-z0-9-]+)/\\1\\.module\\.ts$", + "^.*/projects/([a-z][a-z0-9-]+)/src/app/\\1\\.module\\.ts$", // extension exports "^.*/src/app/extensions/[a-z][a-z0-9-]+/exports/[a-z][a-z0-9-]+/(lazy-[a-z][a-z0-9-]+)/\\1\\.component\\.ts$", "^.*/src/app/extensions/([a-z][a-z0-9-]+)/exports/\\1-exports\\.module\\.ts$" @@ -645,7 +652,7 @@ }, { "name": "^(.*)Module$", - "file": ".*(cypress.*|//|/core/[a-z][a-z0-9-]+)\\.module\\.ts$" + "file": ".*(cypress.*|//|/projects//src/app/|/core/[a-z][a-z0-9-]+)\\.module\\.ts$" }, { "name": "^(.*)Routes$", @@ -671,7 +678,7 @@ // facades { "name": "^([A-Z].*)Facade$", - "file": ".*/app/(core|extensions/[a-z][a-z0-9-]+)/facades/\\.facade\\.ts$" + "file": ".*(/src/app/core|/src/app/extensions/[a-z][a-z0-9-]+|/projects/[a-z][a-z0-9-]+/src/app)/facades/\\.facade\\.ts$" }, // ngrx {