Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
module.exports = {
singleQuote: true,
trailingComma: 'es5',
overrides: [
{
files: 'src/utils/path.js',
options: {
// New versions of Prettier rewrite Flow comments to non-comments, but
// this is a problem in this file because it contains a Flow comment
// that's not parsed properly by Babel.
// This file uses Flow in a way that's Typescript compatible, so we can
// use a typescript parser. This typescript parser doesn't rewrite
// comments, so it works in this case.
parser: 'babel-ts',
},
},
{
files: 'bin/*.js',
options: {
// Files in bin/ are javascript files that may use Flow comments. We
// don't want the content of these Flow comments to be output outside of
// comments so that the file can still be run directly with node.
parser: 'espree',
},
},
],
};
2 changes: 1 addition & 1 deletion bin/l10n-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const readline = require('readline');
const { promisify } = require('util');

/**
* @typeef {Object} ExecFilePromiseResult
* @typedef {Object} ExecFilePromiseResult
* @property {string | Buffer} stdout
* @property {string | Buffer} stderr
*/
Expand Down
27 changes: 17 additions & 10 deletions bin/pre-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*:: type AgentsVersion = { [agentName: string]: string }; */
/**
* @typedef {Object.<string, string>} AgentsVersion
*/

/*
* This file is run when a user runs `yarn install`, before doing anything else.
Expand All @@ -21,13 +23,12 @@ function checkVersions() {
return;
}

const agents /*: AgentsVersion */ = userAgent
.split(' ')
.reduce((agents, agent) => {
const [key, value] = agent.split('/');
agents[key] = value;
return agents;
}, {});
/** @type {AgentsVersion} */
const agents = userAgent.split(' ').reduce((agents, agent) => {
const [key, value] = agent.split('/');
agents[key] = value;
return agents;
}, {});

const checks = [checkNode(agents), checkYarn(agents)];

Expand All @@ -47,7 +48,10 @@ function versionCompare(a, b) {
return a.localeCompare(b, undefined, { numeric: true });
}

function checkNode(agents /*: AgentsVersion */) {
/**
* @param {AgentsVersion} agents
*/
function checkNode(agents) {
// Node versions usually have a starting `v`.
const nodeVersion = agents.node.replace(/^v/, '');
const expectedNodeVersion = parseExpectedNodeVersion();
Expand Down Expand Up @@ -75,7 +79,10 @@ function checkNode(agents /*: AgentsVersion */) {
return true;
}

function checkYarn(agents /*: AgentsVersion */) {
/**
* @param {AgentsVersion} agents
*/
function checkYarn(agents) {
if (!('yarn' in agents)) {
console.error(
'This project uses Yarn instead of npm, please run `yarn install` instead of `npm install`.\n'
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,9 @@
"eslint-plugin-jest-formatting": "^3.1.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-testing-library": "^7.13.4",
"espree": "^11.0.0",
"fake-indexeddb": "^6.2.5",
"fetch-mock": "^12.6.0",
"file-loader": "^6.2.0",
"glob": "^12.0.0",
"globals": "^16.5.0",
"html-webpack-plugin": "^5.6.5",
"husky": "^4.3.8",
Expand All @@ -178,7 +176,6 @@
"postcss-loader": "^8.2.0",
"postinstall-postinstall": "^2.1.0",
"prettier": "^3.6.2",
"raw-loader": "^4.0.2",
"rimraf": "^6.1.0",
"style-loader": "^4.0.0",
"stylelint": "^16.25.0",
Expand Down
68 changes: 29 additions & 39 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5185,11 +5185,6 @@ eslint-visitor-keys@^4.2.1:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1"
integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==

eslint-visitor-keys@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-5.0.0.tgz#b9aa1a74aa48c44b3ae46c1597ce7171246a94a9"
integrity sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q==

eslint@^9.39.1:
version "9.39.1"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.39.1.tgz#be8bf7c6de77dcc4252b5a8dcb31c2efff74a6e5"
Expand Down Expand Up @@ -5239,15 +5234,6 @@ espree@^10.0.1, espree@^10.4.0:
acorn-jsx "^5.3.2"
eslint-visitor-keys "^4.2.1"

espree@^11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-11.0.0.tgz#2fa56e7b9d3091a618526307f8cab8f5624debbf"
integrity sha512-+gMeWRrIh/NsG+3NaLeWHuyeyk70p2tbvZIWBYcqQ4/7Xvars6GYTZNhF1sIeLcc6Wb11He5ffz3hsHyXFrw5A==
dependencies:
acorn "^8.15.0"
acorn-jsx "^5.3.2"
eslint-visitor-keys "^5.0.0"

esprima@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
Expand Down Expand Up @@ -5892,18 +5878,6 @@ glob@^11.0.3:
package-json-from-dist "^1.0.0"
path-scurry "^2.0.0"

glob@^12.0.0:
version "12.0.0"
resolved "https://registry.yarnpkg.com/glob/-/glob-12.0.0.tgz#4f75198719ab443ea433fdc023629b853532a443"
integrity sha512-5Qcll1z7IKgHr5g485ePDdHcNQY0k2dtv/bjYy0iuyGxQw2qSOiiXUXJ+AYQpg3HNoUMHqAruX478Jeev7UULw==
dependencies:
foreground-child "^3.3.1"
jackspeak "^4.1.1"
minimatch "^10.1.1"
minipass "^7.1.2"
package-json-from-dist "^1.0.0"
path-scurry "^2.0.0"

glob@^7.1.1, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
Expand Down Expand Up @@ -9117,7 +9091,7 @@ minimalistic-assert@^1.0.0:
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==

minimatch@^10.0.3, minimatch@^10.1.1:
minimatch@^10.0.3:
version "10.1.1"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.1.1.tgz#e6e61b9b0c1dcab116b5a7d1458e8b6ae9e73a55"
integrity sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==
Expand Down Expand Up @@ -10537,14 +10511,6 @@ [email protected], raw-body@^2.3.3:
iconv-lite "0.4.24"
unpipe "1.0.0"

raw-loader@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.2.tgz#1aac6b7d1ad1501e66efdac1522c73e59a584eb6"
integrity sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==
dependencies:
loader-utils "^2.0.0"
schema-utils "^3.0.0"

[email protected], rc@^1.2.8:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
Expand Down Expand Up @@ -11749,7 +11715,16 @@ string-length@^4.0.2:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -11871,7 +11846,7 @@ stringify-object@^3.3.0:
is-obj "^1.0.1"
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -11885,6 +11860,13 @@ strip-ansi@^0.3.0:
dependencies:
ansi-regex "^0.2.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1, strip-ansi@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -13444,8 +13426,16 @@ [email protected], workbox-window@^7.3.0:
"@types/trusted-types" "^2.0.2"
workbox-core "7.3.0"

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
name wrap-ansi-cjs
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down