-
Notifications
You must be signed in to change notification settings - Fork 3
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
misc edits #13
misc edits #13
Changes from all commits
a4234e0
1680235
efd20ae
9bc9613
1ae10d0
77411da
ed96cc0
be8019a
8439093
3810735
8894b3c
c64000c
2680172
94c0cf2
8f20488
7016983
80f4ca2
724b67b
4708550
e0ba655
22e340e
a8bedf2
0f1eaa1
6121f0a
effc3d8
bd225a8
c83ea29
9069d3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,13 @@ | |
"name": "typings-checker", | ||
"version": "1.1.0", | ||
"description": "Positive and negative assertions about TypeScript types and errors", | ||
"main": "src/index.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prepublish": "tsc", | ||
"test": "./update-tests.sh" | ||
}, | ||
"bin": { | ||
"typings-checker": "src/index.js" | ||
"typings-checker": "dist/index.js" | ||
}, | ||
"author": "Dan Vanderkam (danvdk@gmail.com)", | ||
"license": "ISC", | ||
|
@@ -21,12 +22,16 @@ | |
"@types/lodash": "^4.14.47", | ||
"@types/mocha": "^2.2.36", | ||
"@types/node": "^7.0.0", | ||
"@types/yargs": "^6.5.0", | ||
"chai": "^3.5.0", | ||
"mocha": "^3.2.0", | ||
"ts-node": "^2.0.0" | ||
"ts-node": "^2.0.0", | ||
"typescript": "^2.1.4" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We import symbols from typescript, so it doesn't make sense for it to be a devDependency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intention: ensuring users would not be locked in to a specific TS version (peer dependency). Evidently it would still be needed at run-time though. This was my idea of addressing that. |
||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.4", | ||
"typescript": "^2.1.4" | ||
"lodash": "^4.17.4" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "2.x" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the effect of this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Peer dependency: see above. |
||
} | ||
} |
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.
Can you explain the use case for this a little more? I'd expect most users of typings-checker would just care about the exit code. As an analogy, the
tsc
command doesn't have an option to suppress line numbers. Ideally we'd just have a single output format that's good for everyone.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 line numbers are good info -- either way you'll wanna know what code just broke.
The thing here was, like TS and like you, I'm storing the output in git so as to be able to see the diffs.
The issue I wanted to solve here was, if that output log in git contains the line numbers, once you add/remove a line near the start (or whatever), all the line numbers would change, and your diff log would be clogged with a lot of noise (one line per type check), which could crowd out the useful info.
The alternative, showing code snippets, could also change of course, though at least not as easily in all places at once. That's why I added those two options.
Perhaps alternatively it might work to separate things such that info printed to the user and info printed to the diff log would differ here, maybe using
stdout
vs.stderr
.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.
My inclination would be to just leave both of these options out. If you want to filter out line numbers, you can do it with a bash one-liner:
But I still don't totally understand the use case. Wouldn't you always want zero assertion failures, just like you wouldn't want to commit code that doesn't compile?
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.
Filtering out the line numbers that way seems like an interesting alternative to me. It hadn't occurred to me, though I suppose I'd felt the option might help people in a similar situation -- which I hope wouldn't be many. Including the code fragments was just a way to make it useful even without line numbers.
Zero assertion failures sounds wonderful to me. I do want that, but that's not where we are for ramda right now; there are quite some blocking issues preventing me from reaching that point even if I wanted to: erased generics, lack of support for heterogeneous
map()
, lack of type-level support forreduce()
, quite possibly support for higher-kinded types, not to mention whatever other features this list might depend on, aside from just finding the time to figure out every single step between here and proper type inference.I mean, TypeScript has 1,800+ outstanding issues at the moment, so in that sense, I fear it's no surprise to find that not everything is quite perfect yet. FP libraries are probably among the harder ones to type, but I'm probably also being more ambitious than e.g. the lodash typings -- if I map over an object, I'd like for my IDE to know both the (distinct) types and keys of each value. Settling for vague types is an easy way to pass all tests (as you noted), but in a sense feels to me like it beats the point of doing a typings library.
To me this was also the reason to commit and diff the output, like you were. Up to now I had no idea if an edit would break inference and turned everything into
any
. With your library, now I do. But I need to be able to answer bigger questions than that; notably: given my current assertion failures (whetherany
or errors), would switching to an experimental branch make that overall situation better or worse?I also hope I can get to the point of having the luxury to get things fixed. And I'm about to find out more about that -- knowing what's good or bad now, I can finally start seeing more about that.