-
Notifications
You must be signed in to change notification settings - Fork 3k
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
dtslint effects yet another error #4871
Comments
There's now an alternative in |
WIP waiting on feedback from @cartant before I go ahead and implement the rest re ReactiveX#4871
Hi @cartant, I've had a first crack at converting the tests over to the Would you mind taking a look and letting me know if I'm on the right track? If so I'd be happy to spend some time working through the rest of the tests. :) |
@Georift Thanks. Looks good. I was able to get dtslint to work on this MacBook by creating a You might want to hold off, before you commit too much time to the conversion. Whether or not all of the tests should be converted is something that would have to be discussed, first. Also, any conversion would have to be part of some process - I would not want to review a massive PR that converted everything. And the conversion would also need to refactor the tests to simplify them - I'd like to use helpers like these to reduce the boilerplate and increase the coverage (by not testing with just strings and numbers, etc.) And I'm not going to have to time to get involved in this until around mid-September. |
One concern with |
@cartant I also noticed all that was required was creating that in my home folder, it seems to be recording metrics about the memory usage of the linter which can be used by other packages. Unfortunately there is no mechanism to disable this. Regarding the pros & cons I'm happy to try and summarise however I'd want someone to take a second pass as I'm not as proficient with TS as JS and mightn't do it justice. Shall I do this? Or is there anything else I can do to help at this point prior to you being availiable mid-September? |
That would be appreciated.
I think refactoring the tests to use helpers - like those mentioned above - is a higher priority than switching to something other than dtslint. It's quite likely that - should we decide to switch to something else - the switching process could be automated. I'll try to write up some guidelines for what I'd like to see happen with the test and will put them into an issue. I have some notes, somewhere, that I made a few months ago. If you have a look at the way the helpers are used in #4474, it will give you some idea of what I'm talking about. |
Related: #5027 (comment) |
I just released The main problem with It took me a while to figure this out, that's why the initial PR got stale because I didn't want to go for string matching. So now we are actually comparing the types on type level. I have a test here which shows what I mean expectType<Observable<string | number> | Observable<Date> | Observable<Symbol>>(
one<Observable<Date> | Observable<Symbol> | Observable<number | string>>()
);
This assertion succeeds, which it does not in Feel free to play with it and let me know if you find issues or have ideas to improve |
@samccone Thanks. I'll check it out. I noticed this comment. When you say that expectType<string | number>(add(1, 2)); // error, as expectation is too wide
expectError<string | number>(add(1, 2)); // no error I'd be happy if that's the case. |
@cartant yes for |
@SamVerschueren Regarding |
@cartant No it's not extensible at this point. We added the things that are important to us but are definitely open to see what people need when they want to test their type definitions. We can also look in exposing some kind of plugin system. I will think about how it could look, but I would like to see first if the deprecation checks should be part of tsd itself. Which I feel is perfectly possible to add. |
Closing this, as it's resolved by #5123. I'll create another issue, at a later date, to look at switching to |
Bug Report
I've about had enough of dtslint. What was working, this morning, on the notebook I use at home is now not working on the notebook I have at the office - despite dtslint being pinned to a specific version.
It's effecting this error:
I'm inclined to abandon it in favour of a more straightforward lint-based solution.
I don't relish reinventing the wheel, but this wheel keeps falling off.
The text was updated successfully, but these errors were encountered: