Closed FelixSchuSi closed 4 years ago
I think using the string "Infinity" could become a bit inconvenient. What do you think about using -1
instead of "Infinity"?
I actually really like the description you made for the configs :-)
Here are some thoughts about the naming of the configs:
maxNodeModuleJsDepth
: The maximum dependency depth to search under node_modules and load JavaScript files.max-depth
: Enforce a maximum depth that blocks can be nestedHere are some suggestions (unordered list) of what it could be called. What do you think?
maxExternalImportDepth
& maxInternalImportDepth
maxExternalDependencyDepth
& maxInternalDependencyDepth
maxNodeModuleImportDepth
& maxProjectImportDepth
moduleImportDepthInternal
& moduleImportDepthExternal
When you add documentation you will need to:
./docs/readme/config-table.md
npm run readme
npm run prettier:write
Thanks for the feedback!
Using -1
instead of "Infinity"
is definitely a nicer way, I will change that soon!
For the names of the configs i found maxNodeModuleImportDepth
& maxProjectImportDepth
to be my favourite.
I think that "NodeModule"
and "Project"
are a bit more intuitive than "internal"
and "external"
.
I also like them. Let's go with those two then!
It looks great now, - I'll merge this in a couple of hours!
I made maxInternalDepth and maxExternalDepth configurable. The values can now be set under the name "moduleTraversalDepthInternal" and "moduleTraversalDepthExternal" via CLI argument, tsconfig or VSCode setting.
The default values stayed the same ("moduleTraversalDepthInternal" defaults to Infinity and "moduleTraversalDepthExternal" defaults to one).
Handling the value Infinity in JSON is tricky since it is not supported by the JSON format. I decided to allow string values and cast them to number when loading the config, so that the value Infinity can be represented with the string "Infinity".
I am not completely satisfied with the variable names and the descriptions. Please tell me what you think about them. Once we have agreed on the variable names I will add documentation.