Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostOrText.readFile is not a function #5

Closed
ts-script opened this issue May 3, 2023 · 3 comments
Closed

hostOrText.readFile is not a function #5

ts-script opened this issue May 3, 2023 · 3 comments

Comments

@ts-script
Copy link

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
Copy link
Collaborator

Hi Tom,

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

It will be fixed asap.

rainerhahnekamp added a commit that referenced this issue May 3, 2023
In the traverse-filesystem, we use now the real
ts.sys for the resolution of filenames.

In the past, we created a proxy ts.sys that
only implemented readFile of ts.sys and was
a hacky approach.

If the virtualFs is enabled though,
we still go with the "hacked
version". This happens only in the
tests though.
@rainerhahnekamp
Copy link
Collaborator

@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
Copy link
Author

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

vmarc added a commit to vmarc/knooppuntnet that referenced this issue May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants