Closed qmg-akara closed 1 year ago
Gah! I really need to find a way to prevent my editor from using aliased imports, and investigate if this can be easily added to our CI to fail a build.
I'll get a patch out ASAP.
(also, thank you for the kind words)
Thanks for the quick fix!
You're welcome
The problem is that if you're using aliases or a baseurl typescript doesn't convert the import paths on compilation, and as far as I know you can't make it convert them (unless you compile with something like babel or webpack as a post processing step)
I really need to find a way to prevent my editor from using aliased import
I don't remember which editor you use, but in VS Code this is under TypeScript › Preferences: Import Module Specifier.
Not using baseUrl
at all is another solution, of course. It probably shouldn't be set in a library anyway.
I guess this isn't picked up at test time because ts-jest just runs the typescript :/
I don't remember which editor you use, but in VS Code this is under TypeScript › Preferences: Import Module Specifier.
Ah yes, thanks - I've made that change now.
Not using baseUrl at all is another solution, of course. It probably shouldn't be set in a library anyway.
Removing this makes it a compilation error, which I think is what we want (I added that change in yesterday, and found two more imports). Thanks for the tips everyone.
I read the docs for that option after my comment last night, and it is there in typescript as a convenience for systems that use a different import structure or have a post processing step that moves files around. So we shouldn’t have had it set anyway. Probably my fault, sorry!
Hi guys, thanks for the great work!
We just upgraded to version 10.2.0 but our
yarn lint
is failing due to 2 import paths:Are aliased import paths typo or intentional?
Software versions
Please provide at least OS and version of pact-js
18
Issue Checklist
Please confirm the following:
Expected behaviour
No linting error
Actual behaviour
Getting the above errors
Steps to reproduce
It can be tested with a fresh install
Relevant log files
See above