Skip to content

Commit 7d87045

Browse files
committed
prettier -w .
1 parent c44f066 commit 7d87045

File tree

39 files changed

+107
-117
lines changed

39 files changed

+107
-117
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env node
2-
require('../lib/start.js')
2+
require('../lib/start.js');

apps/api-documenter/src/documenters/YamlDocumenter.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -943,12 +943,12 @@ export class YamlDocumenter {
943943
spec.fullName = apiItem
944944
? apiItem.getScopedNameWithinPackage()
945945
: token.canonicalReference
946-
? token.canonicalReference
947-
.withSource(undefined)
948-
.withMeaning(undefined)
949-
.withOverloadIndex(undefined)
950-
.toString()
951-
: token.text;
946+
? token.canonicalReference
947+
.withSource(undefined)
948+
.withMeaning(undefined)
949+
.withOverloadIndex(undefined)
950+
.toString()
951+
: token.text;
952952
specs.push(spec);
953953
} else {
954954
specs.push({

apps/api-extractor/bin/api-extractor

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env node
2-
require('../lib/start.js')
2+
require('../lib/start.js');

apps/api-extractor/src/analyzer/AstImport.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ export class AstImport extends AstSyntheticEntity {
154154
const subKey: string = !options.exportName
155155
? '*' // Equivalent to StarImport
156156
: options.exportName.includes('.') // Equivalent to a named export
157-
? options.exportName.split('.')[0]
158-
: options.exportName;
157+
? options.exportName.split('.')[0]
158+
: options.exportName;
159159
return `${options.modulePath}:${subKey}`;
160160
}
161161
default:

apps/heft/src/cli/HeftActionRunner.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,8 @@ async function _startLifecycleAsync(this: void, internalHeftSession: InternalHef
497497

498498
// Delete all temp folders for tasks by default
499499
for (const pluginDefinition of lifecycle.pluginDefinitions) {
500-
const lifecycleSession: IHeftLifecycleSession = await lifecycle.getSessionForPluginDefinitionAsync(
501-
pluginDefinition
502-
);
500+
const lifecycleSession: IHeftLifecycleSession =
501+
await lifecycle.getSessionForPluginDefinitionAsync(pluginDefinition);
503502
deleteOperations.push({ sourcePath: lifecycleSession.tempFolderPath });
504503
}
505504

apps/heft/src/utilities/GitUtilities.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,8 @@ export class GitUtilities {
188188
let currentPath: string = normalizedWorkingDirectory;
189189
while (currentPath.length >= gitRepoRootPath.length) {
190190
const gitIgnoreFilePath: string = `${currentPath}/.gitignore`;
191-
const gitIgnorePatterns: string[] | undefined = await this._tryReadGitIgnoreFileAsync(
192-
gitIgnoreFilePath
193-
);
191+
const gitIgnorePatterns: string[] | undefined =
192+
await this._tryReadGitIgnoreFileAsync(gitIgnoreFilePath);
194193
if (gitIgnorePatterns) {
195194
rawIgnorePatternsByGitignoreFolder.set(currentPath, gitIgnorePatterns);
196195
}
@@ -201,9 +200,8 @@ export class GitUtilities {
201200
const gitignoreRelativeFilePaths: string[] = await this._findUnignoredFilesAsync('*.gitignore');
202201
for (const gitignoreRelativeFilePath of gitignoreRelativeFilePaths) {
203202
const gitignoreFilePath: string = `${normalizedWorkingDirectory}/${gitignoreRelativeFilePath}`;
204-
const gitIgnorePatterns: string[] | undefined = await this._tryReadGitIgnoreFileAsync(
205-
gitignoreFilePath
206-
);
203+
const gitIgnorePatterns: string[] | undefined =
204+
await this._tryReadGitIgnoreFileAsync(gitignoreFilePath);
207205
if (gitIgnorePatterns) {
208206
const parentPath: string = gitignoreFilePath.slice(0, gitignoreFilePath.lastIndexOf('/'));
209207
rawIgnorePatternsByGitignoreFolder.set(parentPath, gitIgnorePatterns);

apps/lockfile-explorer-web/assets/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

apps/lockfile-explorer/src/commandLine.test.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@ import { parseCommandLine } from './commandLine';
66
describe('commandLine', () => {
77
describe('parseCommandLine()', () => {
88
it('sets showHelp when --help specified', async () => {
9-
const result = parseCommandLine(['--help'])
9+
const result = parseCommandLine(['--help']);
1010
expect(result).toHaveProperty('showedHelp', true);
1111
});
1212

1313
it('sets subspace when --subspace specified', async () => {
14-
const result = parseCommandLine(['--subspace', 'wallet'])
14+
const result = parseCommandLine(['--subspace', 'wallet']);
1515
expect(result).toHaveProperty('subspace', 'wallet');
1616
});
1717

1818
it('sets error when --subspace value not missing', async () => {
19-
const result = parseCommandLine(['--subspace'])
19+
const result = parseCommandLine(['--subspace']);
2020
expect(result).toHaveProperty('error', 'Expecting argument after "--subspace"');
2121
});
2222
});
2323
});
24-

apps/rush/src/RushVersionSelector.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,9 @@ export class RushVersionSelector {
8585
require(path.join(expectedRushPath, 'node_modules', '@microsoft', 'rush', 'lib', 'start'));
8686
} else {
8787
// For newer rush-lib, RushCommandSelector can test whether "rushx" is supported or not
88-
const rushCliEntrypoint: {} = require(path.join(
89-
expectedRushPath,
90-
'node_modules',
91-
'@microsoft',
92-
'rush-lib',
93-
'lib',
94-
'index'
95-
));
88+
const rushCliEntrypoint: {} = require(
89+
path.join(expectedRushPath, 'node_modules', '@microsoft', 'rush-lib', 'lib', 'index')
90+
);
9691
RushCommandSelector.execute(this._currentPackageVersion, rushCliEntrypoint, executeOptions);
9792
}
9893
}

build-tests-samples/heft-storybook-react-tutorial/assets/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

build-tests-samples/heft-web-rig-app-tutorial/assets/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

build-tests-samples/heft-webpack-basic-tutorial/assets/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

build-tests/heft-sass-test/assets/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

eslint/eslint-bulk/src/start.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function findPatchPath(): string {
5353
if (eslintPackageJsonPath) {
5454
eslintPackageJsonPath = eslintPackageJsonPath.replace(/\\/g, '/');
5555
const packagePath: string = eslintPackageJsonPath.substring(0, eslintPackageJsonPath.lastIndexOf('/'));
56-
const {
57-
bin: { eslint: relativeEslintBinPath } = {}
58-
}: { bin?: Record<string, string> } = require(eslintPackageJsonPath);
56+
const { bin: { eslint: relativeEslintBinPath } = {} }: { bin?: Record<string, string> } = require(
57+
eslintPackageJsonPath
58+
);
5959
if (relativeEslintBinPath) {
6060
eslintBinPath = `${packagePath}/${relativeEslintBinPath}`;
6161
} else {

eslint/eslint-patch/src/_patch-base.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let namingPath: string | undefined = undefined;
3434
let eslintFolder: string | undefined = undefined;
3535

3636
// Probe for the ESLint >=8.0.0 layout:
37-
for (let currentModule: NodeModule = module; ;) {
37+
for (let currentModule: NodeModule = module; ; ) {
3838
if (!eslintrcBundlePath) {
3939
if (currentModule.filename.endsWith('eslintrc.cjs')) {
4040
// For ESLint >=8.0.0, all @eslint/eslintrc code is bundled at this path:
@@ -93,7 +93,7 @@ for (let currentModule: NodeModule = module; ;) {
9393

9494
if (!eslintFolder) {
9595
// Probe for the ESLint >=7.12.0 layout:
96-
for (let currentModule: NodeModule = module; ;) {
96+
for (let currentModule: NodeModule = module; ; ) {
9797
if (!configArrayFactoryPath) {
9898
// For ESLint >=7.12.0, config-array-factory.js is at this path:
9999
// .../@eslint/eslintrc/lib/config-array-factory.js
@@ -154,7 +154,7 @@ if (!eslintFolder) {
154154

155155
if (!eslintFolder) {
156156
// Probe for the <7.12.0 layout:
157-
for (let currentModule: NodeModule = module; ;) {
157+
for (let currentModule: NodeModule = module; ; ) {
158158
// For ESLint <7.12.0, config-array-factory.js was at this path:
159159
// .../eslint/lib/cli-engine/config-array-factory.js
160160
if (/[\\/]eslint[\\/]lib[\\/]cli-engine[\\/]config-array-factory\.js$/i.test(currentModule.filename)) {
@@ -185,8 +185,8 @@ if (!eslintFolder) {
185185
// This was tested with ESLint 6.1.0 .. 7.12.1.
186186
throw new Error(
187187
'Failed to patch ESLint because the calling module was not recognized.\n' +
188-
'If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:\n' +
189-
'https://github.com/microsoft/rushstack/issues'
188+
'If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:\n' +
189+
'https://github.com/microsoft/rushstack/issues'
190190
);
191191
}
192192
currentModule = currentModule.parent;
@@ -207,9 +207,9 @@ if (isNaN(ESLINT_MAJOR_VERSION)) {
207207
if (!(ESLINT_MAJOR_VERSION >= 6 && ESLINT_MAJOR_VERSION <= 9)) {
208208
throw new Error(
209209
'The ESLint patch script has only been tested with ESLint version 6.x, 7.x, 8.x, and 9.x.' +
210-
` (Your version: ${eslintPackageVersion})\n` +
211-
'Consider reporting a GitHub issue:\n' +
212-
'https://github.com/microsoft/rushstack/issues'
210+
` (Your version: ${eslintPackageVersion})\n` +
211+
'Consider reporting a GitHub issue:\n' +
212+
'https://github.com/microsoft/rushstack/issues'
213213
);
214214
}
215215

libraries/operation-graph/src/OperationExecutionManager.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ export class OperationExecutionManager {
168168
const finishedLoggingWord: string = groupRecord.hasFailures
169169
? 'encountered an error'
170170
: groupRecord.hasCancellations
171-
? 'cancelled'
172-
: 'finished';
171+
? 'cancelled'
172+
: 'finished';
173173
terminal.writeLine(
174174
` ---- ${groupRecord.name} ${finishedLoggingWord} (${groupRecord.duration.toFixed(3)}s) ---- `
175175
);
@@ -199,10 +199,10 @@ export class OperationExecutionManager {
199199
this._trackedOperationCount === 0
200200
? OperationStatus.NoOp
201201
: abortSignal.aborted
202-
? OperationStatus.Aborted
203-
: hasReportedFailures
204-
? OperationStatus.Failure
205-
: OperationStatus.Success;
202+
? OperationStatus.Aborted
203+
: hasReportedFailures
204+
? OperationStatus.Failure
205+
: OperationStatus.Success;
206206

207207
return finalStatus;
208208
}

libraries/package-extractor/src/PackageExtractor.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1094,9 +1094,8 @@ export class PackageExtractor {
10941094
);
10951095

10961096
if (linkedBinPackageNames.length && state.archiver) {
1097-
const binFolderItems: string[] = await FileSystem.readFolderItemNamesAsync(
1098-
extractedProjectBinFolder
1099-
);
1097+
const binFolderItems: string[] =
1098+
await FileSystem.readFolderItemNamesAsync(extractedProjectBinFolder);
11001099
for (const binFolderItem of binFolderItems) {
11011100
const binFilePath: string = path.join(extractedProjectBinFolder, binFolderItem);
11021101
await state.archiver.addToArchiveAsync({

libraries/rig-package/src/test/RigConfig.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,8 @@ describe(RigConfig.name, () => {
177177

178178
expect(rigConfig.rigFound).toBe(true);
179179

180-
const resolvedPath: string | undefined = await rigConfig.tryResolveConfigFilePathAsync(
181-
'example-config.json'
182-
);
180+
const resolvedPath: string | undefined =
181+
await rigConfig.tryResolveConfigFilePathAsync('example-config.json');
183182

184183
expect(resolvedPath).toBeDefined();
185184
expectEqualPaths(

libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts

+11-16
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function validateConfiguration(rushProjectConfiguration: RushProjectConfiguratio
5757
try {
5858
rushProjectConfiguration.validatePhaseConfiguration(
5959
Array.from(rushProjectConfiguration.operationSettingsByOperationName.keys()).map(
60-
(phaseName) => ({ name: phaseName } as IPhase)
60+
(phaseName) => ({ name: phaseName }) as IPhase
6161
),
6262
terminal
6363
);
@@ -104,9 +104,8 @@ describe(RushProjectConfiguration.name, () => {
104104

105105
describe(RushProjectConfiguration.prototype.getCacheDisabledReason.name, () => {
106106
it('Indicates if the build cache is completely disabled', async () => {
107-
const config: RushProjectConfiguration | undefined = await loadProjectConfigurationAsync(
108-
'test-project-a'
109-
);
107+
const config: RushProjectConfiguration | undefined =
108+
await loadProjectConfigurationAsync('test-project-a');
110109

111110
if (!config) {
112111
throw new Error('Failed to load config');
@@ -117,9 +116,8 @@ describe(RushProjectConfiguration.name, () => {
117116
});
118117

119118
it('Indicates if the phase behavior is not defined', async () => {
120-
const config: RushProjectConfiguration | undefined = await loadProjectConfigurationAsync(
121-
'test-project-c'
122-
);
119+
const config: RushProjectConfiguration | undefined =
120+
await loadProjectConfigurationAsync('test-project-c');
123121

124122
if (!config) {
125123
throw new Error('Failed to load config');
@@ -130,9 +128,8 @@ describe(RushProjectConfiguration.name, () => {
130128
});
131129

132130
it('Indicates if the phase has disabled the cache', async () => {
133-
const config: RushProjectConfiguration | undefined = await loadProjectConfigurationAsync(
134-
'test-project-c'
135-
);
131+
const config: RushProjectConfiguration | undefined =
132+
await loadProjectConfigurationAsync('test-project-c');
136133

137134
if (!config) {
138135
throw new Error('Failed to load config');
@@ -143,9 +140,8 @@ describe(RushProjectConfiguration.name, () => {
143140
});
144141

145142
it('Indicates if tracked files are outputs of the phase', async () => {
146-
const config: RushProjectConfiguration | undefined = await loadProjectConfigurationAsync(
147-
'test-project-c'
148-
);
143+
const config: RushProjectConfiguration | undefined =
144+
await loadProjectConfigurationAsync('test-project-c');
149145

150146
if (!config) {
151147
throw new Error('Failed to load config');
@@ -159,9 +155,8 @@ describe(RushProjectConfiguration.name, () => {
159155
});
160156

161157
it('returns undefined if the config is safe', async () => {
162-
const config: RushProjectConfiguration | undefined = await loadProjectConfigurationAsync(
163-
'test-project-c'
164-
);
158+
const config: RushProjectConfiguration | undefined =
159+
await loadProjectConfigurationAsync('test-project-c');
165160

166161
if (!config) {
167162
throw new Error('Failed to load config');

libraries/rush-lib/src/cli/RushStartupBanner.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export class RushStartupBanner {
3333
const nodeReleaseLabel: string = NodeJsCompatibility.isOddNumberedVersion
3434
? 'unstable'
3535
: NodeJsCompatibility.isLtsVersion
36-
? 'LTS'
37-
: 'pre-LTS';
36+
? 'LTS'
37+
: 'pre-LTS';
3838
return `${nodeVersion} (${nodeReleaseLabel})`;
3939
}
4040

libraries/rush-lib/src/cli/actions/AddAction.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ export class AddAction extends BaseAddAndRemoveAction {
143143
rangeStyle = this._caretFlag.value
144144
? SemVerStyle.Caret
145145
: this._exactFlag.value
146-
? SemVerStyle.Exact
147-
: SemVerStyle.Tilde;
146+
? SemVerStyle.Exact
147+
: SemVerStyle.Tilde;
148148
}
149149

150150
packagesToAdd.push({ packageName, version, rangeStyle });

libraries/rush-lib/src/cli/actions/ListAction.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ export class ListAction extends BaseRushAction {
122122

123123
protected async runAsync(): Promise<void> {
124124
const terminal: Terminal = new Terminal(new ConsoleTerminalProvider());
125-
const selection: Set<RushConfigurationProject> = await this._selectionParameters.getSelectedProjectsAsync(
126-
terminal
127-
);
125+
const selection: Set<RushConfigurationProject> =
126+
await this._selectionParameters.getSelectedProjectsAsync(terminal);
128127
Sort.sortSetBy(selection, (x: RushConfigurationProject) => x.packageName);
129128
if (this._jsonFlag.value && this._detailedFlag.value) {
130129
throw new Error(`The parameters "--json" and "--detailed" cannot be used together.`);

libraries/rush-lib/src/cli/actions/test/AddAction.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe(AddAction.name, () => {
2222
jest.spyOn(process, 'exit').mockImplementation();
2323

2424
// Suppress "Another Rush command is already running" error
25-
jest.spyOn(LockFile, 'tryAcquire').mockImplementation(() => ({} as LockFile));
25+
jest.spyOn(LockFile, 'tryAcquire').mockImplementation(() => ({}) as LockFile);
2626

2727
oldExitCode = process.exitCode;
2828
oldArgs = process.argv;

libraries/rush-lib/src/cli/actions/test/RemoveAction.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe(RemoveAction.name, () => {
2626
jest.spyOn(process, 'exit').mockImplementation();
2727

2828
// Suppress "Another Rush command is already running" error
29-
jest.spyOn(LockFile, 'tryAcquire').mockImplementation(() => ({} as LockFile));
29+
jest.spyOn(LockFile, 'tryAcquire').mockImplementation(() => ({}) as LockFile);
3030

3131
oldExitCode = process.exitCode;
3232
oldArgs = process.argv;

libraries/rush-lib/src/logic/InteractiveUpgrader.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ export class InteractiveUpgrader {
2727
public async upgradeAsync(): Promise<IUpgradeInteractiveDeps> {
2828
const rushProject: RushConfigurationProject = await this._getUserSelectedProjectForUpgradeAsync();
2929

30-
const dependenciesState: NpmCheck.INpmCheckPackage[] = await this._getPackageDependenciesStatusAsync(
31-
rushProject
32-
);
30+
const dependenciesState: NpmCheck.INpmCheckPackage[] =
31+
await this._getPackageDependenciesStatusAsync(rushProject);
3332

34-
const depsToUpgrade: IDepsToUpgradeAnswers = await this._getUserSelectedDependenciesToUpgradeAsync(
35-
dependenciesState
36-
);
33+
const depsToUpgrade: IDepsToUpgradeAnswers =
34+
await this._getUserSelectedDependenciesToUpgradeAsync(dependenciesState);
3735
return { projects: [rushProject], depsToUpgrade };
3836
}
3937

0 commit comments

Comments
 (0)