Add typescript

(cherry picked from commit 910511dba03196f14bb238c8e15f060c12183c08)
This commit is contained in:
Mark McDowall 2023-01-05 18:43:51 -08:00 committed by Bogdan
parent f38f00c64e
commit eacaf9be32
17 changed files with 635 additions and 38 deletions

View file

@ -4,7 +4,15 @@ import Alert from 'Components/Alert';
import { kinds } from 'Helpers/Props';
import styles from './Form.css';
function Form({ children, validationErrors, validationWarnings, ...otherProps }) {
function Form(props) {
const {
children,
validationErrors,
validationWarnings,
// eslint-disable-next-line no-unused-vars
...otherProps
} = props;
return (
<div>
{

View file

@ -27,6 +27,7 @@ SortMenuItem.propTypes = {
name: PropTypes.string,
sortKey: PropTypes.string,
sortDirection: PropTypes.oneOf(sortDirections.all),
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
onPress: PropTypes.func.isRequired
};

View file

@ -22,7 +22,9 @@ function ViewMenuItem(props) {
ViewMenuItem.propTypes = {
name: PropTypes.string,
selectedView: PropTypes.string.isRequired
selectedView: PropTypes.string.isRequired,
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
onPress: PropTypes.func.isRequired
};
export default ViewMenuItem;

View file

@ -173,7 +173,7 @@ OverlayScroller.defaultProps = {
scrollDirection: scrollDirections.VERTICAL,
autoHide: false,
autoScroll: true,
registerScroller: () => {}
registerScroller: () => { /* no-op */ }
};
export default OverlayScroller;

View file

@ -89,7 +89,7 @@ Scroller.defaultProps = {
scrollDirection: scrollDirections.VERTICAL,
autoFocus: true,
autoScroll: true,
registerScroller: () => {}
registerScroller: () => { /* no-op */ }
};
export default Scroller;

View file

@ -13,6 +13,7 @@ export function virtualTableSelectCellRenderer(cellProps) {
} = cellProps;
return (
// eslint-disable-next-line no-use-before-define
<VirtualTableSelectCell
key={cellKey}
id={rowData.name}

View file

@ -13,6 +13,8 @@ export function headerRenderer(headerProps) {
} = headerProps;
return (
// eslint-disable-next-line no-use-before-define
<VirtualTableHeaderCell
name={dataKey}
{...columnData}

View file

@ -1,4 +1,4 @@
/* eslint no-empty-function: 0 no-extend-native: 0 */
/* eslint no-empty-function: 0, no-extend-native: 0, "@typescript-eslint/no-empty-function": 0 */
window.console = window.console || {};
window.console.log = window.console.log || function() {};