Closed lue-bird closed 2 years ago
Can you give some examples of what you'd do with this, or wish to do? I'm not sure I see what scenarios this enables that isInSourceDirectories
can't already help with.
Seeing whether you are in the default src
directory or in a private package/name
directory or in a test
directory or in a generated
directory, etc.
Concrete example: I'm building a rule that should be able to not allow any file from within a package directory to import from outside of it
I recently added withFilePath
(in master
, not published yet), which gives you the relative path from elm.json
.
Would that suit your need?
very neat! :tada: Looks perfect
This has been released in v2.8.0.
isInSourceDirectories only seems useful to check whether it's a test or not. More useful would be
Allowing functionality similar to for example
filterErrorsForFiles
– checking the directory origin while still building the review rule to treat modules differently based on directory