diff --git a/.editorconfig b/.editorconfig index 2c6f376d..117e8b3d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,9 +8,8 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[package.json] -indent_style = space -indent_size = 2 - [*.md] trim_trailing_whitespace = false + +[*.mdx] +trim_trailing_whitespace = false diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..2312dc58 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..c45c8c29 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,16 @@ +# Deep Directories +**/node_modules + +# Generated Directories +**/dist +**/.astro +**/__coverage__ + +# Directories +.changeset + +# Files +pnpm-lock.yaml +pre-commit +.prettierignore + diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..c50b2929 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,23 @@ +{ + "printWidth": 100, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "useTabs": false, + "plugins": ["prettier-plugin-astro"], + "overrides": [ + { + "files": [".*", "*.json", "*.md"], + "options": { + "useTabs": false + } + }, + { + "files": ["*.md", "*.mdx"], + "options": { + "printWidth": 80 + } + } + ] +} diff --git a/astro.config.mjs b/astro.config.mjs index bc759e49..2e91d7a9 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -12,18 +12,17 @@ export default defineConfig({ description: 'Contribute to freeCodeCamp.org', logo: { src: './public/icons/icon-96x96.png', - replacesTitle: true + replacesTitle: true, }, tableOfContents: true, defaultLocale: 'en', editLink: { - baseUrl: 'https://github.com/freeCodeCamp/contribute/edit/main/' + baseUrl: 'https://github.com/freeCodeCamp/contribute/edit/main/', }, social: { github: 'https://github.com/freeCodeCamp', twitter: 'https://twitter.com/freeCodeCamp', - discord: - 'https://discord.com/invite/freecodecamp-org-official-fi-fo-692816967895220344' + discord: 'https://discord.com/invite/freecodecamp-org-official-fi-fo-692816967895220344', }, sidebar: sidebar, components: { @@ -35,10 +34,10 @@ export default defineConfig({ // Relative path to your custom CSS file './src/styles/theme.css', ], - }) + }), ], output: 'hybrid', adapter: cloudflare({ - imageService: 'passthrough' - }) + imageService: 'passthrough', + }), }); diff --git a/package.json b/package.json index 4ea98307..0eacd522 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,12 @@ "start": "astro dev", "build": "astro check && astro build", "preview": "wrangler pages dev ./dist", - "astro": "astro" + "astro": "astro", + "format": "prettier -w --cache --plugin prettier-plugin-astro .", + "prepare": "husky" + }, + "lint-staged": { + "*": "prettier -w --cache --plugin prettier-plugin-astro ." }, "dependencies": { "@astrojs/check": "^0.5.10", @@ -17,6 +22,10 @@ "typescript": "^5.4.3" }, "devDependencies": { + "husky": "^9.0.11", + "lint-staged": "^15.2.2", + "prettier": "^3.2.5", + "prettier-plugin-astro": "^0.13.0", "wrangler": "^3.39.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7f80c70..4c899910 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,7 +7,7 @@ settings: dependencies: '@astrojs/check': specifier: ^0.5.10 - version: 0.5.10(typescript@5.4.3) + version: 0.5.10(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.4.3) '@astrojs/cloudflare': specifier: ^9.2.0 version: 9.2.1(astro@4.5.12) @@ -22,6 +22,18 @@ dependencies: version: 5.4.3 devDependencies: + husky: + specifier: ^9.0.11 + version: 9.0.11 + lint-staged: + specifier: ^15.2.2 + version: 15.2.2 + prettier: + specifier: ^3.2.5 + version: 3.2.5 + prettier-plugin-astro: + specifier: ^0.13.0 + version: 0.13.0 wrangler: specifier: ^3.39.0 version: 3.41.0 @@ -36,13 +48,13 @@ packages: '@jridgewell/trace-mapping': 0.3.25 dev: false - /@astrojs/check@0.5.10(typescript@5.4.3): + /@astrojs/check@0.5.10(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.4.3): resolution: {integrity: sha512-vliHXM9cu/viGeKiksUM4mXfO816ohWtawTl2ADPgTsd4nUMjFiyAl7xFZhF34yy4hq4qf7jvK1F2PlR3b5I5w==} hasBin: true peerDependencies: typescript: ^5.0.0 dependencies: - '@astrojs/language-server': 2.8.4(typescript@5.4.3) + '@astrojs/language-server': 2.8.4(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.4.3) chokidar: 3.6.0 fast-glob: 3.3.2 kleur: 4.1.5 @@ -73,6 +85,9 @@ packages: - utf-8-validate dev: false + /@astrojs/compiler@1.8.2: + resolution: {integrity: sha512-o/ObKgtMzl8SlpIdzaxFnt7SATKPxu4oIP/1NL+HDJRzxfJcAkOTAb/ZKMRyULbz4q+1t2/DAebs2Z1QairkZw==} + /@astrojs/compiler@2.7.0: resolution: {integrity: sha512-XpC8MAaWjD1ff6/IfkRq/5k1EFj6zhCNqXRd5J43SVJEBj/Bsmizkm8N0xOYscGcDFQkRgEw6/eKnI5x/1l6aA==} dev: false @@ -81,7 +96,7 @@ packages: resolution: {integrity: sha512-6B13lz5n6BrbTqCTwhXjJXuR1sqiX/H6rTxzlXx+lN1NnV4jgnq/KJldCQaUWJzPL5SiWahQyinxAbxQtwgPHA==} dev: false - /@astrojs/language-server@2.8.4(typescript@5.4.3): + /@astrojs/language-server@2.8.4(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.4.3): resolution: {integrity: sha512-sJH5vGTBkhgA8+hdhzX78UUp4cFz4Mt7xkEkevD188OS5bDMkaue6hK+dtXWM47mnrXFveXA2u38K7S+5+IRjA==} hasBin: true peerDependencies: @@ -101,10 +116,12 @@ packages: '@volar/language-service': 2.1.6 '@volar/typescript': 2.1.6 fast-glob: 3.3.2 + prettier: 3.2.5 + prettier-plugin-astro: 0.13.0 volar-service-css: 0.0.34(@volar/language-service@2.1.6) volar-service-emmet: 0.0.34(@volar/language-service@2.1.6) volar-service-html: 0.0.34(@volar/language-service@2.1.6) - volar-service-prettier: 0.0.34(@volar/language-service@2.1.6) + volar-service-prettier: 0.0.34(@volar/language-service@2.1.6)(prettier@3.2.5) volar-service-typescript: 0.0.34(@volar/language-service@2.1.6) volar-service-typescript-twoslash-queries: 0.0.34(@volar/language-service@2.1.6) vscode-html-languageservice: 5.1.2 @@ -1584,6 +1601,11 @@ packages: string-width: 4.2.3 dev: false + /ansi-escapes@6.2.1: + resolution: {integrity: sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==} + engines: {node: '>=14.16'} + dev: true + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1592,7 +1614,6 @@ packages: /ansi-regex@6.0.1: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} engines: {node: '>=12'} - dev: false /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} @@ -1611,7 +1632,6 @@ packages: /ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - dev: false /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} @@ -1926,7 +1946,6 @@ packages: /chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: false /character-entities-html4@2.1.0: resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} @@ -1984,13 +2003,20 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: restore-cursor: 4.0.0 - dev: false /cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} dev: false + /cli-truncate@4.0.0: + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} + engines: {node: '>=18'} + dependencies: + slice-ansi: 5.0.0 + string-width: 7.1.0 + dev: true + /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -2049,10 +2075,19 @@ packages: dev: false optional: true + /colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + dev: true + /comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} dev: false + /commander@11.1.0: + resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + engines: {node: '>=16'} + dev: true + /common-ancestor-path@1.0.1: resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} dev: false @@ -2077,7 +2112,6 @@ packages: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - dev: false /css-selector-parser@3.0.5: resolution: {integrity: sha512-3itoDFbKUNx1eKmVpYMFyqKX04Ww9osZ+dLgrk6GEv6KMVeXUhUnp4I5X+evw+u3ZxVU6RFXSSRxlTeMh8bA+g==} @@ -2195,7 +2229,6 @@ packages: /emoji-regex@10.3.0: resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} - dev: false /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2355,7 +2388,6 @@ packages: /eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} - dev: false /execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} @@ -2370,7 +2402,6 @@ packages: onetime: 6.0.0 signal-exit: 4.1.0 strip-final-newline: 3.0.0 - dev: false /exit-hook@2.2.1: resolution: {integrity: sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==} @@ -2497,7 +2528,6 @@ packages: /get-east-asian-width@1.2.0: resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} engines: {node: '>=18'} - dev: false /get-source@2.0.12: resolution: {integrity: sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==} @@ -2508,7 +2538,6 @@ packages: /get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} - dev: false /github-from-package@0.0.0: resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} @@ -2847,7 +2876,12 @@ packages: /human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - dev: false + + /husky@9.0.11: + resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} + engines: {node: '>=18'} + hasBin: true + dev: true /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} @@ -2932,6 +2966,18 @@ packages: engines: {node: '>=8'} dev: false + /is-fullwidth-code-point@4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + dev: true + + /is-fullwidth-code-point@5.0.0: + resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + engines: {node: '>=18'} + dependencies: + get-east-asian-width: 1.2.0 + dev: true + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -2973,7 +3019,6 @@ packages: /is-stream@3.0.0: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: false /is-unicode-supported@1.3.0: resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} @@ -2989,7 +3034,6 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: false /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -3041,6 +3085,42 @@ packages: engines: {node: '>=6'} dev: false + /lilconfig@3.0.0: + resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==} + engines: {node: '>=14'} + dev: true + + /lint-staged@15.2.2: + resolution: {integrity: sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==} + engines: {node: '>=18.12.0'} + hasBin: true + dependencies: + chalk: 5.3.0 + commander: 11.1.0 + debug: 4.3.4 + execa: 8.0.1 + lilconfig: 3.0.0 + listr2: 8.0.1 + micromatch: 4.0.5 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /listr2@8.0.1: + resolution: {integrity: sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==} + engines: {node: '>=18.0.0'} + dependencies: + cli-truncate: 4.0.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 6.0.0 + rfdc: 1.3.1 + wrap-ansi: 9.0.0 + dev: true + /load-yaml-file@0.2.0: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} @@ -3080,6 +3160,17 @@ packages: is-unicode-supported: 1.3.0 dev: false + /log-update@6.0.0: + resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==} + engines: {node: '>=18'} + dependencies: + ansi-escapes: 6.2.1 + cli-cursor: 4.0.0 + slice-ansi: 7.1.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 + dev: true + /longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} dev: false @@ -3339,7 +3430,6 @@ packages: /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - dev: false /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -3698,7 +3788,6 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 - dev: false /mime@3.0.0: resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} @@ -3708,12 +3797,10 @@ packages: /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} - dev: false /mimic-fn@4.0.0: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} - dev: false /mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} @@ -3845,7 +3932,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: path-key: 4.0.0 - dev: false /nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} @@ -3866,14 +3952,12 @@ packages: engines: {node: '>=6'} dependencies: mimic-fn: 2.1.0 - dev: false /onetime@6.0.0: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} dependencies: mimic-fn: 4.0.0 - dev: false /ora@7.0.1: resolution: {integrity: sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==} @@ -4016,12 +4100,10 @@ packages: /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - dev: false /path-key@4.0.0: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} engines: {node: '>=12'} - dev: false /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -4045,6 +4127,12 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + /pidtree@0.6.0: + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + /pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} @@ -4115,6 +4203,19 @@ packages: which-pm: 2.0.0 dev: false + /prettier-plugin-astro@0.13.0: + resolution: {integrity: sha512-5HrJNnPmZqTUNoA97zn4gNQv9BgVhv+et03314WpQ9H9N8m2L9OSV798olwmG2YLXPl1iSstlJCR1zB3x5xG4g==} + engines: {node: ^14.15.0 || >=16.0.0} + dependencies: + '@astrojs/compiler': 1.8.2 + prettier: 3.2.5 + sass-formatter: 0.7.9 + + /prettier@3.2.5: + resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + engines: {node: '>=14'} + hasBin: true + /printable-characters@1.0.42: resolution: {integrity: sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==} @@ -4321,7 +4422,6 @@ packages: dependencies: onetime: 5.1.2 signal-exit: 3.0.7 - dev: false /retext-latin@3.1.0: resolution: {integrity: sha512-5MrD1tuebzO8ppsja5eEu+ZbBeUNCjoEarn70tkXOS7Bdsdf6tNahsv2bY0Z8VooFF6cw7/6S+d3yI/TMlMVVQ==} @@ -4363,6 +4463,10 @@ packages: engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: false + /rfdc@1.3.1: + resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==} + dev: true + /rollup-plugin-inject@3.0.2: resolution: {integrity: sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==} deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject. @@ -4413,10 +4517,18 @@ packages: queue-microtask: 1.2.3 dev: false + /s.color@0.0.15: + resolution: {integrity: sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==} + /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: false + /sass-formatter@0.7.9: + resolution: {integrity: sha512-CWZ8XiSim+fJVG0cFLStwDvft1VI7uvXdCNJYXhDvowiv+DsbD1nXLiQ4zrE5UBvj5DWZJ93cwN0NX5PMsr1Pw==} + dependencies: + suf-log: 2.5.3 + /sax@1.3.0: resolution: {integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==} dev: false @@ -4471,12 +4583,10 @@ packages: engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 - dev: false /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - dev: false /shiki@1.1.7: resolution: {integrity: sha512-9kUTMjZtcPH3i7vHunA6EraTPpPOITYTdA5uMrvsJRexktqP0s7P3s9HVK80b4pP42FRVe03D7fT3NmJv2yYhw==} @@ -4496,12 +4606,10 @@ packages: /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: false /signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - dev: false /simple-concat@1.0.1: resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} @@ -4542,6 +4650,22 @@ packages: sax: 1.3.0 dev: false + /slice-ansi@5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + dev: true + + /slice-ansi@7.1.0: + resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + engines: {node: '>=18'} + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + dev: true + /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -4604,6 +4728,11 @@ packages: dev: false optional: true + /string-argv@0.3.2: + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} + engines: {node: '>=0.6.19'} + dev: true + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -4638,7 +4767,6 @@ packages: emoji-regex: 10.3.0 get-east-asian-width: 1.2.0 strip-ansi: 7.1.0 - dev: false /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} @@ -4665,7 +4793,6 @@ packages: engines: {node: '>=12'} dependencies: ansi-regex: 6.0.1 - dev: false /strip-bom-string@1.0.0: resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==} @@ -4680,7 +4807,6 @@ packages: /strip-final-newline@3.0.0: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} - dev: false /strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} @@ -4701,6 +4827,11 @@ packages: inline-style-parser: 0.2.2 dev: false + /suf-log@2.5.3: + resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==} + dependencies: + s.color: 0.0.15 + /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -5121,7 +5252,7 @@ packages: vscode-uri: 3.0.8 dev: false - /volar-service-prettier@0.0.34(@volar/language-service@2.1.6): + /volar-service-prettier@0.0.34(@volar/language-service@2.1.6)(prettier@3.2.5): resolution: {integrity: sha512-BNfJ8FwfPi1Wm/JkuzNjraOLdtKieGksNT/bDyquygVawv1QUzO2HB1hiMKfZGdcSFG5ZL9R0j7bBfRTfXA2gg==} peerDependencies: '@volar/language-service': ~2.1.0 @@ -5133,6 +5264,7 @@ packages: optional: true dependencies: '@volar/language-service': 2.1.6 + prettier: 3.2.5 vscode-uri: 3.0.8 dev: false @@ -5251,7 +5383,6 @@ packages: hasBin: true dependencies: isexe: 2.0.0 - dev: false /widest-line@4.0.1: resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==} @@ -5336,6 +5467,15 @@ packages: strip-ansi: 7.1.0 dev: false + /wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + dependencies: + ansi-styles: 6.2.1 + string-width: 7.1.0 + strip-ansi: 7.1.0 + dev: true + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} requiresBuild: true @@ -5371,6 +5511,11 @@ packages: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: false + /yaml@2.3.4: + resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} + engines: {node: '>= 14'} + dev: true + /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} diff --git a/src/components/FCCHeader.astro b/src/components/FCCHeader.astro index 83bccc7d..94408901 100644 --- a/src/components/FCCHeader.astro +++ b/src/components/FCCHeader.astro @@ -1,98 +1,94 @@ --- //import config from '@astrojs/starlight/user-config'; - import type { Props } from '@astrojs/starlight/props'; - import LanguageSelect from '@astrojs/starlight/components/LanguageSelect.astro'; import Search from '@astrojs/starlight/components/Search.astro'; import SocialIcons from '@astrojs/starlight/components/SocialIcons.astro'; import FCCThemeSelect from './FCCThemeSelect.astro'; - /** * Render the `Search` component if Pagefind is enabled or the default search component has been overridden. */ const shouldRenderSearch = true; - //config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro'; +//config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro'; ---
- -
- {shouldRenderSearch && } -
- - - freeCodeCamp.org - - -
- - - +
+ {shouldRenderSearch && } +
+ + + freeCodeCamp.org + + +
+ + + +
diff --git a/src/components/FCCThemeProvider.astro b/src/components/FCCThemeProvider.astro index fa4aa282..460654a4 100644 --- a/src/components/FCCThemeProvider.astro +++ b/src/components/FCCThemeProvider.astro @@ -4,18 +4,18 @@ import type { Props } from '@astrojs/starlight/props'; {/* This is intentionally inlined to avoid FOUC. */} diff --git a/src/components/FCCThemeSelect.astro b/src/components/FCCThemeSelect.astro index f5abaa1c..064179ac 100644 --- a/src/components/FCCThemeSelect.astro +++ b/src/components/FCCThemeSelect.astro @@ -4,75 +4,76 @@ import type { Props } from '@astrojs/starlight/props'; const { labels } = Astro.props; --- + - + {/* Inlined to avoid FOUC. Uses global scope from `ThemeProvider.astro` */} diff --git a/src/content/config.ts b/src/content/config.ts index 414c5dac..31b74762 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -2,5 +2,5 @@ import { defineCollection } from 'astro:content'; import { docsSchema } from '@astrojs/starlight/schema'; export const collections = { - docs: defineCollection({ schema: docsSchema() }) + docs: defineCollection({ schema: docsSchema() }), }; diff --git a/src/content/docs/codebase-best-practices.md b/src/content/docs/codebase-best-practices.md index b282126d..47b11201 100644 --- a/src/content/docs/codebase-best-practices.md +++ b/src/content/docs/codebase-best-practices.md @@ -106,7 +106,7 @@ type ReducerBase = { type: T }; type ReducerPayload = T extends AppActionTypes.actionFunction ? ReducerBase & { - payload: AppState["property"]; + payload: AppState['property']; } : ReducerBase; diff --git a/src/content/docs/curriculum-help.md b/src/content/docs/curriculum-help.md index d6153952..3f7b51b5 100644 --- a/src/content/docs/curriculum-help.md +++ b/src/content/docs/curriculum-help.md @@ -118,7 +118,9 @@ Then the returned value of `helper.getCSSRules('media')` would be this array: You can then test that the camper has written the correct media query: ```js -const hasCorrectHeight = helper.getCSSRules('media').some(x => x.style.height === '3px');; +const hasCorrectHeight = helper + .getCSSRules('media') + .some((x) => x.style.height === '3px'); assert.isTrue(hasCorrectHeight); ``` diff --git a/src/content/docs/how-to-add-playwright-tests.md b/src/content/docs/how-to-add-playwright-tests.md index 153da8c5..f6d0b9fc 100644 --- a/src/content/docs/how-to-add-playwright-tests.md +++ b/src/content/docs/how-to-add-playwright-tests.md @@ -29,7 +29,7 @@ Always start with necessary imports at the beginning of the file. For example: ```ts -import { test, expect, type Page } from "@playwright/test"; +import { test, expect, type Page } from '@playwright/test'; ``` ### Identifying a DOM element @@ -42,8 +42,8 @@ Playwright comes with [multiple built-in locators](https://playwright.dev/docs/l For example: ```ts -await expect(page.getByRole("heading", { name: "Sign up" })).toBeVisible(); -await expect(page.getByText("Hello World")).toBeVisible(); +await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible(); +await expect(page.getByText('Hello World')).toBeVisible(); ``` In cases where the elements cannot be queried using the above-mentioned locators, you can use the `data-playwright-test-label` attribute as the last resort. This attribute should be used only in Playwright tests, and not for styling or any other purposes. @@ -61,7 +61,7 @@ In the test file, you can use the `getByTestId` method to identify the element. For example: ```ts -await expect(page.getByTestId("landing-page-figure")).toBeVisible(); +await expect(page.getByTestId('landing-page-figure')).toBeVisible(); ``` ### Constants @@ -82,7 +82,7 @@ Each test block should have a clear and concise name describing exactly what it' For example: ```ts -test("The component landing-top renders correctly", async ({ page }) => { +test('The component landing-top renders correctly', async ({ page }) => { // ... }); ``` @@ -118,10 +118,12 @@ Use the `isMobile` argument to test logic that is specific to mobile devices. For example: ```ts -test("The campers landing page figure is visible on desktop and hidden on mobile view", async ({ +test('The campers landing page figure is visible on desktop and hidden on mobile view', async ({ isMobile, }) => { - const landingPageImage = page.getByRole('img', { name: 'landing-page-figure' }); + const landingPageImage = page.getByRole('img', { + name: 'landing-page-figure', + }); if (isMobile) { await expect(landingPageImage).toBeHidden(); @@ -138,14 +140,14 @@ Group related tests together using describe blocks. This makes it easier to unde For example: ```ts -describe("The campers landing page", () => { - test("The campers landing page figure is visible on desktop and hidden on mobile view", async ({ +describe('The campers landing page', () => { + test('The campers landing page figure is visible on desktop and hidden on mobile view', async ({ isMobile, }) => { // ... }); - test("The campers landing page figure has the correct image", async () => { + test('The campers landing page figure has the correct image', async () => { // ... }); }); diff --git a/src/content/docs/how-to-enable-new-languages.md b/src/content/docs/how-to-enable-new-languages.md index 3e67b2e2..1710b133 100644 --- a/src/content/docs/how-to-enable-new-languages.md +++ b/src/content/docs/how-to-enable-new-languages.md @@ -58,7 +58,7 @@ You will need to add a step to the [`crowdin-download.client-ui.yml`](https://gi create_pull_request: false # global options - config: "./crowdin-config.yml" + config: './crowdin-config.yml' base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }} # Uncomment below to debug @@ -191,24 +191,24 @@ If you were to add Dothraki: ```js const algoliaIndices = { english: { - name: "news", - searchPage: "https://www.freecodecamp.org/news/search/", + name: 'news', + searchPage: 'https://www.freecodecamp.org/news/search/', }, espanol: { - name: "news-es", - searchPage: "https://www.freecodecamp.org/espanol/news/search/", + name: 'news-es', + searchPage: 'https://www.freecodecamp.org/espanol/news/search/', }, chinese: { - name: "news-zh", - searchPage: "https://chinese.freecodecamp.org/news/search/", + name: 'news-zh', + searchPage: 'https://chinese.freecodecamp.org/news/search/', }, - "chinese-traditional": { - name: "news-zh", - searchPage: "https://chinese.freecodecamp.org/news/search", + 'chinese-traditional': { + name: 'news-zh', + searchPage: 'https://chinese.freecodecamp.org/news/search', }, dothraki: { - name: "news", - searchPage: "https://www.freecodecamp.org/news/search/", + name: 'news', + searchPage: 'https://www.freecodecamp.org/news/search/', }, // If we already have /news in the target language up and running, you can update the values like this: @@ -358,12 +358,12 @@ Then copy the contents of the [`english.yaml`](https://github.com/freeCodeCamp/c The contents will look something like this: ```yaml -article0title: "Learn JavaScript" -article0link: "https://www.freecodecamp.org/news/learn-javascript-free-js-courses-for-beginners/" -article1title: "Linux ln Example" -article1link: "https://www.freecodecamp.org/news/linux-ln-how-to-create-a-symbolic-link-in-linux-example-bash-command" -article2title: "JS document.ready()" -article2link: "https://www.freecodecamp.org/news/javascript-document-ready-jquery-example/" +article0title: 'Learn JavaScript' +article0link: 'https://www.freecodecamp.org/news/learn-javascript-free-js-courses-for-beginners/' +article1title: 'Linux ln Example' +article1link: 'https://www.freecodecamp.org/news/linux-ln-how-to-create-a-symbolic-link-in-linux-example-bash-command' +article2title: 'JS document.ready()' +article2link: 'https://www.freecodecamp.org/news/javascript-document-ready-jquery-example/' article3title: ... article3link: ... ... @@ -389,21 +389,21 @@ Copy the Day.js locale code from the new tab into the new file you created. For ```js !(function (e, n) { - "object" == typeof exports && "undefined" != typeof module + 'object' == typeof exports && 'undefined' != typeof module ? (module.exports = n()) - : "function" == typeof define && define.amd - ? define(n) - : (e.dayjs_locale_en = n()); + : 'function' == typeof define && define.amd + ? define(n) + : (e.dayjs_locale_en = n()); })(this, function () { - "use strict"; + 'use strict'; return { - name: "en", - weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split( - "_" + name: 'en', + weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( + '_' ), months: - "January_February_March_April_May_June_July_August_September_October_November_December".split( - "_" + 'January_February_March_April_May_June_July_August_September_October_November_December'.split( + '_' ), }; }); @@ -435,22 +435,22 @@ If you are unsure about the string to use while setting `algoliaIndices`, send a For example, if you are launching Dothraki News, here are what the objects / arrays above should look like: ```js -const locales = ["arabic", "bengali", "chinese", "english", "dothraki"]; +const locales = ['arabic', 'bengali', 'chinese', 'english', 'dothraki']; const localeCodes = { - arabic: "ar", - bengali: "bn", - chinese: "zh", - english: "en", - dothraki: "mis", + arabic: 'ar', + bengali: 'bn', + chinese: 'zh', + english: 'en', + dothraki: 'mis', }; const algoliaIndices = { - arabic: "news-ar", - bengali: "news-bn", - chinese: "news-zh", - english: "news", - dothraki: "news-mis", + arabic: 'news-ar', + bengali: 'news-bn', + chinese: 'news-zh', + english: 'news', + dothraki: 'news-mis', }; ``` diff --git a/src/content/docs/how-to-help-with-video-challenges.md b/src/content/docs/how-to-help-with-video-challenges.md index 19b12eff..df2c9177 100644 --- a/src/content/docs/how-to-help-with-video-challenges.md +++ b/src/content/docs/how-to-help-with-video-challenges.md @@ -19,7 +19,7 @@ Below is a template of what the challenge markdown files look like. id: Unique identifier (alphanumerical, MongoDB_id) title: Challenge Title challengeType: 11 -videoId: "YouTube videoId for video challenge" +videoId: 'YouTube videoId for video challenge' forumTopicId: 12345 --- @@ -141,7 +141,7 @@ Add/Update answers (`Answer 1`, `Answer 2`, and so on) under `## --answers--`. M What does this JavaScript code log to the console? ```js -console.log("hello world"); +console.log('hello world'); ``` ## --answers-- diff --git a/src/content/docs/how-to-work-on-coding-challenges.md b/src/content/docs/how-to-work-on-coding-challenges.md index ad4615b6..76130933 100644 --- a/src/content/docs/how-to-work-on-coding-challenges.md +++ b/src/content/docs/how-to-work-on-coding-challenges.md @@ -38,9 +38,9 @@ The practice projects have some additional tooling to help create new projects a ````md --- id: Unique identifier (alphanumerical, MongoDB_id) -title: "Challenge Title" +title: 'Challenge Title' challengeType: Integer, defined in `client/utils/challenge-types.js` -videoUrl: "url of video explanation" +videoUrl: 'url of video explanation' forumTopicId: 12345 --- @@ -68,8 +68,8 @@ If you want dynamic output based on the user's code, --fcc-expected-- and --fcc- ```js assert.equal( - "this will replace --fcc-actual--", - "this will replace --fcc-expected--" + 'this will replace --fcc-actual--', + 'this will replace --fcc-expected--' ); ``` @@ -113,7 +113,7 @@ body { ``` ```js -console.log("freeCodeCamp is awesome!"); +console.log('freeCodeCamp is awesome!'); ``` # --solutions-- @@ -486,7 +486,7 @@ class MyComponent extends React.Component { constructor(props) { super(props); this.state = { - text: "Hello", + text: 'Hello', }; // Change code below this line @@ -494,7 +494,7 @@ class MyComponent extends React.Component { } handleClick() { this.setState({ - text: "You clicked!", + text: 'You clicked!', }); } render() { @@ -577,7 +577,7 @@ Hint goes here ```js function myFunc() { - console.log("Hello World!"); + console.log('Hello World!'); } ``` diff --git a/src/content/docs/how-to-work-on-localized-client-webapp.md b/src/content/docs/how-to-work-on-localized-client-webapp.md index aecfcf9e..0216e12f 100644 --- a/src/content/docs/how-to-work-on-localized-client-webapp.md +++ b/src/content/docs/how-to-work-on-localized-client-webapp.md @@ -114,13 +114,13 @@ If you are working on a feature or a bug for the client web app, say for example ### Functional Component ```js -import { useTranslation } from "react-i18next"; +import { useTranslation } from 'react-i18next'; // in the render method: const { t } = useTranslation(); // call the "t" function with a key from the JSON file: -

