Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency prettier to v3 #235

Merged
merged 2 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ async function myTest() {
.sandbox()
.getOnce(
"https://github.com/gitapi/repos/octocat/hello-world/contents/.github%2Fmy-app.yml",
"comment: 'Thank you for creating the issue!'"
"comment: 'Thank you for creating the issue!'",
);
const octokit = new TestOctokit({
request: { fetch },
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"esbuild": "^0.19.4",
"fetch-mock": "^9.11.0",
"jest": "^29.0.0",
"prettier": "^2.7.1",
"prettier": "^3.0.0",
"semantic-release": "^22.0.5",
"semantic-release-plugin-update-version-in-files": "^1.1.0",
"strip-indent": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/compose-config-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { Configuration, GetOptions, GetResult } from "./types";
*/
export async function composeConfigGet<T extends Configuration = Configuration>(
octokit: Octokit,
{ owner, repo, defaults, path, branch }: GetOptions<T>
{ owner, repo, defaults, path, branch }: GetOptions<T>,
): Promise<GetResult<T>> {
const files = await getConfigFiles(octokit, {
owner,
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type Configuration = Record<string, unknown>;
export type API = {
config: {
get<T extends Configuration = Configuration>(
options: GetOptions<T>
options: GetOptions<T>,
): Promise<GetResult<T>>;
};
};
Expand Down
8 changes: 4 additions & 4 deletions src/util/extends-to-get-content-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const EXTENDS_REGEX = new RegExp(
"([-_.\\w\\d]+)" + // project
"(?::([-_./\\w\\d]+\\.ya?ml))?" + // filename
"$",
"i"
"i",
);

/**
Expand All @@ -32,16 +32,16 @@ export function extendsToGetContentParams({
if (typeof extendsValue !== "string") {
throw new Error(
`[@probot/octokit-plugin-config] Invalid value ${JSON.stringify(
extendsValue
)} for _extends in ${url}`
extendsValue,
)} for _extends in ${url}`,
);
}

const match = extendsValue.match(EXTENDS_REGEX);

if (match === null) {
throw new Error(
`[@probot/octokit-plugin-config] Invalid value "${extendsValue}" for _extends in ${url}`
`[@probot/octokit-plugin-config] Invalid value "${extendsValue}" for _extends in ${url}`,
);
}

Expand Down
12 changes: 6 additions & 6 deletions src/util/get-config-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const SUPPORTED_FILE_EXTENSIONS = ["json", "yml", "yaml"];
*/
export async function getConfigFile(
octokit: Octokit,
{ owner, repo, path, ref }: Options
{ owner, repo, path, ref }: Options,
): Promise<ConfigFile> {
const fileExtension = (path.split(".").pop() as string).toLowerCase();

if (!SUPPORTED_FILE_EXTENSIONS.includes(fileExtension)) {
throw new Error(
`[@probot/octokit-plugin-config] .${fileExtension} extension is not support for configuration (path: "${path}")`
`[@probot/octokit-plugin-config] .${fileExtension} extension is not support for configuration (path: "${path}")`,
);
}

Expand Down Expand Up @@ -65,14 +65,14 @@ export async function getConfigFile(
// so we are fine
if (headers["content-type"] === "application/json; charset=utf-8") {
throw new Error(
`[@probot/octokit-plugin-config] ${url} exists, but is either a directory or a submodule. Ignoring.`
`[@probot/octokit-plugin-config] ${url} exists, but is either a directory or a submodule. Ignoring.`,
);
}

if (fileExtension === "json") {
if (typeof data === "string") {
throw new Error(
`[@probot/octokit-plugin-config] Configuration could not be parsed from ${url} (invalid JSON)`
`[@probot/octokit-plugin-config] Configuration could not be parsed from ${url} (invalid JSON)`,
);
}

Expand All @@ -86,7 +86,7 @@ export async function getConfigFile(

if (typeof config === "string") {
throw new Error(
`[@probot/octokit-plugin-config] Configuration could not be parsed from ${url} (YAML is not an object)`
`[@probot/octokit-plugin-config] Configuration could not be parsed from ${url} (YAML is not an object)`,
);
}

Expand All @@ -105,7 +105,7 @@ export async function getConfigFile(
: "invalid YAML";

throw new Error(
`[@probot/octokit-plugin-config] Configuration could not be parsed from ${url} (${reason})`
`[@probot/octokit-plugin-config] Configuration could not be parsed from ${url} (${reason})`,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/util/get-config-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Options = {
*/
export async function getConfigFiles(
octokit: Octokit,
{ owner, repo, path, branch }: Options
{ owner, repo, path, branch }: Options,
): Promise<ConfigFile[]> {
const requestedRepoFile = await getConfigFile(octokit, {
owner,
Expand Down Expand Up @@ -92,12 +92,12 @@ export async function getConfigFiles(
(file) =>
file.owner === extendConfigOptions.owner &&
file.repo === extendConfigOptions.repo &&
file.path === extendConfigOptions.path
file.path === extendConfigOptions.path,
);

if (alreadyLoaded) {
throw new Error(
`[@probot/octokit-plugin-config] Recursion detected. Ignoring "_extends: ${extendRepoConfig.config._extends}" from ${extendRepoConfig.url} because ${alreadyLoaded.url} was already loaded.`
`[@probot/octokit-plugin-config] Recursion detected. Ignoring "_extends: ${extendRepoConfig.config._extends}" from ${extendRepoConfig.url} because ${alreadyLoaded.url} was already loaded.`,
);
}
} while (true);
Expand Down
Loading