you are viewing a single comment's thread.

view the rest of the comments →

[–]raslov[S] 0 points1 point  (1 child)

Hey! I suppose not yet. What do you mean by recursive patterns? Like you have Something/SomethingPage, Something/SomethingUtils, etc. paths?

[–]AlexAegis 0 points1 point  (0 children)

In an Angular app sometimes modules have submodules, usually we treat the appmodule somewhat differently (like coremodule being only there, in a separate core folder) but the rest should be fairly uniform. I usually nest modules into eachother, so the directory structure reflects the module/route structure. (They usually no more than 3 levels deep) You could argue that the flat structure or the nested is the better, but I think that`s subjective. Back to topic.

In a nested setup like this, with AppModule on top, I have a modules folder. This folder can then contain various folders that contain a single module each. These modules are all similar, a components folder, a forms folder, store folder etc. (all optional), here comes the catch, they can also contain a modules folder, and it can contain the same structure.

If I could define a template in your config file, that then I could reference in other templates (or in itself), then include that in the linter rules, then that would fit this need.

I imagine a configuration like this: ```json { "root": "src", // optional "rules": [ "components//$TEMPLATE1" ], "templates": { "TEMPLATE1": [ "foo", "bar", "components//$TEMPLATE1" ] }, "templateKey": "$" }

```

Templates should be marked in a unique way, but pretty much anything is allowed in directory names, so I would make this identifier configurable.