From 8e5bf57204c2a21fccdcff7bb8568daea3974499 Mon Sep 17 00:00:00 2001 From: Lauren Zugai Date: Wed, 10 Mar 2021 14:59:54 -0600 Subject: [PATCH] chore(project): Add Prettier, format files --- .prettierrc | 3 +++ babel.config.js | 2 +- docusaurus.config.js | 21 +++++++++--------- package.json | 5 ++++- sidebars.js | 52 +++++++++++++++++++++++++------------------- yarn.lock | 7 ++++-- 6 files changed, 53 insertions(+), 37 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..bf357fbbc --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "trailingComma": "all" +} diff --git a/babel.config.js b/babel.config.js index e00595dae..bfd75dbdf 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')], + presets: [require.resolve("@docusaurus/core/lib/babel/preset")], }; diff --git a/docusaurus.config.js b/docusaurus.config.js index ceaace3d8..94b005a34 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -11,7 +11,7 @@ module.exports = { themeConfig: { hideableSidebar: true, colorMode: { - defaultMode: 'light', + defaultMode: "light", disableSwitch: true, respectPrefersColorScheme: true, }, @@ -26,18 +26,18 @@ module.exports = { { href: "https://experimenter.services.mozilla.com/nimbus/", label: "Nimbus", - position: "right" + position: "right", }, { href: "https://mana.mozilla.org/wiki/display/FJT/Project+Nimbus", label: "Mana", - position: "right" + position: "right", }, { href: "https://github.com/mozilla/experimenter-docs", - position: 'right', - className: 'header-github-link', - 'aria-label': 'GitHub repository', + position: "right", + className: "header-github-link", + "aria-label": "GitHub repository", }, ], }, @@ -45,8 +45,8 @@ module.exports = { copyright: `Copyright © ${new Date().getFullYear()} Mozilla Corporation`, }, algolia: { - apiKey: 'cce683dfea9772207408c2b161a22641', - indexName: 'experimenter', + apiKey: "cce683dfea9772207408c2b161a22641", + indexName: "experimenter", }, }, presets: [ @@ -54,10 +54,9 @@ module.exports = { "@docusaurus/preset-classic", { docs: { - routeBasePath: '/', + routeBasePath: "/", sidebarPath: require.resolve("./sidebars.js"), - editUrl: - "https://github.com/mozilla/experimenter-docs/edit/main/", + editUrl: "https://github.com/mozilla/experimenter-docs/edit/main/", }, theme: { customCss: require.resolve("./src/css/custom.css"), diff --git a/package.json b/package.json index 0b94f51aa..10d0d199a 100644 --- a/package.json +++ b/package.json @@ -30,5 +30,8 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "prettier": "^2.2.1" } -} \ No newline at end of file +} diff --git a/sidebars.js b/sidebars.js index be013105b..7128a8400 100644 --- a/sidebars.js +++ b/sidebars.js @@ -8,84 +8,92 @@ module.exports = { { type: "link", label: "Nimbus Onboarding", - href: "https://mana.mozilla.org/wiki/display/FJT/Nimbus+Onboarding#NimbusOnboarding-Branches", + href: + "https://mana.mozilla.org/wiki/display/FJT/Nimbus+Onboarding#NimbusOnboarding-Branches", }, { type: "link", label: "How to Launch a Nimbus Experiment", - href: "https://mana.mozilla.org/wiki/display/FJT/How+to+Launch+a+Nimbus+Experiment", + href: + "https://mana.mozilla.org/wiki/display/FJT/How+to+Launch+a+Nimbus+Experiment", }, { type: "link", label: "Nimbus Data Transfer Object", - href: "https://mana.mozilla.org/wiki/pages/viewpage.action?pageId=130920248" + href: + "https://mana.mozilla.org/wiki/pages/viewpage.action?pageId=130920248", }, { type: "link", label: "Experiment Telemetry", - href: "https://mana.mozilla.org/wiki/display/FJT/Nimbus+Engineering#NimbusEngineering-ExperimentTelemetry" + href: + "https://mana.mozilla.org/wiki/display/FJT/Nimbus+Engineering#NimbusEngineering-ExperimentTelemetry", }, { type: "link", label: "Lessons Learned", - href: "https://mana.mozilla.org/wiki/display/FJT/Lessons+Learned+-+Experiment+Incidents+and+Close+Calls", + href: + "https://mana.mozilla.org/wiki/display/FJT/Lessons+Learned+-+Experiment+Incidents+and+Close+Calls", }, - ] + ], }, { - type: 'category', - label: 'Jetstream', + type: "category", + label: "Jetstream", items: [ { type: "link", label: "GitHub Repo", - href: "https://github.com/mozilla/jetstream" + href: "https://github.com/mozilla/jetstream", }, { type: "link", label: "Documentation", - href: "https://docs.telemetry.mozilla.org/datasets/jetstream.html" + href: "https://docs.telemetry.mozilla.org/datasets/jetstream.html", }, ], }, { - type: 'category', - label: 'Experiment Owners', + type: "category", + label: "Experiment Owners", items: ["experiment-owners-root"], }, { - type: 'category', - label: 'Fenix Engineers', + type: "category", + label: "Fenix Engineers", items: [ "fenix-engineers-root", { type: "link", label: "Android API (proposal)", - href: "https://docs.google.com/document/d/1kchihPal0__A4VOAiPJarNuZXns5KhOHHfIeIzT6zfU/edit#", + href: + "https://docs.google.com/document/d/1kchihPal0__A4VOAiPJarNuZXns5KhOHHfIeIzT6zfU/edit#", }, ], }, { - type: 'category', - label: 'Desktop Engineers', + type: "category", + label: "Desktop Engineers", items: [ "desktop-engineers-root", { type: "link", label: "Front-End Migration Guide", - href: "https://www.notion.so/Nimbus-Migration-Guide-for-Desktop-Front-End-Experiments-d36c21e505f84550aad1202897fc4ba3", + href: + "https://www.notion.so/Nimbus-Migration-Guide-for-Desktop-Front-End-Experiments-d36c21e505f84550aad1202897fc4ba3", }, { type: "link", label: "SDK Docs (X-Man draft)", - href: "https://docs.google.com/document/d/1ev75pG0nAM1lz53WuPQkWqykUlZMmZRbx8wzvvn5DhU/edit", + href: + "https://docs.google.com/document/d/1ev75pG0nAM1lz53WuPQkWqykUlZMmZRbx8wzvvn5DhU/edit", }, ], }, { - type: 'category', - label: 'Data Scientists', + type: "category", + label: "Data Scientists", items: ["data-scientists-root"], - } + }, ], }; diff --git a/yarn.lock b/yarn.lock index 8e7fd4a9a..d30a173b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7940,6 +7940,11 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== + pretty-error@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6" @@ -10027,10 +10032,8 @@ watchpack@^1.7.4: resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.7.5.tgz#1267e6c55e0b9b5be44c2023aed5437a2c26c453" integrity sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ== dependencies: - chokidar "^3.4.1" graceful-fs "^4.1.2" neo-async "^2.5.0" - watchpack-chokidar2 "^2.0.1" optionalDependencies: chokidar "^3.4.1" watchpack-chokidar2 "^2.0.1"