From 3eeb6eaece13753ba31c3f2cab98142ad1318284 Mon Sep 17 00:00:00 2001 From: gingervitis Date: Sat, 28 Nov 2020 19:45:52 -0800 Subject: [PATCH] linty things --- web/package-lock.json | 18 ++++++++++++++++++ web/package.json | 2 ++ web/pages/components/chart.tsx | 6 ------ web/pages/components/key-value-table.tsx | 7 ++++++- web/pages/components/statistic.tsx | 1 + web/pages/hardware-info.tsx | 1 - web/pages/index.tsx | 1 - web/pages/storage.tsx | 1 - web/pages/update-server-config.tsx | 1 - web/pages/video-config.tsx | 1 - web/pages/viewer-info.tsx | 1 - web/tsconfig.json | 2 +- 12 files changed, 28 insertions(+), 14 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index 997f27d4a..015b0afc8 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1566,6 +1566,15 @@ } } }, + "@types/chart.js": { + "version": "2.9.28", + "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.28.tgz", + "integrity": "sha512-9YYhsxRngRJb0dkuaU5BezkF+zvvVHnwdRw+rtlahtFb4zqNf9YSgWsOq+dLYeh0fqsWmHUYLR64eNigh02F+w==", + "dev": true, + "requires": { + "moment": "^2.10.2" + } + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -1613,6 +1622,15 @@ "csstype": "^3.0.2" } }, + "@types/react-linkify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/react-linkify/-/react-linkify-1.0.0.tgz", + "integrity": "sha512-2NKXPQGaHNfh/dCqkVC55k1tAhQyNoNZa31J50nIneMVwHqUI00FAP+Lyp8e0BarPf84kn4GRVAhtWX9XJBzSQ==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, "@types/unist": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", diff --git a/web/package.json b/web/package.json index f05b73cc9..2e7d684aa 100644 --- a/web/package.json +++ b/web/package.json @@ -23,9 +23,11 @@ "sass": "^1.26.11" }, "devDependencies": { + "@types/chart.js": "^2.9.28", "@types/node": "^14.11.2", "@types/prop-types": "^15.7.3", "@types/react": "^16.9.49", + "@types/react-linkify": "^1.0.0", "@typescript-eslint/eslint-plugin": "^4.3.0", "@typescript-eslint/parser": "^4.3.0", "eslint": "^7.10.0", diff --git a/web/pages/components/chart.tsx b/web/pages/components/chart.tsx index b2bd34d7e..8d8f7609b 100644 --- a/web/pages/components/chart.tsx +++ b/web/pages/components/chart.tsx @@ -2,12 +2,6 @@ import { LineChart } from 'react-chartkick' import styles from '../../styles/styles.module.scss'; import 'chart.js'; -const defaultProps = { - active: false, - payload: Object, - unit: '', -}; - interface TimedValue { time: Date; value: number; diff --git a/web/pages/components/key-value-table.tsx b/web/pages/components/key-value-table.tsx index 8169b2893..28e620ead 100644 --- a/web/pages/components/key-value-table.tsx +++ b/web/pages/components/key-value-table.tsx @@ -2,7 +2,7 @@ import { Table, Typography } from "antd"; const { Title } = Typography; -export default function KeyValueTable({ title, data }) { +export default function KeyValueTable({ title, data }: KeyValueTableProps) { const columns = [ { title: "Name", @@ -23,3 +23,8 @@ export default function KeyValueTable({ title, data }) { ); } + +interface KeyValueTableProps { + title: string, + data: any, +}; \ No newline at end of file diff --git a/web/pages/components/statistic.tsx b/web/pages/components/statistic.tsx index bf212b680..62383efe1 100644 --- a/web/pages/components/statistic.tsx +++ b/web/pages/components/statistic.tsx @@ -1,4 +1,5 @@ import { Typography, Statistic, Card, Progress} from "antd"; + const { Text } = Typography; interface StatisticItemProps { diff --git a/web/pages/hardware-info.tsx b/web/pages/hardware-info.tsx index 159c3fa8d..2cd3f84f1 100644 --- a/web/pages/hardware-info.tsx +++ b/web/pages/hardware-info.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-array-constructor */ import { BulbOutlined, LaptopOutlined, SaveOutlined } from "@ant-design/icons"; import { Row } from "antd"; import React, { useEffect, useState } from 'react'; diff --git a/web/pages/index.tsx b/web/pages/index.tsx index 3b2432501..acbd455d6 100644 --- a/web/pages/index.tsx +++ b/web/pages/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ /* Will display an overview with the following datasources: 1. Current broadcaster. diff --git a/web/pages/storage.tsx b/web/pages/storage.tsx index effb4ed2b..ec167cff2 100644 --- a/web/pages/storage.tsx +++ b/web/pages/storage.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/prop-types */ import React, { useContext } from "react"; import KeyValueTable from "./components/key-value-table"; import { ServerStatusContext } from '../utils/server-status-context'; diff --git a/web/pages/update-server-config.tsx b/web/pages/update-server-config.tsx index ff0aa6a5f..0cdace0b0 100644 --- a/web/pages/update-server-config.tsx +++ b/web/pages/update-server-config.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/prop-types */ import React, { useContext } from 'react'; import { Table, Typography, Input } from 'antd'; import { isEmptyObject } from '../utils/format'; diff --git a/web/pages/video-config.tsx b/web/pages/video-config.tsx index 4333aadd2..a9e0d53f2 100644 --- a/web/pages/video-config.tsx +++ b/web/pages/video-config.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/prop-types */ import React, { useContext } from 'react'; import { Table, Typography } from 'antd'; import { ServerStatusContext } from '../utils/server-status-context'; diff --git a/web/pages/viewer-info.tsx b/web/pages/viewer-info.tsx index 5ea4c80b6..517c0a1f8 100644 --- a/web/pages/viewer-info.tsx +++ b/web/pages/viewer-info.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/prop-types */ import React, { useState, useEffect, useContext } from 'react'; import { Table, Row } from "antd"; import { formatDistanceToNow } from "date-fns"; diff --git a/web/tsconfig.json b/web/tsconfig.json index 35d51eac9..13d28b611 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -16,7 +16,7 @@ "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve" + "jsx": "react" }, "include": [ "next-env.d.ts",