Add filter-invalid-dom-props (#25316)

This commit is contained in:
Ian Copp
2018-04-26 15:15:17 -07:00
committed by Wesley Wigham
parent fe5ac79ff9
commit 262cb8eae6
4 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
import filterInvalidDomProps from 'filter-invalid-dom-props';
// $ExpectType Partial<{ notADomProp: boolean; }>
filterInvalidDomProps({ notADomProp: true });

View File

@@ -0,0 +1,11 @@
// Type definitions for filter-invalid-dom-props 2.0
// Project: https://www.npmjs.com/package/filter-invalid-dom-props
// Definitions by: icopp <https://github.com/icopp>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
// Note that the below can't actually be fully typed in the latest version of
// Typescript, because there's no way to regex-match against `data-` or `aria-`
// (which this function allows in addition to a list of static props).
export default function filterInvalidDOMProps<T>(props: T): Partial<T>;

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"filter-invalid-dom-props-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }