Skip to content

Commit 24a5fe3

Browse files
authored
Remove some unused dependencies (#5696)
This PR: - Removes`glob` and `raw-loader` which are not used in the project at all. - Converts the `bin/pre-install.js` Flow types to JSDoc - Removes overrides in `.prettierrc.js` that was needed for Flow in the past - Removes `espree` that was used in some cases by prettier
2 parents c2da704 + 28bbe33 commit 24a5fe3

File tree

5 files changed

+47
-76
lines changed

5 files changed

+47
-76
lines changed

.prettierrc.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,4 @@
11
module.exports = {
22
singleQuote: true,
33
trailingComma: 'es5',
4-
overrides: [
5-
{
6-
files: 'src/utils/path.js',
7-
options: {
8-
// New versions of Prettier rewrite Flow comments to non-comments, but
9-
// this is a problem in this file because it contains a Flow comment
10-
// that's not parsed properly by Babel.
11-
// This file uses Flow in a way that's Typescript compatible, so we can
12-
// use a typescript parser. This typescript parser doesn't rewrite
13-
// comments, so it works in this case.
14-
parser: 'babel-ts',
15-
},
16-
},
17-
{
18-
files: 'bin/*.js',
19-
options: {
20-
// Files in bin/ are javascript files that may use Flow comments. We
21-
// don't want the content of these Flow comments to be output outside of
22-
// comments so that the file can still be run directly with node.
23-
parser: 'espree',
24-
},
25-
},
26-
],
274
};

bin/l10n-sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const readline = require('readline');
1313
const { promisify } = require('util');
1414

1515
/**
16-
* @typeef {Object} ExecFilePromiseResult
16+
* @typedef {Object} ExecFilePromiseResult
1717
* @property {string | Buffer} stdout
1818
* @property {string | Buffer} stderr
1919
*/

bin/pre-install.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
/*:: type AgentsVersion = { [agentName: string]: string }; */
5+
/**
6+
* @typedef {Object.<string, string>} AgentsVersion
7+
*/
68

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

24-
const agents /*: AgentsVersion */ = userAgent
25-
.split(' ')
26-
.reduce((agents, agent) => {
27-
const [key, value] = agent.split('/');
28-
agents[key] = value;
29-
return agents;
30-
}, {});
26+
/** @type {AgentsVersion} */
27+
const agents = userAgent.split(' ').reduce((agents, agent) => {
28+
const [key, value] = agent.split('/');
29+
agents[key] = value;
30+
return agents;
31+
}, {});
3132

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

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

50-
function checkNode(agents /*: AgentsVersion */) {
51+
/**
52+
* @param {AgentsVersion} agents
53+
*/
54+
function checkNode(agents) {
5155
// Node versions usually have a starting `v`.
5256
const nodeVersion = agents.node.replace(/^v/, '');
5357
const expectedNodeVersion = parseExpectedNodeVersion();
@@ -75,7 +79,10 @@ function checkNode(agents /*: AgentsVersion */) {
7579
return true;
7680
}
7781

78-
function checkYarn(agents /*: AgentsVersion */) {
82+
/**
83+
* @param {AgentsVersion} agents
84+
*/
85+
function checkYarn(agents) {
7986
if (!('yarn' in agents)) {
8087
console.error(
8188
'This project uses Yarn instead of npm, please run `yarn install` instead of `npm install`.\n'

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,9 @@
156156
"eslint-plugin-jest-formatting": "^3.1.0",
157157
"eslint-plugin-react": "^7.37.5",
158158
"eslint-plugin-testing-library": "^7.13.4",
159-
"espree": "^11.0.0",
160159
"fake-indexeddb": "^6.2.5",
161160
"fetch-mock": "^12.6.0",
162161
"file-loader": "^6.2.0",
163-
"glob": "^12.0.0",
164162
"globals": "^16.5.0",
165163
"html-webpack-plugin": "^5.6.5",
166164
"husky": "^4.3.8",
@@ -178,7 +176,6 @@
178176
"postcss-loader": "^8.2.0",
179177
"postinstall-postinstall": "^2.1.0",
180178
"prettier": "^3.6.2",
181-
"raw-loader": "^4.0.2",
182179
"rimraf": "^6.1.0",
183180
"style-loader": "^4.0.0",
184181
"stylelint": "^16.25.0",

yarn.lock

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5185,11 +5185,6 @@ eslint-visitor-keys@^4.2.1:
51855185
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1"
51865186
integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==
51875187

5188-
eslint-visitor-keys@^5.0.0:
5189-
version "5.0.0"
5190-
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-5.0.0.tgz#b9aa1a74aa48c44b3ae46c1597ce7171246a94a9"
5191-
integrity sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q==
5192-
51935188
eslint@^9.39.1:
51945189
version "9.39.1"
51955190
resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.39.1.tgz#be8bf7c6de77dcc4252b5a8dcb31c2efff74a6e5"
@@ -5239,15 +5234,6 @@ espree@^10.0.1, espree@^10.4.0:
52395234
acorn-jsx "^5.3.2"
52405235
eslint-visitor-keys "^4.2.1"
52415236

5242-
espree@^11.0.0:
5243-
version "11.0.0"
5244-
resolved "https://registry.yarnpkg.com/espree/-/espree-11.0.0.tgz#2fa56e7b9d3091a618526307f8cab8f5624debbf"
5245-
integrity sha512-+gMeWRrIh/NsG+3NaLeWHuyeyk70p2tbvZIWBYcqQ4/7Xvars6GYTZNhF1sIeLcc6Wb11He5ffz3hsHyXFrw5A==
5246-
dependencies:
5247-
acorn "^8.15.0"
5248-
acorn-jsx "^5.3.2"
5249-
eslint-visitor-keys "^5.0.0"
5250-
52515237
esprima@^4.0.0:
52525238
version "4.0.1"
52535239
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
@@ -5892,18 +5878,6 @@ glob@^11.0.3:
58925878
package-json-from-dist "^1.0.0"
58935879
path-scurry "^2.0.0"
58945880

5895-
glob@^12.0.0:
5896-
version "12.0.0"
5897-
resolved "https://registry.yarnpkg.com/glob/-/glob-12.0.0.tgz#4f75198719ab443ea433fdc023629b853532a443"
5898-
integrity sha512-5Qcll1z7IKgHr5g485ePDdHcNQY0k2dtv/bjYy0iuyGxQw2qSOiiXUXJ+AYQpg3HNoUMHqAruX478Jeev7UULw==
5899-
dependencies:
5900-
foreground-child "^3.3.1"
5901-
jackspeak "^4.1.1"
5902-
minimatch "^10.1.1"
5903-
minipass "^7.1.2"
5904-
package-json-from-dist "^1.0.0"
5905-
path-scurry "^2.0.0"
5906-
59075881
glob@^7.1.1, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0:
59085882
version "7.2.3"
59095883
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
@@ -9117,7 +9091,7 @@ minimalistic-assert@^1.0.0:
91179091
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
91189092
integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==
91199093

9120-
minimatch@^10.0.3, minimatch@^10.1.1:
9094+
minimatch@^10.0.3:
91219095
version "10.1.1"
91229096
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.1.1.tgz#e6e61b9b0c1dcab116b5a7d1458e8b6ae9e73a55"
91239097
integrity sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==
@@ -10537,14 +10511,6 @@ [email protected], raw-body@^2.3.3:
1053710511
iconv-lite "0.4.24"
1053810512
unpipe "1.0.0"
1053910513

10540-
raw-loader@^4.0.2:
10541-
version "4.0.2"
10542-
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.2.tgz#1aac6b7d1ad1501e66efdac1522c73e59a584eb6"
10543-
integrity sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==
10544-
dependencies:
10545-
loader-utils "^2.0.0"
10546-
schema-utils "^3.0.0"
10547-
1054810514
[email protected], rc@^1.2.8:
1054910515
version "1.2.8"
1055010516
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
@@ -11749,7 +11715,16 @@ string-length@^4.0.2:
1174911715
char-regex "^1.0.2"
1175011716
strip-ansi "^6.0.0"
1175111717

11752-
"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:
11718+
"string-width-cjs@npm:string-width@^4.2.0":
11719+
version "4.2.3"
11720+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
11721+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
11722+
dependencies:
11723+
emoji-regex "^8.0.0"
11724+
is-fullwidth-code-point "^3.0.0"
11725+
strip-ansi "^6.0.1"
11726+
11727+
string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1175311728
version "4.2.3"
1175411729
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
1175511730
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -11871,7 +11846,7 @@ stringify-object@^3.3.0:
1187111846
is-obj "^1.0.1"
1187211847
is-regexp "^1.0.0"
1187311848

11874-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
11849+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
1187511850
version "6.0.1"
1187611851
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
1187711852
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -11885,6 +11860,13 @@ strip-ansi@^0.3.0:
1188511860
dependencies:
1188611861
ansi-regex "^0.2.1"
1188711862

11863+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
11864+
version "6.0.1"
11865+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
11866+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
11867+
dependencies:
11868+
ansi-regex "^5.0.1"
11869+
1188811870
strip-ansi@^7.0.1, strip-ansi@^7.1.0:
1188911871
version "7.1.0"
1189011872
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -13444,8 +13426,16 @@ [email protected], workbox-window@^7.3.0:
1344413426
"@types/trusted-types" "^2.0.2"
1344513427
workbox-core "7.3.0"
1344613428

13447-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
13448-
name wrap-ansi-cjs
13429+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
13430+
version "7.0.0"
13431+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
13432+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
13433+
dependencies:
13434+
ansi-styles "^4.0.0"
13435+
string-width "^4.1.0"
13436+
strip-ansi "^6.0.0"
13437+
13438+
wrap-ansi@^7.0.0:
1344913439
version "7.0.0"
1345013440
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
1345113441
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==

0 commit comments

Comments
 (0)