Prettier Config: Add type-checking #21053
Conversation
Size Change: +13.5 kB (1%) Total Size: 883 kB
|
Filename | Size | Change | |
---|---|---|---|
build/autop/index.js |
2.59 kB | 0 B | |
build/blob/index.js |
620 B | 0 B | |
build/block-directory/style-rtl.css |
760 B | 0 B | |
build/block-directory/style.css |
760 B | 0 B | |
build/block-library/editor-rtl.css |
7.21 kB | 0 B | |
build/block-library/editor.css |
7.21 kB | 0 B | |
build/block-library/style-rtl.css |
7.5 kB | 0 B | |
build/block-library/style.css |
7.51 kB | 0 B | |
build/block-library/theme-rtl.css |
669 B | 0 B | |
build/block-library/theme.css |
671 B | 0 B | |
build/block-serialization-default-parser/index.js |
1.65 kB | 0 B | |
build/block-serialization-spec-parser/index.js |
3.1 kB | 0 B | |
build/components/index.js |
195 kB | 0 B | |
build/compose/index.js |
6.21 kB | 0 B | |
build/data/index.js |
8.23 kB | 0 B | |
build/date/index.js |
5.37 kB | 0 B | |
build/deprecated/index.js |
772 B | 0 B | |
build/dom-ready/index.js |
569 B | 0 B | |
build/dom/index.js |
3.05 kB | 0 B | |
build/edit-navigation/index.js |
2.4 kB | 0 B | |
build/edit-navigation/style-rtl.css |
95 B | 0 B | |
build/edit-navigation/style.css |
95 B | 0 B | |
build/edit-widgets/index.js |
4.43 kB | 0 B | |
build/editor/editor-styles-rtl.css |
423 B | 0 B | |
build/editor/editor-styles.css |
426 B | 0 B | |
build/element/index.js |
4.44 kB | 0 B | |
build/escape-html/index.js |
733 B | 0 B | |
build/format-library/index.js |
6.94 kB | 0 B | |
build/format-library/style-rtl.css |
502 B | 0 B | |
build/format-library/style.css |
502 B | 0 B | |
build/hooks/index.js |
1.93 kB | 0 B | |
build/html-entities/index.js |
622 B | 0 B | |
build/i18n/index.js |
3.57 kB | 0 B | |
build/is-shallow-equal/index.js |
710 B | 0 B | |
build/keycodes/index.js |
1.7 kB | 0 B | |
build/list-reusable-blocks/index.js |
2.99 kB | 0 B | |
build/list-reusable-blocks/style-rtl.css |
226 B | 0 B | |
build/list-reusable-blocks/style.css |
226 B | 0 B | |
build/notices/index.js |
1.57 kB | 0 B | |
build/nux/index.js |
3.01 kB | 0 B | |
build/nux/style-rtl.css |
616 B | 0 B | |
build/nux/style.css |
613 B | 0 B | |
build/plugins/index.js |
2.54 kB | 0 B | |
build/primitives/index.js |
1.5 kB | 0 B | |
build/priority-queue/index.js |
780 B | 0 B | |
build/redux-routine/index.js |
2.84 kB | 0 B | |
build/rich-text/index.js |
14.5 kB | 0 B | |
build/shortcode/index.js |
1.7 kB | 0 B | |
build/token-list/index.js |
1.28 kB | 0 B | |
build/url/index.js |
4.01 kB | 0 B | |
build/viewport/index.js |
1.6 kB | 0 B | |
build/warning/index.js |
1.14 kB | 0 B | |
build/wordcount/index.js |
1.17 kB | 0 B |
I assume the config file included is fine. Noting that, It’s yet another thing to take into account when creating a package. Should we introduce package scaffolding tool? |
Yeah, part of this was to just to demonstrate (even for myself) the amount of effort which would be involved as of the changes resulting from #18942. I think a scaffolding tool could be useful. I was also considering whether it could be the sort of thing where a bot would comment on a pull request where a new package is being added, which could do a few things:
In theory, a bot could even do the commits itself. |
It sounds like a plan I want to use this PR to add types for create block a scripts packages at some point in the near future |
I force pushed to the base branch (#18942) after rebasing against master to fix conflicts. |
Ah, I guess I didn't anticipate those sorts of changes in your branch would surface up so prominently in this pull request No matter, I should be able to get it resolved without much trouble. Likely just needs a rebase against your newly-rebased branch. |
I've pushed more changes to the base branch and appear to have introduced more conflicts. Sorry! It's a sign that it's time to land #18942 |
Yes
It looks bad, but I doubt there are actually any conflicts to resolve. |
Noting that I'm intentionally choosing not to include a CHANGELOG entry for this change because there isn't yet a published version of this package (i.e. it technically still qualified under the current "initial release" note). |
I neglected to include necessary changes here. Don't use this pull request as reference See #21381 |
aduth commentedMar 20, 2020
Blocked by (current base): #18942
Related: #18838
This pull request seeks to add type-checking for the
@wordpress/prettier-config
package.By virtue of #18942, it also implies that types will be output as part of package distribution, though this may or may not be a very useful package to reference.
The primary benefit of these changes is largely in verifying configuration keys and values.
It also benefits from the same sorts of thing I wrote about recently, wherein the addition of the type detail trivializes future configuration maintenance:
Finally, this pull request serves as a possible reference for the revised approach to opting in to TypeScript type-checking for a package as of #18942.
Testing Instructions:
Ensure type-checking passes: