-
Notifications
You must be signed in to change notification settings - Fork 524
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
Fix compile-ts
so it catches typescript errors and add check to CI
#2094
Comments
@becca-bailey Did a little poking around. The core of the issue, from what I can tell, is that the typescript compiler doesn't include Did some toying around and a general solution I found was to change {
"compilerOptions": {
...
"declaration": true,
"emitDeclarationOnly": true
},
...
} With a general Since this is a structural change that might require review, I'm posting this comment here. If you think this is okay, I already have the repo forked and can open an PR |
@becca-bailey Or you could do it 😆 . The change isn't that crazy. Just one last note, if the solution above works, you also have to remove |
Thanks so much @matt-hernandez ! You saved me a couple hours of digging today to figure all of this out myself. Feel free to open your PR so I can check it out! |
Once we have the ts-compile script (or another check script) working as expected, I can handle any updates in CI. |
#2107 was made It required a bit more housekeeping adjustments than I expected, but the overall crux of the idea is there. I'll be on standby if you need me |
@becca-bailey I may have something! I looked over #2084 which was the issue that first raised the bug of unimplemented types. That issue specifies that a typescript project which uses Victory will only fail to compile if So I did a little experiment and set {
"compilerOptions": {
"baseUrl": ".",
"outDir": "demo/dist",
"rootDir": ".",
"module": "es6",
"target": "es5",
"jsx": "react",
"sourceMap": true,
"moduleResolution": "node",
+ "typeRoots": [
+ "./node_modules/@types"
+ ],
+ "types": ["react", "lodash"],
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"strict": true,
"suppressImplicitAnyIndexErrors": true,
"paths": {
"@packages/*": ["packages/*"]
},
- "skipLibCheck": true
+ "skipLibCheck": false
},
"include": [
"**/src/*",
"demo/ts/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
} This is a MUCH less drastic change than the one in my PR, but since I'm relatively new to Victory as a contributor, I would prefer if you showed this solution to other contributors for feedback. If it looks good and there are no anticipated side effects, than I can update my PR with this change and reverse the original ones. I'm much more in favor of something like this. Much smaller and hopefully more granular |
Sounds good, thanks @matt-hernandez! Apologies that it has taken me a bit of extra time to come back to this. I agree that the smaller change is probably better for right now. |
Changing the |
Updating my existing PR |
In
package-scripts.js
, there is anps compile-ts
command. However, this isn't currently catching TS build errors, like the one that was created by #2058. We should make sure this compile script shows us real-time TS type errors and add a TS check step to CI.Steps to reproduce:
victory/src/index.d.ts
nps compile-ts
The text was updated successfully, but these errors were encountered: