sheriff: Nrwl Nx project: cannot find tsconfig.json near... in sheriff.config.ts
I’ve created a demo repo to try out your new Barrel-less Module Boundaries in Nrwl Nx. But, Sheriff cannot find tsconfig.json because there is only tsconfig.base.json in the root of a Nrwl Nx repo.
This may relate to Issue 68
Error reported from inside sheriff.config.ts:
Dependency Rule (internal error): cannot find tsconfig.json near /Users/tom/Development/enterprise-angular-mono-repo-patterns-example-with-sheriff/sheriff.config.tseslint(@softarc/sheriff/dependency-rule)
Screenshot:
Example Repo:
https://github.com/tomwhite007/enterprise-angular-mono-repo-patterns-example-with-sheriff
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 18 (11 by maintainers)
Yes. Can do. Thank you.
@tomwhite007, we can do the quick fix or provide already the initial setup for a special configuration rule.
ignoresproperty to the docs.sheriff.config.ts. This process would return a different type, ensuring that linting rules do not trigger any error messages.I am open to both. Do you want to contribute a PR?
Thanks Tom, it didn’t show up in my IDE but once I ran
eslint sheriff.config.ts, it was there.The problem is that eslint usually runs against files which are not located in the root of an nx workspace. For example, when you run it against any main.ts or whatever, there is always a parent folder which has the tsconfig.json.
So I see the problem, it shouldn’t impact the lining of your projects, but we should fix it somehow. Do you have ideas?
Thanks for trying @rainerhahnekamp . I’ll dig into this and report back next week to give you all my findings at once.
I’ve created also a PR (in your repo). The issue was that you cannot use TS aliases in your
sheriff.config.ts.And then run
npx sheriff verify apps/booking/booking-mobile/src/main.ts