Skip to content

Commit e8c4d49

Browse files
committed
Update prettier to v3
1 parent e5d3475 commit e8c4d49

16 files changed

Lines changed: 98 additions & 81 deletions

File tree

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ docs/.vuepress/.temp/
1515
docs/.yarn
1616
/CHANGELOG.*
1717
change/
18+
coverage/
1819
dist/
1920
lib/
2021
LICENSE
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"type": "none",
5+
"comment": "Update formatting",
6+
"packageName": "beachball",
7+
"email": "elcraig@microsoft.com",
8+
"dependentChangeType": "none"
9+
}
10+
]
11+
}

docs/concepts/groups.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ Example:
4444
"name": "group name",
4545
"include": ["packages/groupfoo/*"],
4646
"exclude": ["!packages/groupfoo/bar"],
47-
"disallowedChangeTypes": ["major"]
48-
}
49-
]
47+
"disallowedChangeTypes": ["major"],
48+
},
49+
],
5050
}
5151
```
5252

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"jest": "^29.0.0",
5858
"lage": "^2.15.0",
5959
"lint-staged": "^16.0.0",
60-
"prettier": "~2.8.4",
60+
"prettier": "~3.8.3",
6161
"syncpack": "^9.0.0",
6262
"ts-jest": "29.2.6",
6363
"typescript": "~6.0.0",

packages/beachball/src/__fixtures__/mockStdin.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class MockStdin extends stream.Readable {
1717
};
1818
// This is a private property of the parent class. As of TS ES2022 output, it's necessary to use
1919
// `declare` to prevent TS from emitting an unset property which overwrites the one from the parent.
20-
protected declare _readableState?: {
20+
declare protected _readableState?: {
2121
length: number;
2222
ended: boolean;
2323
endEmitted: boolean;
@@ -162,7 +162,10 @@ class MockData {
162162
pos = 0;
163163
done = false;
164164

165-
constructor(private data: Buffer | string | null, public encoding?: BufferEncoding) {}
165+
constructor(
166+
private data: Buffer | string | null,
167+
public encoding?: BufferEncoding
168+
) {}
166169

167170
get length() {
168171
if (Buffer.isBuffer(this.data)) {

packages/beachball/src/__fixtures__/repositoryFactory.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ export class RepositoryFactory {
187187
fixtureParam === 'single'
188188
? getSinglePackageFixture()
189189
: fixtureParam === 'monorepo'
190-
? getMonorepoFixture()
191-
: // Clone the user-provided fixture so it's safe to modify
192-
cloneObject(fixtureParam),
190+
? getMonorepoFixture()
191+
: // Clone the user-provided fixture so it's safe to modify
192+
cloneObject(fixtureParam),
193193
};
194194
}
195195

packages/beachball/src/__functional__/git/fetch.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('gitFetch', () => {
2525
const logs = initMockLogs();
2626

2727
/** To speed things up, some tests only check the arguments and skip the git operation */
28-
const noOpSuccess = () => ({ success: true, stdout: '', stderr: '', status: 0 } as GitProcessOutput);
28+
const noOpSuccess = () => ({ success: true, stdout: '', stderr: '', status: 0 }) as GitProcessOutput;
2929

3030
const { git: realGit, gitFailFast: _realGitFailFast } = jest.requireActual<typeof workspaceTools>('workspace-tools');
3131
const gitFailFast: typeof _realGitFailFast = (args, options) =>
@@ -81,7 +81,7 @@ describe('gitFetch', () => {
8181

8282
it('returns error but does not throw or log on failure by default', () => {
8383
// This test uses controlled non-localized fake stdio so we can test the whole output
84-
gitOverride = () => ({ success: false, stdout: 'some logs', stderr: 'oh no', status: 1 } as GitProcessOutput);
84+
gitOverride = () => ({ success: false, stdout: 'some logs', stderr: 'oh no', status: 1 }) as GitProcessOutput;
8585

8686
const res = gitFetch({ cwd: repo.rootPath, remote: '', branch: defaultBranchName });
8787
expect(res).toMatchObject({
@@ -125,7 +125,7 @@ describe('gitFetch', () => {
125125
});
126126

127127
it('logs git output with failed fetch if verbose is true', () => {
128-
gitOverride = () => ({ success: false, stdout: 'some logs', stderr: 'oh no', status: 1 } as GitProcessOutput);
128+
gitOverride = () => ({ success: false, stdout: 'some logs', stderr: 'oh no', status: 1 }) as GitProcessOutput;
129129

130130
const res = gitFetch({ cwd: repo.rootPath, verbose: true, remote: '', branch: defaultBranchName });
131131
expect(gitSpy).toHaveBeenCalledWith(['fetch'], expect.anything());

packages/beachball/src/__tests__/publish/bumpAndPush.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ describe('bumpAndPush', () => {
5858
/** Create a mock workspace-tools git() result */
5959
function makeGitResult(opts: { success: boolean; output?: string }): GitProcessOutput {
6060
return {
61-
stderr: opts.success ? '' : opts.output ?? '',
62-
stdout: opts.success ? opts.output ?? '' : '',
61+
stderr: opts.success ? '' : (opts.output ?? ''),
62+
stdout: opts.success ? (opts.output ?? '') : '',
6363
success: opts.success,
6464
status: opts.success ? 0 : 1,
6565
} as GitProcessOutput;

packages/beachball/src/changefile/isPackageIncluded.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export function isPackageIncluded(
1414
const reason = !packageInfo
1515
? 'no corresponding package found'
1616
: packageInfo.private
17-
? `${packageInfo.name} is private`
18-
: // This is a package-only option (can't be set at repo level or via CLI)
19-
packageInfo.packageOptions?.shouldPublish === false
20-
? `${packageInfo.name} has beachball.shouldPublish=false`
21-
: !scopedPackages.has(packageInfo.name)
22-
? `${packageInfo.name} is out of scope`
23-
: ''; // not ignored
17+
? `${packageInfo.name} is private`
18+
: // This is a package-only option (can't be set at repo level or via CLI)
19+
packageInfo.packageOptions?.shouldPublish === false
20+
? `${packageInfo.name} has beachball.shouldPublish=false`
21+
: !scopedPackages.has(packageInfo.name)
22+
? `${packageInfo.name} is out of scope`
23+
: ''; // not ignored
2424

2525
return { isIncluded: !reason, reason };
2626
}

packages/beachball/src/changefile/readChangeFiles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ export function readChangeFiles(
9393
const warningType = !packageInfos[change.packageName]
9494
? 'nonexistent'
9595
: packageInfos[change.packageName].private
96-
? 'private'
97-
: undefined;
96+
? 'private'
97+
: undefined;
9898
if (warningType) {
9999
const resolution = options.groupChanges ? 'remove the entry from this file' : 'delete this file';
100100
console.warn(

0 commit comments

Comments
 (0)