diff --git a/.prettierrc.js b/.prettierrc.js index 231799b8f4..a425d3f761 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -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', - }, - }, - ], }; diff --git a/bin/l10n-sync.js b/bin/l10n-sync.js index 3f88f5baeb..30ab1ccb18 100644 --- a/bin/l10n-sync.js +++ b/bin/l10n-sync.js @@ -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 */ diff --git a/bin/pre-install.js b/bin/pre-install.js index 10cf9c7920..c543f64d09 100644 --- a/bin/pre-install.js +++ b/bin/pre-install.js @@ -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.} AgentsVersion + */ /* * This file is run when a user runs `yarn install`, before doing anything else. @@ -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)]; @@ -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(); @@ -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' diff --git a/package.json b/package.json index f108eec46e..0a26e2bc77 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/yarn.lock b/yarn.lock index 2cb8f7cab1..4ca9cf0a97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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" @@ -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" @@ -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== @@ -10537,14 +10511,6 @@ raw-body@2.5.2, 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" - rc@1.2.8, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -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== @@ -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== @@ -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" @@ -13444,8 +13426,16 @@ workbox-window@7.3.0, 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==