Conversation
|
Size Change: -3 B (0%) Total Size: 889 kB
ℹ️ View Unchanged
|
packages/element/tsconfig.json
Outdated
There was a problem hiding this comment.
Removing these lines:
noImplicitAny-> 51 errorsstrictNullChecks-> 7 errors- both -> 60 errors
ca897c8 to
c3549e2
Compare
7088eae to
d3fe07e
Compare
|
Rebased and removed commits from #20669 which has been merged. |
Allow function or class components, rather than just class components.
Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com>
Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com>
06b1bf9 to
8bed5cf
Compare
|
Rebased to fix conflict. Would it be possible to move forward with this? Many packages depend on |
| * @return {WPComponent} Dangerously-rendering component. | ||
| * @return {JSX.Element} Dangerously-rendering component. |
There was a problem hiding this comment.
I wondered how this worked.
Turns out it doesn't:
[0] /home/travis/build/WordPress/gutenberg/packages/element/src/raw-html.js
[0] 20:0 warning The type 'JSX' is undefined jsdoc/no-undefined-types
https://travis-ci.com/github/WordPress/gutenberg/jobs/314225929
I thought these rules were upgraded to be errors in #20427. I think this one might have been missed? (cc @sainthkh)
I know we have a handful of temporary exceptions for custom types, but pretty sure those are hard-coded to be exceptions and could still exist even if the rule were upgraded from warning to error.
There was a problem hiding this comment.
Is this a concern with restoring the element types? #21781
There was a problem hiding this comment.
It happened because I missed this one rule:
gutenberg/packages/eslint-plugin/configs/jsdoc.js
Lines 82 to 83 in 5bd92c6
I opened an issue that fixes it: #21942.
Description
Add types/typechecking to
@wordpress/element. Many other packages that would be extremely valuable to type, namely@wordpress/dataand@wordpress/components, depend on this package. Typing it unblocks a lot of work on other package typings.Add
unknownandneverTypeScript types to allowed JSDoc types.✅
Includes squash-merged #20669, necessary for some required types.Part of #18838
How has this been tested?
npm run build:package-typespasses.Screenshots
Types of changes
New feature: Add types
Checklist: