Change how lint rule is disabled

This commit is contained in:
Elizabeth Craig 2019-04-03 16:20:38 -07:00
parent 6417338998
commit a6b5feadfb
3 changed files with 9 additions and 4 deletions

View File

@ -10,6 +10,8 @@ export default class Markdown extends React.Component<MarkdownProps> { }
export interface MarkdownProps {
options?: MarkdownOptions;
// React.ReactNode contains both null and undefined
// tslint:disable-next-line:no-null-undefined-union
children?: React.ReactNode;
}
@ -66,7 +68,10 @@ export interface MarkdownOptions {
/** Custom React.createElement behavior. */
createElement?: <P extends {}>(
type: React.SFC<P> | React.ComponentClass<P> | string,
// This typing is copied from React
// tslint:disable-next-line:no-null-undefined-union
props?: React.Attributes & P | null,
// tslint:disable-next-line:no-null-undefined-union
...children: React.ReactNode[]) => React.ReactElement<P>;
/** Custom function to generate an HTML id from headings. */

View File

@ -48,7 +48,10 @@ render(
options={{
createElement: <P extends {}>(
type: React.FunctionComponent<P> | React.ComponentClass<P> | string,
// This typing is copied from React
// tslint:disable-next-line:no-null-undefined-union
props?: React.Attributes & P | null,
// tslint:disable-next-line:no-null-undefined-union
...children: React.ReactNode[]) => (
<div className="parent">
{React.createElement(type, props, children)}

View File

@ -1,6 +1,3 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-null-undefined-union": false
}
"extends": "dtslint/dt.json"
}