From f95125bd04a6b1530d1aef54670fcef6b69fa1f2 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 4 May 2023 03:48:50 -0400 Subject: [PATCH] Fail ESLint for Warnings in CI (#24836) --- .github/workflows/lint-js.yml | 2 +- app/javascript/mastodon/components/column_back_button.jsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml index e0c309c736..7700e48512 100644 --- a/.github/workflows/lint-js.yml +++ b/.github/workflows/lint-js.yml @@ -48,7 +48,7 @@ jobs: run: yarn --frozen-lockfile - name: ESLint - run: yarn test:lint:js + run: yarn test:lint:js --max-warnings 0 - name: Typecheck run: yarn test:typecheck diff --git a/app/javascript/mastodon/components/column_back_button.jsx b/app/javascript/mastodon/components/column_back_button.jsx index 6537647781..5499be2423 100644 --- a/app/javascript/mastodon/components/column_back_button.jsx +++ b/app/javascript/mastodon/components/column_back_button.jsx @@ -21,10 +21,9 @@ export default class ColumnBackButton extends React.PureComponent { if (onClick) { onClick(); - } // Check if there is a previous page in the app to go back to per https://stackoverflow.com/a/70532858/9703201 // When upgrading to V6, check `location.key !== 'default'` instead per https://github.com/remix-run/history/blob/main/docs/api-reference.md#location - else if (router.location.key) { + } else if (router.location.key) { router.history.goBack(); } else { router.history.push('/');