diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..1ca87ab --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": false +} diff --git a/packages/cypress-cloud/index.ts b/packages/cypress-cloud/index.ts index a8c53bf..3486d50 100644 --- a/packages/cypress-cloud/index.ts +++ b/packages/cypress-cloud/index.ts @@ -2,6 +2,7 @@ import "source-map-support/register.js"; import { run as internalRun } from "./lib/run"; +export type { CurrentsConfig } from "./lib/config/config"; import { CurrentsRunAPI } from "./types"; export type { CurrentsRunAPI } from "./types"; /** diff --git a/packages/cypress-cloud/lib/config/config.ts b/packages/cypress-cloud/lib/config/config.ts index 08c2317..26e414f 100644 --- a/packages/cypress-cloud/lib/config/config.ts +++ b/packages/cypress-cloud/lib/config/config.ts @@ -18,6 +18,14 @@ export type ComponentConfig = { type RetryConfig = { hardFailureMaxRetries: number; }; + +/** + * This is the type for `currents.config.*s`. If you are not officially using TypeScript, + * you can still type the exported config in your IDE by adding the following as a block comment + * above `module.exports` / `export default`: + * + * `@type {import('cypress-cloud').CurrentsConfig}` + */ export type CurrentsConfig = { projectId?: string; recordKey?: string; @@ -43,7 +51,7 @@ const defaultConfig: CurrentsConfig = { export async function getCurrentsConfig( projectRoot?: string, - explicitConfigFilePath?: string + explicitConfigFilePath?: string, ): Promise { if (_config) { return _config; @@ -70,7 +78,7 @@ export async function getCurrentsConfig( warn( "Failed to load config file, falling back to the default config. Attempted locations: %s", - configFilePath + configFilePath, ); _config = defaultConfig; return _config;