You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was going to entitle this issue 'Unexpected lint errors when sheriff.config.ts is incorrect', but having retested, I can see these errors are intended but they are difficult for a developer to intuit when the problem causing them is configuration errors.
The problem:
When a new app or lib is created in Nx, Sheriff deems its module to be root...
1: If I have no root rule in sheriff.config, I get errors on standard npm imports, e.g.
I realise now that the docs say the root rule is required. I had tried to remove the root rule - to enforce strict import rules with no fall-through like @nx/enforce-module-boundaries in this old example here.
2: Assuming I have added a root: 'noTag' rule but then fail to create a module path correctly for my new app or lib, I get a root error as follows
Suggested solution
Both points 1 and 2 above are difficult to infer that the problem is created by the developer in the sheriff.config.ts file.
Following a conversation with @rainerhahnekamp in this thread: #161 (comment) , I believe both issues could be solved by adding lint rules to the sheriff.config.ts.
Note:
I've created this issue to separate it from #161 for your consideration so you can choose to close each separately.
The text was updated successfully, but these errors were encountered:
I was going to entitle this issue 'Unexpected lint errors when
sheriff.config.ts
is incorrect', but having retested, I can see these errors are intended but they are difficult for a developer to intuit when the problem causing them is configuration errors.The problem:
When a new app or lib is created in Nx, Sheriff deems its module to be
root
...1: If I have no
root
rule insheriff.config
, I get errors on standard npm imports, e.g.I realise now that the docs say the
root
rule is required. I had tried to remove the root rule - to enforce strict import rules with no fall-through like@nx/enforce-module-boundaries
in this old example here.2: Assuming I have added a
root: 'noTag'
rule but then fail to create a module path correctly for my new app or lib, I get aroot
error as followsSuggested solution
Both points 1 and 2 above are difficult to infer that the problem is created by the developer in the
sheriff.config.ts
file.Following a conversation with @rainerhahnekamp in this thread: #161 (comment) , I believe both issues could be solved by adding lint rules to the
sheriff.config.ts
.Note:
I've created this issue to separate it from #161 for your consideration so you can choose to close each separately.
The text was updated successfully, but these errors were encountered: