Skip to content

Commit 05fb646

Browse files
Bump prettier and pretty-quick (#13908)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: William Durand <[email protected]>
1 parent 42c19d7 commit 05fb646

File tree

29 files changed

+118
-160
lines changed

29 files changed

+118
-160
lines changed

.stylelintrc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@
3030
],
3131
}
3232
],
33-
"block-closing-brace-newline-after": [
34-
"always",
35-
{
36-
"ignoreAtRules": [
37-
"if",
38-
"else"
39-
],
40-
}
41-
],
4233
"color-function-notation": null,
4334
"declaration-colon-newline-after": null,
4435
"function-disallowed-list": [
@@ -68,6 +59,7 @@
6859
]
6960
}
7061
],
62+
"scss/dollar-variable-colon-space-after": "always-single-line",
7163
"scss/dollar-variable-pattern": null,
7264
"scss/no-global-function-names": null,
7365
"selector-class-pattern": "^([a-zA-Z][a-zA-Z0-9]*)([-[a-zA-Z0-9]+|--[a-zA-Z0-9]+])*$",
@@ -77,4 +69,4 @@
7769
"value-list-comma-newline-after": null,
7870
"selector-not-notation": "simple"
7971
}
80-
}
72+
}

bin/regenerate_font.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function getUnicodeRangeFromFile(file) {
1313
}
1414

