Skip to content
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

Improve utils coverage #11

Conversation

eps1lon
Copy link

@eps1lon eps1lon commented Aug 31, 2020

  • stricter types (any -> unknown or better)
  • fix @ts-ignore
  • explicit return type for public modules

@eps1lon eps1lon changed the title [Link] Custom variant (#22204) Improve utils coverage Aug 31, 2020
Copy link
Owner

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for polishing it

@@ -3,13 +3,11 @@ import * as PropTypes from 'prop-types';
export default function chainPropTypes(
propType1: PropTypes.Validator<unknown>,
propType2: PropTypes.Validator<unknown>,
): PropTypes.Requireable<unknown> {
): PropTypes.Validator<unknown> {
Copy link
Owner

@oliviertassinari oliviertassinari Aug 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one, it should create an issue on

const elementAcceptingRef = chainPropTypes(PropTypes.element, acceptingRef);
elementAcceptingRef.isRequired = chainPropTypes(PropTypes.element.isRequired, acceptingRef);

but at the same time, this looks completely safe:

var foo = () => null;
foo.isRequired = () => null;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PropTypes.Requireable<unknown> means there already is a isRequred which is not true. We only assign that later.

@oliviertassinari oliviertassinari merged commit 4a699c0 into oliviertassinari:add-typescript-utils-coverage Aug 31, 2020
@eps1lon eps1lon deleted the pr/oliviertassinari/22367 branch August 31, 2020 13:16
oliviertassinari added a commit that referenced this pull request Dec 13, 2020
Move picker sources into lab (#4)

Update README.md

[DatePicker] Refactor pickers tests to testing-library and mocha (#5)

[TimePicker] Migrate tests to testing library (#8)

[DateTimePicker] Migrate tests  (#9)

Fix all pickers linter errors (#10)

Fix all circular dependencies (#11)

* Fix all circular dependencies

* Enable mocha eslint rules for typescript tests

[test] The last step to a green CI (#15)

Migrate pickers docs (#12)

Downgrade to withStyles for pickers sources (#16)

Add public api exports for pickers components (#17)

Consolidate component namespace and theme augmentation  (#18)

Describe conformance for pickers sub-components (#19)

Autogenerate proptypes for typescript sources  (mui#20)

Proper build output (mui#21)

Clear migration artifacts  (mui#23)

Eslint rule for lower-case test name convention  (mui#24)

DateRangePicker  (mui#25)

yarn deduplicate

Remove GridListTile

[DateTimePicker] Fix migration unit tests

Fix types

Fix typescript types migration issues

Fix yarn lerna build (mui#33)

Fix karma tests

use window.Touch for CI karma tests

Remove more outdated diff noise (mui#34)

Replace not valid formats with valid ISO strings

Try to fix CI touch tests

Skip tests if Touch events are not supported

Fix merge conflicts

Actually type-check

Fix safari tests

Remove lowercase test name rule

The casing is up to the test author.
We're not the grammar police in tests.

Fix lint

Format

Remove overzealous eslint-disable*

Debug failing tests

Better debugging

Timezones are fun

was isoString th efix?

Let's find out what's failing and then skip it

Branch for safari

Skip DateRangePicker in browsers

review

Matt's review

Co-authored-by: Matt <github@nospam.33m.co>

format

docs:i18n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants