From f55e6a68b8a5caa1850474a4d89e58f952446527 Mon Sep 17 00:00:00 2001 From: Divyank Shah Date: Mon, 18 Dec 2023 00:54:00 -0800 Subject: [PATCH 1/4] format files via prettier, fix most eslint errors --- .github/ISSUE_TEMPLATE/bug_report.md | 24 +- .github/workflows/pull-request.yaml | 33 + .vscode/3blue1brown.code-snippets | 20 +- .vscode/settings.json | 4 +- components/Announcement/index.js | 14 +- components/BookShelf/index.js | 6 +- components/BookShelf/index.module.scss | 2 +- components/ContactForms/index.js | 11 +- components/FaqLinks/index.js | 50 +- components/Footer/index.js | 1 - components/Header/index.js | 24 +- components/HomepageFeaturedContent/index.js | 150 ++- .../HomepageFeaturedContent/index.module.scss | 5 +- components/LessonDetails/index.js | 34 +- components/LessonGallery/index.js | 30 +- components/LessonGallery/index.module.scss | 2 +- components/LessonVideo/index.js | 36 +- components/LessonVideo/index.module.scss | 4 +- components/PodcastEpisodes/index.module.scss | 2 +- components/PodcastLinks/index.js | 2 - components/Portrait/index.js | 2 +- components/PreviewText/index.js | 12 +- components/PreviewText/index.module.scss | 1 - components/ShareButtons/index.js | 2 +- components/SocialIcons/index.js | 63 +- components/SocialIcons/index.module.scss | 5 +- layouts/BlogLayout.js | 1 - layouts/LessonLayout.js | 64 +- package.json | 12 +- pages/404.js | 7 +- pages/api/instagram_follower_count.js | 10 +- pages/api/patreon_member_count.js | 15 +- pages/api/twitter_follower_count.js | 14 +- pages/api/youtube_subscriber_count.js | 12 +- .../2016/span/span_interactive2/index.js | 18 +- .../2016/span/span_interactive3/index.js | 34 +- .../2017/chain-rule-and-product-rule/notes.md | 1 - .../2017/integration/potential-questions.md | 42 +- .../polarizer_interactive/index.js | 78 +- .../wave_interactive/index.js | 10 +- .../advanced_interactive/index.js | 16 +- .../basic_interactive/index.js | 10 +- .../fourier_lib/winding_machine.js | 17 +- .../2019/hyperdarts/game_interactive/index.js | 56 +- .../mandelbrot-interactive/index.js | 3 +- sentry.client.config.js | 6 +- sentry.server.config.js | 6 +- util/transformSrc.js | 2 +- yarn.lock | 1069 ++++++++++++++--- 49 files changed, 1387 insertions(+), 655 deletions(-) create mode 100644 .github/workflows/pull-request.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea78..9b77ea71 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,10 +1,9 @@ --- name: Bug report about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - +title: "" +labels: "" +assignees: "" --- **Describe the bug** @@ -12,6 +11,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] **Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] + +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] **Additional context** Add any other context about the problem here. diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 00000000..773e6dfc --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,33 @@ +name: 3Brown1Blue + +on: + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + format: + name: formatting + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "19.6.0" + - run: npm ci + - run: npm run check + + lint: + name: linting + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "19.6.0" + - run: npm ci + - run: npm run eslint \ No newline at end of file diff --git a/.vscode/3blue1brown.code-snippets b/.vscode/3blue1brown.code-snippets index 6c5054ee..dd1002b6 100644 --- a/.vscode/3blue1brown.code-snippets +++ b/.vscode/3blue1brown.code-snippets @@ -1,9 +1,9 @@ { - // Place your 3blue1brown workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and - // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope - // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is - // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: - // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. + // Place your 3blue1brown workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and + // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope + // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is + // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. // Placeholders with the same ids are connected. // Example: // "Print to console": { @@ -18,9 +18,7 @@ "Figure": { "scope": "markdown, mdx", "prefix": "figure", - "body": [ - "" - ], + "body": [""], "description": "Insert a figure shortcode into markdown." }, "Question": { @@ -34,9 +32,7 @@ "Accordion": { "scope": "markdown, mdx", "prefix": "accordion", - "body": [ - "\n$7\n" - ], + "body": ["\n$7\n"], "description": "Insert an accordion into markdown." } -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 04ebd336..8b4c167b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "editor.wordWrap": "on" -} \ No newline at end of file + "editor.wordWrap": "on" +} diff --git a/components/Announcement/index.js b/components/Announcement/index.js index ea31d1e1..eda4ec83 100644 --- a/components/Announcement/index.js +++ b/components/Announcement/index.js @@ -22,7 +22,13 @@ Announcement.propTypes = { hidden, enter showAnnouncements() into the devtools console. */ -export default function Announcement({ id, headline, description, link, showCloseButton = true}) { +export default function Announcement({ + id, + headline, + description, + link, + showCloseButton = true, +}) { const [closedAnnouncements, setClosedAnnouncements] = useLocalStorage( "closed-announcements", [] @@ -45,8 +51,7 @@ export default function Announcement({ id, headline, description, link, showClos } return ( - ( - +
{headline}
@@ -66,8 +71,7 @@ export default function Announcement({ id, headline, description, link, showClos )}
- - ) + ); } diff --git a/components/BookShelf/index.js b/components/BookShelf/index.js index cec67412..6ddde4f4 100644 --- a/components/BookShelf/index.js +++ b/components/BookShelf/index.js @@ -4,7 +4,7 @@ export default function BookShelf({ children }) { return
{children}
; } -export function Book({ url, image, title, author=""}) { +export function Book({ url, image, title, author = "" }) { return (
{title - +
{title}
{author ? "by " + author : ""}
diff --git a/components/BookShelf/index.module.scss b/components/BookShelf/index.module.scss index 889644f5..3006c6c3 100644 --- a/components/BookShelf/index.module.scss +++ b/components/BookShelf/index.module.scss @@ -20,4 +20,4 @@ justify-content: center; font-size: 14px; margin: 8px; -} \ No newline at end of file +} diff --git a/components/ContactForms/index.js b/components/ContactForms/index.js index 983fbb97..67f03517 100644 --- a/components/ContactForms/index.js +++ b/components/ContactForms/index.js @@ -137,7 +137,7 @@ export function TranslationForm() { - +