Skip to content
Merged
Prev Previous commit
Next Next commit
m
  • Loading branch information
fredzqm committed Oct 3, 2025
commit 86ff3a7b1ca24078d80633aabfdcdb1d427189bb
5 changes: 0 additions & 5 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
import { init, Setup } from "../init";
import { logger } from "../logger";
import { checkbox, confirm } from "../prompt";
import { requireAuth } from "../requireAuth";
import * as fsutils from "../fsutils";
import * as utils from "../utils";
import { Options } from "../options";
import { isEnabled } from "../experiments";
import { readTemplateSync } from "../templates";
import { FirebaseError } from "../error";
import { logBullet } from "../utils";
import { EmulatorHub } from "../emulator/hub";

const homeDir = os.homedir();

Expand Down Expand Up @@ -164,9 +162,6 @@
".",
);
}
if (options.project !== EmulatorHub.MISSING_PROJECT_PLACEHOLDER) {
await requireAuth(options);
}

const cwd = options.cwd || process.cwd();

Expand Down Expand Up @@ -205,7 +200,7 @@

const setup: Setup = {
config: config.src,
rcfile: config.readProjectFile(".firebaserc", {

Check warning on line 203 in src/commands/init.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
json: true,
fallback: {},
}),
Expand Down
2 changes: 2 additions & 0 deletions src/init/features/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import * as prompt from "../../prompt";
import { Options } from "../../options";
import { EmulatorHub } from "../../emulator/hub";
import { requireAuth } from "../../requireAuth";

const OPTION_NO_PROJECT = "Don't set up a default project";
const OPTION_USE_PROJECT = "Use an existing project";
Expand Down Expand Up @@ -73,7 +74,7 @@
* @param options the Firebase CLI options object.
* @return the project metadata, or undefined if no project was selected.
*/
async function projectChoicePrompt(options: any): Promise<FirebaseProjectMetadata | undefined> {

Check warning on line 77 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
const choices = [OPTION_USE_PROJECT, OPTION_NEW_PROJECT, OPTION_ADD_FIREBASE, OPTION_NO_PROJECT];
const projectSetupOption: string = await prompt.select<(typeof choices)[number]>({
message: "Please select an option:",
Expand All @@ -82,9 +83,9 @@

switch (projectSetupOption) {
case OPTION_USE_PROJECT:
return getOrPromptProject(options);

Check warning on line 86 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `Partial<Options>`
case OPTION_NEW_PROJECT:
return promptAndCreateNewProject(options);

Check warning on line 88 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `Options`
case OPTION_ADD_FIREBASE:
return promptAndAddFirebaseToCloudProject();
default:
Expand All @@ -99,12 +100,13 @@
* @param config Configuration for the project.
* @param options Command line options.
*/
export async function doSetup(setup: any, config: any, options: any): Promise<void> {

Check warning on line 103 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 103 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 103 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
setup.project = {};

Check warning on line 104 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .project on an `any` value
if (options.projectId === EmulatorHub.MISSING_PROJECT_PLACEHOLDER) {

Check warning on line 105 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .projectId on an `any` value
logger.info(`Skipping Firebase project given --project=${options.projectId}`);

Check warning on line 106 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression
return;
}
await requireAuth(options);

logger.info();
logger.info(`First, let's associate this project directory with a Firebase project.`);
Expand Down
Loading