chore(deps): update dependency eslint-plugin-react to v7.33.0 (#3205)

* chore(deps): update dependency eslint-plugin-react to v7.33.0

* chore: have linter try to autofix and commit linter warnings

* Linter fixes

* chore: tweak how js formatting is run within actions

* fix: type mismatch

* Prettified Code!

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Gabe Kangas <gabek@real-ity.com>
Co-authored-by: Owncast <owncast@owncast.online>
Co-authored-by: gabek <gabek@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2023-07-29 15:57:45 -07:00
committed by GitHub
parent adef11eccf
commit 7c13a3fd01
9 changed files with 53 additions and 58 deletions

View File

@@ -1,4 +1,4 @@
name: Lint name: Javascript Formatting
# This action works with pull requests and pushes # This action works with pull requests and pushes
on: on:
@@ -10,39 +10,8 @@ on:
- web/** - web/**
jobs: jobs:
prettier: formatting:
name: Javascript prettier name: Javascript code formatting
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
- name: Prettify code
uses: creyD/prettier_action@v4.3
with:
# This part is also where you can pass other options, for example:
prettier_options: --write **/*.{js,ts,jsx,tsx,css,md}
only_changed: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linter:
name: Javascript linter
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults: defaults:
run: run:
@@ -62,11 +31,38 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }} repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
with:
files_yaml: |
src:
- '**.js'
- '**.ts'
- '**.tsx'
- '**.jsx'
- '**.css'
- '**.md'
- name: Install Dependencies - name: Install Dependencies
run: npm install run: npm install
- name: Lint - name: Lint
run: npm run lint if: steps.changed-files.outputs.any_changed == 'true'
run: npx eslint --fix ${{ steps.changed-files.outputs.all_changed_files }}
- name: Prettier
if: steps.changed-files.outputs.any_changed == 'true'
run: npx prettier --write ${{ steps.changed-files.outputs.all_changed_files }}
- name: Commit changes
if: steps.changed-files.outputs.any_changed == 'true'
uses: EndBug/add-and-commit@v9
with:
author_name: Owncast
author_email: owncast@owncast.online
message: 'Javascript formatting autofixes'
pull: '--rebase --autostash'
unused-code: unused-code:
name: Test for unused code name: Test for unused code

View File

@@ -25,7 +25,7 @@ export const ActionButton: FC<ActionButtonProps> = ({
style={{ backgroundColor: color }} style={{ backgroundColor: color }}
title={description || title} title={description || title}
> >
{icon && <img src={icon} className={`${styles.icon}`} alt={description} />} {icon && <img src={icon} className={styles.icon} alt={description} />}
{title} {title}
</Button> </Button>
); );

View File

@@ -6,5 +6,5 @@ export type ActionButtonRowProps = {
}; };
export const ActionButtonRow: FC<ActionButtonRowProps> = ({ children }) => ( export const ActionButtonRow: FC<ActionButtonRowProps> = ({ children }) => (
<div className={`${styles.row}`}>{children}</div> <div className={styles.row}>{children}</div>
); );

View File

