-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fail the build if we have type errors (and fix/ignore remaining errors) #1723
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
eceaf30
to
53483ba
Compare
53483ba
to
a671b34
Compare
typescript: { | ||
// !! WARN !! | ||
// Dangerously allow production builds to successfully complete even if | ||
// your project has type errors. | ||
// !! WARN !! | ||
ignoreBuildErrors: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋
GBPTM Run #1338
Run Properties:
|
Project |
GBPTM
|
Branch Review |
refs/pull/1723/merge
|
Run status |
Passed #1338
|
Run duration | 01m 48s |
Commit |
01b970835a ℹ️: Merge 79ea338a8cf063ab5c2048ed7335563f7311da04 into 6376c1f1bac919ad083124646c3e...
|
Committer | Oliver Barnwell |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
63
|
View all changes introduced in this branch ↗︎ |
558b872
to
7c7fea8
Compare
ssr: false, | ||
}); | ||
|
||
const LooMap = (props: LooMapProps) => { | ||
const LooMap = (props?: Partial<LooMapProps>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all LooMapProps
are required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But are they all optional? Optional props run the risk of adding more confusion as they make things less explicit…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case they are, they’re optional on top of the defaults that we provide
"exclude": [ | ||
"node_modules", | ||
"src/@types/resolvers-types.ts", | ||
"scripts/areaToDatabase/*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
areaToDatabase
is an archive of old js code which we will eventually re-write so we have the ability to populate our areas table from scratch again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we exclude it for now as it won't pass the type checker
7c7fea8
to
0be8830
Compare
0be8830
to
d16a038
Compare
d16a038
to
fe41cec
Compare
add autogen files back to the linter ignore
0414463
to
79ea338
Compare
const getIconAnchor = (dimensions: number[]) => [ | ||
dimensions[0] / 2, | ||
dimensions[1], | ||
const ICON_DIMENSIONS: [number, number] = [22, 34] as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is widened to the number double. For as const
to work it must be paired with satisfies
.
https://chrisvaillancourt.io/posts/combining-typescript-satisfies-and-const-assertion/
if (this.options[option]) { | ||
style = style + `${property}: ${this.options[option]};`; | ||
const value = this.options[option as keyof LocationMarkerOptions]; | ||
if (value !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the value is numeric? Should we add a px
suffix to make it a valid CSS length?
|
||
// Remove htmlElement from props | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const { htmlElement, ...rest } = props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this would make the linter happier? Underscores are understood to be unused variables…
const { htmlElement, ...rest } = props; | |
const { htmlElement: _, ...rest } = props; |
Thanks for all the detailed comments @mxdvl — I'm going to merge this as-is and open follow-up PRs over time to continue to improve types & quality of migrated files in the project. I think just having our build step fail on type errors now will be super valuable and is something we've not turned on since we started the migration from js->ts back in '21-'22 |
What does this change?
ignoreBuildErrors
in Next to complete our migration from CRAresolves #1366