1515
function regenerateFonts() {
16-
import('characterset').then((characterset) => {
16+
import('characterset').then(async (characterset) => {
1717

1818
const CharacterSet = characterset.default;
1919

@@ -90,12 +90,12 @@ function regenerateFonts() {
9090
unicode-range: ${characterSetFromFile.toHexRangeString()};
9191
}
9292
`;
93-
const runPrettierWithConfig = (text) => {
94-
const filePath = prettier.resolveConfigFile.sync();
95-
const options = prettier.resolveConfig.sync(filePath);
93+
const runPrettierWithConfig = async (text) => {
94+
const filePath = await prettier.resolveConfigFile();
95+
const options = await prettier.resolveConfig(filePath);
9696
return prettier.format(text, { ...options, parser: 'scss' });
9797
};
98-
fs.writeFileSync(`src/fonts/${cssFile}`, runPrettierWithConfig(cssContents));
98+
fs.writeFileSync(`src/fonts/${cssFile}`, await runPrettierWithConfig(cssContents));
9999

100100
console.info('Generating html...');
101101
const htmlContents = `<meta charset="utf-8" /><style>

docs/experiments.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ AMO has the ability to run experiments, automatically dividing users into branch
77
The following are the steps to add an experiment to AMO:
88

99
1. Create a config file for the experiment in `amo/experiments`.
10-
1110
- The file should be named with the `experimentId`, e.g., `20210714_amo_vpn_promo.js`.
1211
- `experimentId` must be in the format `YYYYMMDD_amo_experimentName`. We generally use the date that the code was written for the YYYYMMDD portion.
1312
- The config file should export a `EXPERIMENT_CONFIG` variable, which is an object containing:
14-
1513
- `id`, which is the same as the `experimentId`, above.
1614
- `variants`, which is an array of possible branches to which a user might be assigned. Each item in this array is an object with an `id` (which ends up being the experiment branch/variation) and a `percentage`, which is used to automatically allocate users to branches, and is expressed as number less than 1 (e.g., `0.5` means 50%). The sum total of all `percentage`s in the array must equal `1` or an error will be thrown. There is a special variant, `NOT_IN_EXPERIMENT`, which can be imported from `amo/withExperiment`, and any users allocated to that branch will be treated as not being enrolled in the experiment.
1715
- optionally a `shouldExcludeUser` function, which accepts a single object argument `{ state }` and returns a boolean. If this function returns `true` then the user will be excluded from the experiment. If this property is missing, then no users will be excluded.
@@ -59,7 +57,6 @@ The following are the steps to add an experiment to AMO:
5957
The example `shouldExcludeUser` function returns the result of the internal `shouldExcludeUser` function, which uses `clientApp` and `regionCode` from `state.api` to exclude users on the `android` site, as well as any users with a region other than `US`, `DE` or `FR`.
6058

6159
2. Update AMO's config to enable the experiment.
62-
6360
- The default config file, `config/default.js`, contains an `experiments` property, which lists existing experiments along with their current enabled status. To enable an experiment, add it to the `experiments` object, using the `experimentId` as the key, and set the value to `true`. For example:
6461

6562
```js

docs/moz-addon-manager.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ It is possible to serve the local development version of this project with HTTPS
5959
```
6060

6161
4. In a custom Firefox profile, go to `about:config`, accept the risk, and set these prefs. Afterwards, restart Firefox for them to take effect.
62-
6362
- set `extensions.webapi.testing` to `true` [to turn on `mozAddonManager`](#turning-on-mozaddonmanager-in--dev-and--stage-environments)
6463
- set `xpinstall.signatures.dev-root` to `true` [to install add-ons](#install-add-ons-in--dev-and--stage-environments)
6564

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@
305305
"po2json": "mikeedwards/po2json#51e2310485bbe35e9e57f2eee238185459ca0eab",
306306
"postcss": "^8.5.6",
307307
"postcss-loader": "^8.2.0",
308-
"prettier": "2.8.8",
309-
"pretty-quick": "3.3.1",
308+
"prettier": "3.6.2",
309+
"pretty-quick": "4.2.2",
310310
"react-hot-loader": "^4.13.1",
311311
"redux-saga-tester": "^1.0.372",
312312
"rimraf": "^6.0.1",

src/amo/components/AMInstallButton/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ export class AMInstallButtonBase extends React.Component<InternalProps> {
253253
}
254254
}
255255

256-
const AMInstallButton: React.ComponentType<Props> = compose(translate())(
257-
AMInstallButtonBase,
258-
);
256+
const AMInstallButton: React.ComponentType<Props> =
257+
compose(translate())(AMInstallButtonBase);
259258

260259
export default AMInstallButton;

src/amo/components/AddonAdminLinks/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ export class AddonAdminLinksBase extends React.Component<InternalProps> {
110110
}
111111
}
112112

113-
const AddonAdminLinks: React.ComponentType<Props> = compose(translate())(
114-
AddonAdminLinksBase,
115-
);
113+
const AddonAdminLinks: React.ComponentType<Props> =
114+
compose(translate())(AddonAdminLinksBase);
116115

117116
export default AddonAdminLinks;

src/amo/components/Button/styles.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ $micro-font-size: $font-size-xs;
2525
margin: 0;
2626
padding: 0 8px;
2727
text-decoration: none;
28-
transition-duration: all $transition-long, padding $transition-short;
28+
transition-duration:
29+
all $transition-long,
30+
padding $transition-short;
2931
transition-property: background-color border-color color;
3032
transition-timing-function: $easing-curve;
3133

src/amo/components/ContributeCard/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ export const ContributeCardBase = ({
121121
);
122122
};
123123

124-
const ContributeCard: React.ComponentType<Props> = compose(translate())(
125-
ContributeCardBase,
126-
);
124+
const ContributeCard: React.ComponentType<Props> =
125+
compose(translate())(ContributeCardBase);
127126

128127
export default ContributeCard;

src/amo/components/Errors/NotAuthorized/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ export class NotAuthorizedBase extends React.Component<InternalProps> {
4848
}
4949
}
5050

51-
const NotAuthorized: React.ComponentType<Props> = compose(translate())(
52-
NotAuthorizedBase,
53-
);
51+
const NotAuthorized: React.ComponentType<Props> =
52+
compose(translate())(NotAuthorizedBase);
5453

5554
export default NotAuthorized;

0 commit comments

Comments
 (0)