@@ -17,7 +17,7 @@ export type NotifyButtonProps = {
export const NotifyButton: FC<NotifyButtonProps> = ({ onClick, text }) => ( export const NotifyButton: FC<NotifyButtonProps> = ({ onClick, text }) => (
<Button <Button
type="primary" type="primary"
className={`${styles.button}`} className={styles.button}
icon={<BellFilled />} icon={<BellFilled />}
onClick={onClick} onClick={onClick}
id="notify-button" id="notify-button"

View File

@@ -75,7 +75,7 @@ const ConnectedClient = ({ client }: { client: Client }) => {
return ( return (
<div> <div>
<ValueRow label="Messages Sent" value={`${messageCount}`} /> <ValueRow label="Messages Sent" value={messageCount.toString()} />
{geo !== 'N/A' && <ValueRow label="Geo" value={geo} />} {geo !== 'N/A' && <ValueRow label="Geo" value={geo} />}
<ValueRow label="Connected At" value={connectedAtDate} /> <ValueRow label="Connected At" value={connectedAtDate} />
</div> </div>
@@ -162,9 +162,7 @@ export const ChatModerationDetailsModal: FC<ChatModerationDetailsModalProps> = (
> >
<Spin spinning={loading}> <Spin spinning={loading}>
<UserColorBlock color={displayColor} /> <UserColorBlock color={displayColor} />
{scopes?.map(scope => ( {scopes?.map(scope => <Tag key={scope}>{scope}</Tag>)}
<Tag key={scope}>{scope}</Tag>
))}
{authenticated && <Tag>Authenticated</Tag>} {authenticated && <Tag>Authenticated</Tag>}
{isBot && <Tag>Bot</Tag>} {isBot && <Tag>Bot</Tag>}
<ValueRow label="Messages Sent Across Clients" value={totalMessagesSent.toString()} /> <ValueRow label="Messages Sent Across Clients" value={totalMessagesSent.toString()} />

12
web/package-lock.json generated
View File

@@ -22,7 +22,7 @@
"@xstate/react": "3.2.2", "@xstate/react": "3.2.2",
"antd": "4.24.12", "antd": "4.24.12",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"chart.js": "^4.3.2", "chart.js": "^4.2.0",
"classnames": "2.3.2", "classnames": "2.3.2",
"date-fns": "^2.29.3", "date-fns": "^2.29.3",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
@@ -95,7 +95,7 @@
"eslint-plugin-import": "^2.27.5", "eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "6.7.1", "eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "4.2.1", "eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.32.2", "eslint-plugin-react": "7.33.0",
"eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-storybook": "0.6.13", "eslint-plugin-storybook": "0.6.13",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
@@ -21415,9 +21415,9 @@
} }
}, },
"node_modules/eslint-plugin-react": { "node_modules/eslint-plugin-react": {
"version": "7.32.2", "version": "7.33.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.32.2.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.0.tgz",
"integrity": "sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==", "integrity": "sha512-qewL/8P34WkY8jAqdQxsiL82pDUeT7nhs8IsuXgfgnsEloKCT4miAV9N9kGtx7/KM9NH/NCGUE7Edt9iGxLXFw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"array-includes": "^3.1.6", "array-includes": "^3.1.6",
@@ -21433,7 +21433,7 @@
"object.values": "^1.1.6", "object.values": "^1.1.6",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"resolve": "^2.0.0-next.4", "resolve": "^2.0.0-next.4",
"semver": "^6.3.0", "semver": "^6.3.1",
"string.prototype.matchall": "^4.0.8" "string.prototype.matchall": "^4.0.8"
}, },
"engines": { "engines": {

View File

@@ -6,11 +6,12 @@
"dev": "next dev", "dev": "next dev",
"build": "next build && next export", "build": "next build && next export",
"start": "next start", "start": "next start",
"lint": "eslint --ext .js,.ts,.tsx types/ pages/ components/ stories/", "lint": "eslint --fix --ext .js,.ts,.tsx types/ pages/ components/ stories/",
"storybook": "start-storybook -p 6006", "storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook", "build-storybook": "build-storybook",
"build-styles": "cd ./style-definitions && style-dictionary build && ./build.sh && cd -", "build-styles": "cd ./style-definitions && style-dictionary build && ./build.sh && cd -",
"test": "jest" "test": "jest",
"format": "prettier --write **/*.{js,ts,jsx,tsx,css,md}"
}, },
"dependencies": { "dependencies": {
"@ant-design/icons": "4.8.0", "@ant-design/icons": "4.8.0",
@@ -100,7 +101,7 @@
"eslint-plugin-import": "^2.27.5", "eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "6.7.1", "eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "4.2.1", "eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.32.2", "eslint-plugin-react": "7.33.0",
"eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-storybook": "0.6.13", "eslint-plugin-storybook": "0.6.13",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
@@ -128,4 +129,4 @@
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
"typescript": "4.9.5" "typescript": "4.9.5"
} }
} }

View File

@@ -101,7 +101,7 @@ export default function HardwareInfo() {
<Col> <Col>
<StatisticItem <StatisticItem
title={series[0].name} title={series[0].name}
value={`${Math.round(currentCPUUsage) || 0}`} value={Math.round(currentCPUUsage) || 0}
prefix={<LaptopOutlined style={{ color: series[0].color }} />} prefix={<LaptopOutlined style={{ color: series[0].color }} />}
color={series[0].color} color={series[0].color}
progress progress
@@ -111,7 +111,7 @@ export default function HardwareInfo() {
<Col> <Col>
<StatisticItem <StatisticItem
title={series[1].name} title={series[1].name}
value={`${Math.round(currentRamUsage) || 0}`} value={Math.round(currentRamUsage) || 0}
prefix={<BulbOutlined style={{ color: series[1].color }} />} prefix={<BulbOutlined style={{ color: series[1].color }} />}
color={series[1].color} color={series[1].color}
progress progress
@@ -121,7 +121,7 @@ export default function HardwareInfo() {
<Col> <Col>
<StatisticItem <StatisticItem
title={series[2].name} title={series[2].name}
value={`${Math.round(currentDiskUsage) || 0}`} value={Math.round(currentDiskUsage) || 0}
prefix={<SaveOutlined style={{ color: series[2].color }} />} prefix={<SaveOutlined style={{ color: series[2].color }} />}
color={series[2].color} color={series[2].color}
progress progress

View File

@@ -292,7 +292,7 @@ const StreamHealth = () => {
<div style={statStyle}> <div style={statStyle}>
<Statistic <Statistic
title="Viewer Playback Speed" title="Viewer Playback Speed"
value={`${currentSpeed}`} value={currentSpeed.toString()}
prefix={<WifiOutlined style={{ marginRight: '5px' }} />} prefix={<WifiOutlined style={{ marginRight: '5px' }} />}
precision={0} precision={0}
suffix="kbps" suffix="kbps"
@@ -306,7 +306,7 @@ const StreamHealth = () => {
<div style={statStyle}> <div style={statStyle}>
<Statistic <Statistic
title="Viewer Latency" title="Viewer Latency"
value={`${latencyStat}`} value={latencyStat}
prefix={<ClockCircleOutlined style={{ marginRight: '5px' }} />} prefix={<ClockCircleOutlined style={{ marginRight: '5px' }} />}
precision={0} precision={0}
suffix="seconds" suffix="seconds"
@@ -320,7 +320,7 @@ const StreamHealth = () => {
<div style={statStyle}> <div style={statStyle}>
<Statistic <Statistic
title="Recent Playback Errors" title="Recent Playback Errors"
value={`${recentErrorCount || 0}`} value={recentErrorCount || 0}
valueStyle={{ color: errorStatColor }} valueStyle={{ color: errorStatColor }}
prefix={<WarningOutlined style={{ marginRight: '5px' }} />} prefix={<WarningOutlined style={{ marginRight: '5px' }} />}
suffix="" suffix=""