Skip to content

Commit

Permalink
Added objects explicitly to Trans children (#1486)
Browse files Browse the repository at this point in the history
- this is done because of @types/react@18 - objects now need to be
explicitly allowed
- upgraded to tslint 6.1.3 and disabled the no-null-undefined-union
rule
  • Loading branch information
high1 committed Apr 19, 2022
1 parent 596f60d commit 9347070
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
25 changes: 13 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"rollup-plugin-replace": "^2.1.0",
"rollup-plugin-terser": "^5.1.1",
"sinon": "^7.2.3",
"tslint": "^5.20.1",
"tslint": "^6.1.3",
"typescript": "4.6.2",
"yargs": "^13.3.0"
},
Expand Down
4 changes: 1 addition & 3 deletions ts4.1/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ export type TFuncReturn<
export interface TFunction<N extends Namespace = DefaultNamespace, TKPrefix = undefined> {
<
TKeys extends TFuncKey<N, TKPrefix> | TemplateStringsArray extends infer A ? A : never,
// tslint:disable-next-line:no-null-undefined-union
TDefaultResult extends TFunctionResult | React.ReactNode = string,
TInterpolationMap extends object = StringMap
>(
Expand All @@ -237,7 +236,6 @@ export interface TFunction<N extends Namespace = DefaultNamespace, TKPrefix = un
): TFuncReturn<N, TKeys, TDefaultResult, TKPrefix>;
<
TKeys extends TFuncKey<N, TKPrefix> | TemplateStringsArray extends infer A ? A : never,
// tslint:disable-next-line:no-null-undefined-union
TDefaultResult extends TFunctionResult | React.ReactNode = string,
TInterpolationMap extends object = StringMap
>(
Expand All @@ -253,7 +251,7 @@ export type TransProps<
TKPrefix = undefined,
E = React.HTMLProps<HTMLDivElement>
> = E & {
children?: React.ReactNode;
children?: React.ReactNode | Record<string, unknown>;
components?: readonly React.ReactNode[] | { readonly [tagName: string]: React.ReactNode };
count?: number;
context?: string;
Expand Down
1 change: 1 addition & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"extends": "dtslint/dtslint.json",
"rules": {
"array-type": [true, "array"],
"no-null-undefined-union": false,
"no-empty-interface": false,
"no-redundant-jsdoc": false,
"no-unnecessary-generics": false,
Expand Down

0 comments on commit 9347070

Please sign in to comment.