Skip to content

Commit

Permalink
style: format with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Jul 7, 2021
1 parent 5f4dee0 commit 21633e0
Show file tree
Hide file tree
Showing 79 changed files with 662 additions and 1,170 deletions.
16 changes: 8 additions & 8 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ module.exports = {
root: true,
env: {
browser: true,
node: true
node: true,
},
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2020
ecmaVersion: 2020,
},
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
],
plugins: [],
rules: {
Expand All @@ -22,15 +22,15 @@ module.exports = {
"prefer-const": "error",
"padding-line-between-statements": [
"error",
{ blankLine: "always", prev: "*", next: "return" }
{ blankLine: "always", prev: "*", next: "return" },
],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-var-requires": "off"
}
"@typescript-eslint/no-var-requires": "off",
},
};
2 changes: 1 addition & 1 deletion ava.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ export default {
extensions: ["ts"],
files: ["./test/**/*.test.ts"],
require: ["ts-eager/register"],
verbose: true
verbose: true,
};
4 changes: 2 additions & 2 deletions examples/custom-caching/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import QuickLRU from "quick-lru";

const endpoint = prismic.getEndpoint("qwerty");
const cache = new QuickLRU({
maxSize: 1000 // 1000 entries
maxSize: 1000, // 1000 entries
});

const client = prismic.createClient(endpoint, {
Expand All @@ -26,7 +26,7 @@ const client = prismic.createClient(endpoint, {

return res;
}
}
},
});

const homepage = await client.getByUID("page", "home");
Expand Down
6 changes: 3 additions & 3 deletions examples/multiple-languages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const client = prismic.createClient(endpoint, {
// A default language can be set here. If a `lang` option is not set, your
// repository's default language will be used.
defaultParams: {
lang: "en-us"
}
lang: "en-us",
},
});

// This will fetch Article documents with the `en-us` lang.
Expand All @@ -25,6 +25,6 @@ console.info("articlesFrench: ", articlesFrench);

// This will fetch Article documents with any language.
const articlesAllLanguages = await client.getAllByType("article", {
lang: "*"
lang: "*",
});
console.info("articlesAllLanguages: ", articlesAllLanguages);
4 changes: 2 additions & 2 deletions examples/releases/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fetch from "node-fetch";

const endpoint = prismic.getEndpoint("qwerty");
const client = prismic.createClient(endpoint, {
fetch
fetch,
});

// By default, the client will fetch the latest published content from the repository.
Expand Down Expand Up @@ -31,7 +31,7 @@ console.info(aboutPage);
// We can also override the release on a per-query basis.
const otherRelease = await client.getReleaseByLabel("My Other Release");
const contactPage = await client.getByUID("page", "contact", {
ref: otherRelease.ref
ref: otherRelease.ref,
});
console.info(contactPage);

Expand Down
2 changes: 1 addition & 1 deletion examples/server-usage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const endpoint = prismic.getEndpoint("qwerty");
const client = prismic.createClient(endpoint, {
// Here, we provide a way for the client to make network requests.
// `node-fetch` is a Node.js fetch-compatible package.
fetch
fetch,
});

const homepage = await client.getByUID("page", "home");
Expand Down
4 changes: 2 additions & 2 deletions examples/using-refs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fetch from "node-fetch";

const endpoint = prismic.getEndpoint("qwerty");
const client = prismic.createClient(endpoint, {
fetch
fetch,
});

// By default, the client will fetch the latest published content from the repository.
Expand All @@ -30,7 +30,7 @@ console.info(aboutPage);
// We can also override the ref on a per-query basis.
const otherRef = await client.getRefByLabel("My Other Ref");
const contactPage = await client.getByUID("page", "contact", {
ref: otherRef.ref
ref: otherRef.ref,
});
console.info(contactPage);

Expand Down
8 changes: 4 additions & 4 deletions examples/with-express/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import QuickLRU from "quick-lru";

const endpoint = prismic.getEndpoint("qwerty");
const cache = new QuickLRU({
maxSize: 1000 // 1000 entries
maxSize: 1000, // 1000 entries
});

const client = prismic.createClient(endpoint, {
Expand All @@ -28,7 +28,7 @@ const client = prismic.createClient(endpoint, {

return res;
}
}
},
});

/**
Expand All @@ -52,10 +52,10 @@ app.use(prismicAutoPreviewsMiddleware);
app.get("/articles", async (_req, res) => {
const articles = await client.getAllByType("article");

const payload = articles.map(article => ({
const payload = articles.map((article) => ({
title: PrismicDOM.RichText.asText(article.data.title),
description: PrismicDOM.RichText.asText(article.data.shortlede),
content: PrismicDOM.RichText.asHtml(article.data.content)
content: PrismicDOM.RichText.asHtml(article.data.content),
}));

res.json(payload);
Expand Down
2 changes: 1 addition & 1 deletion examples/with-typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const main = async () => {
console.info("nonExistantField: ", nonExistantField);

const blogPosts = await client.getAllByType<PrismicDocumentBlogPost>(
"blog_post"
"blog_post",
);
// => All Blog Post documents.
console.info("blogPosts: ", blogPosts);
Expand Down
Loading

0 comments on commit 21633e0

Please sign in to comment.