Skip to content

Commit

Permalink
Convert viz-lib to TypeScript (getredash#5310)
Browse files Browse the repository at this point in the history
Co-authored-by: ts-migrate <>
  • Loading branch information
elado authored Dec 16, 2020
1 parent b70e95a commit c290864
Show file tree
Hide file tree
Showing 210 changed files with 5,289 additions and 2,042 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect, useState } from "react";
// @ts-expect-error (Must be removed after adding @redash/viz typing)
import ErrorBoundary, { ErrorBoundaryContext } from "@redash/viz/lib/components/ErrorBoundary";
import { Auth } from "@/services/auth";
import { policy } from "@/services/policy";
Expand Down Expand Up @@ -62,9 +61,10 @@ export function UserSessionWrapper<P>({ bodyClass, currentRoute, render }: UserS
return (
<ApplicationLayout>
<React.Fragment key={currentRoute.key}>
{/* @ts-expect-error FIXME */}
<ErrorBoundary renderError={(error: Error) => <ErrorMessage error={error} />}>
<ErrorBoundaryContext.Consumer>
{({ handleError }: { handleError: UserSessionWrapperRenderChildrenProps<P>["onError"] }) =>
{({ handleError } /* : { handleError: UserSessionWrapperRenderChildrenProps<P>["onError"] } FIXME bring back type */) =>
render({ ...currentRoute.routeParams, pageTitle: currentRoute.title, onError: handleError })
}
</ErrorBoundaryContext.Consumer>
Expand Down
17 changes: 5 additions & 12 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,14 @@
"jsx": "react",
"allowSyntheticDefaultImports": true,
"noUnusedLocals": true,
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"forceConsistentCasingInFileNames": true,
"baseUrl": "./",
"paths": {
"@/*": ["./app/*"]
}
},
"skipLibCheck": true
},
"include": [
"app/**/*"
],
"exclude": [
"dist"
]
"include": ["app/**/*"],
"exclude": ["dist"]
}
28 changes: 14 additions & 14 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
"@types/hoist-non-react-statics": "^3.3.1",
"@types/lodash": "^4.14.157",
"@types/prop-types": "^15.7.3",
"@types/react": "^16.9.41",
"@types/react-dom": "^16.9.8",
"@types/react": "^16.14.2",
"@types/react-dom": "^16.9.10",
"@types/sql-formatter": "^2.3.0",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
Expand Down Expand Up @@ -144,7 +144,7 @@
"request": "^2.88.0",
"request-cookies": "^1.1.0",
"style-loader": "^2.0.0",
"typescript": "^3.9.6",
"typescript": "^4.1.2",
"url-loader": "^1.1.2",
"webpack": "^4.44.2",
"webpack-build-notifier": "^0.1.30",
Expand Down
2 changes: 1 addition & 1 deletion viz-lib/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
"plugins": [
"@babel/plugin-proposal-class-properties",
[
Expand Down
9 changes: 0 additions & 9 deletions viz-lib/jsconfig.json

This file was deleted.

Loading

0 comments on commit c290864

Please sign in to comment.