{t("key")}

; // more details below +

{t('key')}

; // more details below ``` ### Class Component diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 1e3924b7..428cee09 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -13,7 +13,7 @@ hero: variant: primary --- -import { Card, CardGrid } from "@astrojs/starlight/components"; +import { Card, CardGrid } from '@astrojs/starlight/components'; ## Next steps: diff --git a/src/content/docs/language-lead-handbook.md b/src/content/docs/language-lead-handbook.md index ac47d454..36c49e65 100644 --- a/src/content/docs/language-lead-handbook.md +++ b/src/content/docs/language-lead-handbook.md @@ -32,7 +32,7 @@ The original author and the original article are linked automatically adding thi ```html ``` @@ -49,18 +49,18 @@ To update the trending articles in the footer, you need to update the [yaml file For example, here is the file content for the first 6 articles: ```yaml -article0title: "Unire CSV con Python" -article0link: "https://www.freecodecamp.org/italian/news/come-combinare-file-multipli-in-formato-csv-con-8-righe-di-codice/" -article1title: "Il comando Git push" -article1link: "https://www.freecodecamp.org/italian/news/il-comando-git-push-spiegato/" -article2title: "Centrare immagini in CSS" -article2link: "https://www.freecodecamp.org/italian/news/come-centrare-un-immagine-usando/" -article3title: "I codici Alt" -article3link: "https://www.freecodecamp.org/italian/news/codici-alt/" -article4title: "Tenere a bada il footer" -article4link: "https://www.freecodecamp.org/italian/news/come-mantenere-il-footer-al-suo-posto/" -article5title: "Cosa è API?" -article5link: "https://www.freecodecamp.org/italian/news/cose-un-api-in-italiano-per-favore/" +article0title: 'Unire CSV con Python' +article0link: 'https://www.freecodecamp.org/italian/news/come-combinare-file-multipli-in-formato-csv-con-8-righe-di-codice/' +article1title: 'Il comando Git push' +article1link: 'https://www.freecodecamp.org/italian/news/il-comando-git-push-spiegato/' +article2title: 'Centrare immagini in CSS' +article2link: 'https://www.freecodecamp.org/italian/news/come-centrare-un-immagine-usando/' +article3title: 'I codici Alt' +article3link: 'https://www.freecodecamp.org/italian/news/codici-alt/' +article4title: 'Tenere a bada il footer' +article4link: 'https://www.freecodecamp.org/italian/news/come-mantenere-il-footer-al-suo-posto/' +article5title: 'Cosa è API?' +article5link: 'https://www.freecodecamp.org/italian/news/cose-un-api-in-italiano-per-favore/' ``` Each number represents one of the 30 articles in the footer. Make sure to match the title and the link correctly. diff --git a/src/sidebar.ts b/src/sidebar.ts index a694ed0b..c9cc3f98 100644 --- a/src/sidebar.ts +++ b/src/sidebar.ts @@ -5,173 +5,173 @@ export const sidebar = [ { label: 'Introduction', link: '/intro', - description: 'Contribute to the freeCodeCamp.org Community' + description: 'Contribute to the freeCodeCamp.org Community', }, { label: 'Frequently Asked Questions', - link: '/faq' + link: '/faq', }, { label: 'Reporting a Vulnerability', - link: 'security' - } - ] + link: 'security', + }, + ], }, { label: 'Translation Contribution', items: [ { label: 'Work on translating resources', - link: 'how-to-translate-files' + link: 'how-to-translate-files', }, { label: 'Work on proofreading translations', - link: 'how-to-proofread-files' - } - ] + link: 'how-to-proofread-files', + }, + ], }, { label: 'Code Contribution', items: [ { label: 'Set up freeCodeCamp', - link: 'how-to-setup-freecodecamp-locally' + link: 'how-to-setup-freecodecamp-locally', }, { label: 'Follow best-practices', - link: 'codebase-best-practices' + link: 'codebase-best-practices', }, { label: 'Work on Codebase', - link: 'how-to-contribute-to-the-codebase' + link: 'how-to-contribute-to-the-codebase', }, { label: 'Work on Coding Challenges', - link: 'how-to-work-on-coding-challenges' + link: 'how-to-work-on-coding-challenges', }, { label: 'Use the Curriculum Helpers', - link: 'curriculum-help' + link: 'curriculum-help', }, { label: 'Work on Component Library', - link: 'how-to-work-on-the-component-library' + link: 'how-to-work-on-the-component-library', }, { label: 'Work on Practice Projects', - link: 'how-to-work-on-practice-projects' + link: 'how-to-work-on-practice-projects', }, { label: 'Work on Mobile app', - link: 'how-to-setup-freecodecamp-mobile-app-locally' + link: 'how-to-setup-freecodecamp-mobile-app-locally', }, { label: 'Work on tutorials with CodeRoad', - link: 'how-to-work-on-tutorials-that-use-coderoad' + link: 'how-to-work-on-tutorials-that-use-coderoad', }, { label: 'Work on Localized Web App', - link: 'how-to-work-on-localized-client-webapp' + link: 'how-to-work-on-localized-client-webapp', }, { label: 'Work on Playwright Tests', - link: 'how-to-add-playwright-tests' + link: 'how-to-add-playwright-tests', }, { label: 'Work on Video Challenges', - link: 'how-to-help-with-video-challenges' + link: 'how-to-help-with-video-challenges', }, { label: 'Work on Documentation', - link: 'how-to-work-on-the-docs-theme' + link: 'how-to-work-on-the-docs-theme', }, { label: 'Open a pull request', - link: 'how-to-open-a-pull-request' - } - ] + link: 'how-to-open-a-pull-request', + }, + ], }, { label: 'Additional Guides', items: [ { label: 'Understand the curriculum file structure', - link: 'curriculum-file-structure' + link: 'curriculum-file-structure', }, { label: 'Debug outgoing emails locally', - link: 'how-to-catch-outgoing-emails-locally' + link: 'how-to-catch-outgoing-emails-locally', }, { label: 'Work on Cypress Tests', - link: 'how-to-add-cypress-tests' + link: 'how-to-add-cypress-tests', }, { label: 'Set up freeCodeCamp on Windows (WSL)', - link: 'how-to-setup-wsl' + link: 'how-to-setup-wsl', }, { label: 'Use Docker on Windows Home', - link: 'how-to-use-docker-on-windows-home' + link: 'how-to-use-docker-on-windows-home', }, { label: 'User Token Workflow', - link: 'user-token-workflow' + link: 'user-token-workflow', }, { label: 'Troubleshooting Development Issues', - link: 'troubleshooting-development-issues' + link: 'troubleshooting-development-issues', }, { label: 'Authors Analytics Manual', - link: 'authors-analytics-manual' - } - ] + link: 'authors-analytics-manual', + }, + ], }, { label: 'Flight Manuals (for Staff & Mods)', items: [ { label: 'Moderator Handbook', - link: 'moderator-handbook' + link: 'moderator-handbook', }, { label: 'Reply Templates', - link: 'reply-templates' + link: 'reply-templates', }, { label: 'Language Lead Handbook', - link: 'language-lead-handbook' + link: 'language-lead-handbook', }, { label: 'DevOps Handbook', - link: 'devops' + link: 'devops', }, { label: 'Courses VSCode Extension', - link: 'courses-vscode-extension' + link: 'courses-vscode-extension', }, { label: 'Enable New Language', - link: 'how-to-enable-new-languages' - } - ] + link: 'how-to-enable-new-languages', + }, + ], }, { label: 'Our Community', items: [ { label: 'GitHub', - link: 'https://github.com/freecodecamp/freecodecamp' + link: 'https://github.com/freecodecamp/freecodecamp', }, { label: 'Discourse Forum', - link: 'https://freecodecamp.org/forum/c/contributors' + link: 'https://freecodecamp.org/forum/c/contributors', }, { label: 'Chat Server', - link: 'https://discord.gg/PRyKn3Vbay' - } - ] - } + link: 'https://discord.gg/PRyKn3Vbay', + }, + ], + }, ]; diff --git a/src/styles/theme.css b/src/styles/theme.css index 34e5ea75..764adea7 100644 --- a/src/styles/theme.css +++ b/src/styles/theme.css @@ -3,7 +3,7 @@ --sl-color-bg-nav: #0a0a23; } -:root[data-theme="light"], -[data-theme="light"] ::backdrop { +:root[data-theme='light'], +[data-theme='light'] ::backdrop { --sl-color-bg-nav: #0a0a23; } diff --git a/tsconfig.json b/tsconfig.json index 77da9dd0..bcbf8b50 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { "extends": "astro/tsconfigs/strict" -} \ No newline at end of file +}