softarc-consulting / sheriff

Lightweight Modularity for TypeScript Projects
MIT License
183 stars 14 forks source link

hostOrText.readFile is not a function #5

Closed ts-script closed 1 year ago

ts-script commented 1 year ago

Greetings!

I have a small issue after configuring sheriff. All my imports are highlighted with the following messages:

ESLINT: Deep Import (internal error): hostOrText.readFile is not a function (@softarc/sheriff/deep-import) ESLINT: Dependency Rule (internal error): hostOrText.readFile is not a function (@softarc/sheriff/dependency-rule)

My sheriff config `import { noDependencies, sameTag, SheriffConfig } from "@softarc/sheriff-core";

export const config: SheriffConfig = { version: 1, tagging: { 'src/app': { 'shell': 'app:shell', '+state': 'app:state', 'shared': { 'components': ['shared', 'type:component'], 'utils': ['shared', 'type:util'], }, 'domains/': { 'data': ['domain:', 'type:data'], 'entities': ['domain:', 'type:entity'], 'features/': { presenters: ['domain::features:', 'type:presenter'], views: ['domain::features:', 'type:view'], skeletons: ['domain::features:', 'type:skeleton'], } } } }, depRules: { 'root': ['app:shell', 'app:state', 'shared', 'domain:'], 'domain:': [sameTag, 'shared'], 'shared': 'shared', 'type:view': ['type:view', 'type:presenter', 'type:entity', 'type:data'], 'type:presenter': ['type:presenter'], 'type:data': ['type:entity'], 'type:entity': noDependencies, 'type:util': noDependencies, 'type:component': noDependencies } } `

eslint file: .. { "files": ["*.ts"], "extends": ["plugin:@softarc/sheriff/default"] }

Angular Version: 15.2.8

Do you have any idea what should be the problem here?

Thank You in advance

Cheers, Tom

rainerhahnekamp commented 1 year ago

Hi Tom,

thanks for letting us know. The root cause has been identified. It is related to https://github.com/microsoft/TypeScript/issues/51644 and happens with TypeScript >= 4.9

It will be fixed asap.

rainerhahnekamp commented 1 year ago

@ts-script fix was released in version 0.0.9. Can you give it try and let me know if it works now?

ts-script commented 1 year ago

@rainerhahnekamp Yes, the problem is solved! Thanks for your quick response