-
Notifications
You must be signed in to change notification settings - Fork 440
Type the result property on IDBRequest #530
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
Conversation
src/emitter.ts
Outdated
if (!typeParameters) return i.name; | ||
if (!typeParameters.length) return i.name; | ||
|
||
return `${i.name}<${typeParameters.map(t => t.replace(/\s+=.*$/, ''))}>`; |
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.
i would rather we have two separate properties, one for the name of the type parameter, and one for the default.
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.
Sounds good 👍
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.
@mhegazy what do you think about this?
"type-parameters"?: { name: string, default?: string }[]
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.
sounds good.
//CC @saschanaz |
|
src/test.ts
Outdated
|
||
const __SOURCE_DIRECTORY__ = __dirname; | ||
const baselineFolder = path.join(__SOURCE_DIRECTORY__, "../", "baselines"); | ||
const outputFolder = path.join(__SOURCE_DIRECTORY__, "../", "generated"); | ||
const tscPath = path.join(__SOURCE_DIRECTORY__, "../", "node_modules", "typescript", "lib", "tsc.js"); | ||
|
||
function normalizeLineEndings(text: string): string { | ||
return text.replace(/\r\n?/g, "\n"); | ||
return text.replace(/\r\n?/g, "\n").replace(/\n*$/, "\n"); |
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 sure why this is needed, does \n\n$
thing happen?
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.
The files in git doesn’t have a trailing newline at all, but my editor (VS Code) adds one when I open the file. Thus I always got a diff.
This can of course be turned off in my editor, but I thought it was common enough so that it would help to ignore it. I think Atom is also adding trailing newline by default.
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.
AFAIK VSCode adds a newline when you save the file.
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.
Yeah, sorry, saved is correct. The workflow I've been using is to first modify the baseline files to be what I want, and then work with the json files to get that result. That's when I ran into the problem, since I had saved a new baseline file.
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.
Um... You probably will want to try npm run build && npm run baseline-accept 😁
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.
Hehe, yeah, although I wasn't familiar with how the JSON files worked. So it was actually a quite nice workflow for me, since I could set up my target and then work towards that :)
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.
Personally still don't like this, how about adding a trailing newline through emitter.ts rather than ignoring it?
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.
Works for me, I was actually close to doing that instead, as it's actually required for the Unix definition of a text file 😄 ref
Pushing a fix now 🙌
@saschanaz can i get a sign off? |
|
microsoft/TypeScript#25547