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
Add babel-plugin-react-html-attrs type extensions for React #44416
Add babel-plugin-react-html-attrs type extensions for React #44416
Conversation
@insin Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped Code ReviewsThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 44416,
"author": "insin",
"owners": [],
"dangerLevel": "ScopedAndConfiguration",
"headCommitAbbrOid": "d6df744",
"headCommitOid": "d6df74423c5b86c825bd3d8ef09438cf2f342351",
"mergeIsRequested": false,
"stalenessInDays": 10,
"lastCommitDate": "2020-05-02T06:24:28.000Z",
"lastCommentDate": "2020-05-02T06:28:18.000Z",
"reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44416/files",
"hasMergeConflict": false,
"authorIsOwner": false,
"isFirstContribution": true,
"popularityLevel": "Well-liked by everyone",
"anyPackageIsNew": true,
"packages": [
"babel-plugin-react-html-attrs"
],
"files": [
{
"filePath": "types/babel-plugin-react-html-attrs/OTHER_FILES.txt",
"kind": "package-meta",
"package": "babel-plugin-react-html-attrs"
},
{
"filePath": "types/babel-plugin-react-html-attrs/babel-plugin-react-html-attrs-tests.tsx",
"kind": "test",
"package": "babel-plugin-react-html-attrs"
},
{
"filePath": "types/babel-plugin-react-html-attrs/experimental.d.ts",
"kind": "definition",
"package": "babel-plugin-react-html-attrs"
},
{
"filePath": "types/babel-plugin-react-html-attrs/global.d.ts",
"kind": "definition",
"package": "babel-plugin-react-html-attrs"
},
{
"filePath": "types/babel-plugin-react-html-attrs/index.d.ts",
"kind": "definition",
"package": "babel-plugin-react-html-attrs"
},
{
"filePath": "types/babel-plugin-react-html-attrs/package.json",
"kind": "package-meta",
"package": "babel-plugin-react-html-attrs"
},
{
"filePath": "types/babel-plugin-react-html-attrs/tsconfig.json",
"kind": "package-meta",
"package": "babel-plugin-react-html-attrs"
},
{
"filePath": "types/babel-plugin-react-html-attrs/tslint.json",
"kind": "package-meta",
"package": "babel-plugin-react-html-attrs"
}
],
"hasDismissedReview": false,
"travisResult": "pass",
"reviewersWithStaleReviews": [],
"approvalFlags": 0,
"isChangesRequested": false
} |
Let’s review the numbers, shall we? These typings are for a package that doesn’t yet exist on master, so I don’t have anything to compare against yet! In the future, I’ll be able to compare PRs to babel-plugin-react-html-attrs with its source on master. Comparison details
|
Batch compilation | |
---|---|
Type count | 15954 |
Assignability cache size | 34506 |
Language service measurements | |
Samples taken | 170 |
Identifiers in tests | 170 |
getCompletionsAtPosition |
|
Mean duration (ms) | 287.3 |
Mean CV | 9.8% |
Worst duration (ms) | 345.3 |
Worst identifier | text-decoration |
getQuickInfoAtPosition |
|
Mean duration (ms) | 277.5 |
Mean CV | 9.9% |
Worst duration (ms) | 342.7 |
Worst identifier | text-decoration |
System information | |
Node version | v12.16.1 |
CPU count | 2 |
CPU speed | 2.095 GHz |
CPU model | Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz |
CPU Architecture | x64 |
Memory | 6.8 GiB |
Platform | linux |
Release | 4.15.0-1077-azure |
…umeric HTML attribute support This had to be done as not possible to override existing imported types (e.g. so boolean attributes can be `boolean | string` instead of `boolean`), which probably makes this type definition academic as it probably breaks when you use other typedefs which import @types/react.
This PR started out adding extensions to As such, it now has the same exceptions to the definition guidelines in the PR template as |
I just published |
…lyTyped#44416) * Add babel-plugin-react-html-attrs type extensions for React * Update types and test for babel-plugin-react-html-attrs@3.0.2 * This is now a fork of @types/react in order to add full boolean and numeric HTML attribute support This had to be done as not possible to override existing imported types (e.g. so boolean attributes can be `boolean | string` instead of `boolean`), which probably makes this type definition academic as it probably breaks when you use other typedefs which import @types/react.
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If adding a new definition:
.d.ts
files generated via--declaration
dts-gen --dt
, not by basing it on an existing project.tslint.json
should be present and it shouldn't have any additional or disabling of rules. Just content as{ "extends": "dtslint/dt.json" }
. If for reason the some rule need to be disabled, disable it for that line using// tslint:disable-next-line [ruleName]
and not for whole package so that the need for disabling can be reviewed.tsconfig.json
should havenoImplicitAny
,noImplicitThis
,strictNullChecks
, andstrictFunctionTypes
set totrue
.