-
Notifications
You must be signed in to change notification settings - Fork 935
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
Inconsistent typescript rules between custom environment compiler and build task #8889
Comments
can you try running |
Thanks @GiladShoham I ran that and it added a few tsconfig and eslint files.
I noticed that tsconfig files were created in any directory that only contained the components with the custom node env. These tsconfig files appear to not be importing my custom tsconfig. |
I now get the correct type checking in VSCode but
|
After some more testing with a stripped back workspace I found that everything worked until I added one of my react env components that was referencing a node-env component in the types. I.e.
Defining the type explicitly mostly fixed the problems I was having. I'm not sure why this resulted in random type error in my node-env files. For now I think I have fixed this for my environment but I'd be happy to help if anyone has a similar issue. |
This issue cropped up again and I'm now certain it is having a component in an environment with a tsconfig with |
Any chance you can share your workspace? |
I've added a example here: https://github.com/sbland/bit-issue-8889 |
stdout:
|
Describe the bug
I have a custom react environment which mostly inherited from
@bitdev/react.react-env
.When I run
bit check-types
orbit compile
it has no errors but when I runbit snap -b
I get typescript errors. It appears that the check-types function is not running in strict mode but the build pipeline is.I.e. the compile pipeline doesn't enforce implicit any so the following code pases
but with the build pipeline I would get the error
error TS7006: Parameter 'foo' implicitly has an 'any' type.
The tsconfig.json looks like this:
.bit.env.ts file
Expected Behavior
bit check-types
should fail asstrict: true
is in the tsconfigSpecifications
1.6.145
v18.19.1
10.2.4
ubuntu
for harmony workspace
@bitdev/react.react-env
.The text was updated successfully, but these errors were encountered: