Skip to content
Open
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
7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

8 changes: 7 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ dist
# Ignore dependency locks
pnpm-lock.yaml
package-lock.json
yarn.lock
yarn.lock

# Self-contained pnpm workspaces with their own prettier/style-guide versions
microfrontends/single-spa
microfrontends/nextjs-multi-zones
framework-boilerplates/hydrogen
framework-boilerplates/hydrogen-2
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export function HypertuneSourceProvider({
remoteLogging: {
mode: typeof window === 'undefined' ? 'off' : undefined,
},
// eslint-disable-next-line @typescript-eslint/no-empty-function

localLogger: typeof window === 'undefined' ? () => {} : undefined,
...createSourceOptions,
}),
// Don't recreate the source even if createSourceOptions changes
// eslint-disable-next-line react-hooks/exhaustive-deps

[]
)

Expand Down
2 changes: 0 additions & 2 deletions edge-middleware/feature-flag-hypertune/generated/hypertune.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable */

import * as sdk from 'hypertune'

export const queryCode = `query FullQuery{root{exampleFlag}}`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable */

import { type FlagOverridesType, encrypt, decrypt } from '@vercel/flags'
import { FlagValues } from '@vercel/flags/react'
import { cookies } from 'next/headers'
Expand Down
2 changes: 2 additions & 0 deletions edge-middleware/feature-flag-launchdarkly/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const getLdClient = cache(async (): Promise<LDClient> => {
})

export default async function Home() {
// eslint-disable-next-line react-hooks/purity
const before = Date.now()

const ldClient = await getLdClient()
Expand All @@ -54,6 +55,7 @@ export default async function Home() {
someAttribute: 'my-attribute-value',
}
const flagValue = await ldClient.variation('my-flag', ldContext, true)
// eslint-disable-next-line react-hooks/purity
const duration = Date.now() - before

return (
Expand Down
14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'eslint/config'
import nextVitals from 'eslint-config-next/core-web-vitals'

const eslintConfig = defineConfig([
...nextVitals,
{
rules: {
'@next/next/no-html-link-for-pages': 'off',
'import/no-anonymous-default-export': 'off',
},
},
])

export default eslintConfig
2 changes: 1 addition & 1 deletion flags-sdk/experimentation-statsig/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion flags-sdk/flagsmith/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion flags-sdk/growthbook/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 0 additions & 2 deletions flags-sdk/hypertune/generated/hypertune.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable */

import * as sdk from 'hypertune'

export const queryCode = `query FullQuery{root{delay proceedToCheckout freeDelivery summerSale}}`
Expand Down
2 changes: 1 addition & 1 deletion flags-sdk/hypertune/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion flags-sdk/launchdarkly/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion flags-sdk/openfeature/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion flags-sdk/posthog/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion flags-sdk/reflag/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion flags-sdk/vercel/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
// eslint-disable-next-line import/no-unresolved -- unsure
import withVercelToolbar from "@vercel/toolbar/plugins/next";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down
55 changes: 30 additions & 25 deletions framework-boilerplates/bun/server.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,54 @@
const MAX_DURATION = 1200;
const MAX_DURATION = 1200

Bun.serve({
routes: {
"/": new Response(Bun.file(new URL("./public/index.html", import.meta.url)), {
headers: { "Content-Type": "text/html; charset=utf-8" },
}),
"/api/hello": (request) =>
'/': new Response(
Bun.file(new URL('./public/index.html', import.meta.url)),
{
headers: { 'Content-Type': 'text/html; charset=utf-8' },
}
),
'/api/hello': (request) =>
Response.json({
message: "Hello from a Bun route handler!",
message: 'Hello from a Bun route handler!',
pathname: new URL(request.url).pathname,
}),
"/api/stream": async () => {
const encoder = new TextEncoder();
'/api/stream': async () => {
const encoder = new TextEncoder()
const stream = new ReadableStream({
start(controller) {
controller.enqueue(encoder.encode("Starting stream...\n"));
controller.enqueue(encoder.encode('Starting stream...\n'))

let count = 0;
let count = 0
const interval = setInterval(() => {
count++;
count++
controller.enqueue(
encoder.encode(`Stream chunk ${count} at ${new Date().toISOString()}\n`),
);
encoder.encode(
`Stream chunk ${count} at ${new Date().toISOString()}\n`
)
)

if (count >= MAX_DURATION - 5) {
clearInterval(interval);
controller.enqueue(encoder.encode("Stream completed!\n"));
controller.close();
clearInterval(interval)
controller.enqueue(encoder.encode('Stream completed!\n'))
controller.close()
}
}, 1000);
}, 1000)
},
});
})

return new Response(stream, {
headers: {
"Content-Type": "text/plain; charset=utf-8",
"Transfer-Encoding": "chunked",
'Content-Type': 'text/plain; charset=utf-8',
'Transfer-Encoding': 'chunked',
},
});
})
},
},
fetch(request) {
return Response.json(
{ error: "Not Found", pathname: new URL(request.url).pathname },
{ status: 404 },
);
{ error: 'Not Found', pathname: new URL(request.url).pathname },
{ status: 404 }
)
},
});
})
1 change: 0 additions & 1 deletion framework-boilerplates/hydrogen-2/app/components/Aside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export function Aside({

function CloseAside() {
return (
/* eslint-disable-next-line jsx-a11y/anchor-is-valid */
<a className="close" href="#" onChange={() => history.go(-1)}>
&times;
</a>
Expand Down
1 change: 0 additions & 1 deletion framework-boilerplates/hydrogen-2/app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default async function handleRequest(
{
signal: request.signal,
onError(error) {
// eslint-disable-next-line no-console
console.error(error);
responseStatusCode = 500;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default function OrderRoute() {
</thead>
<tbody>
{lineItems.map((lineItem, lineItemIndex) => (
// eslint-disable-next-line react/no-array-index-key
<OrderLineRow key={lineItemIndex} lineItem={lineItem} />
))}
</tbody>
Expand Down Expand Up @@ -171,7 +170,12 @@ function OrderLineRow({lineItem}: {lineItem: OrderLineItemFullFragment}) {
<Link to={`/products/${lineItem.variant!.product!.handle}`}>
{lineItem?.variant?.image && (
<div>
<Image data={lineItem.variant.image} width={96} height={96} />
<Image
data={lineItem.variant.image}
alt={lineItem.variant.image.altText ?? lineItem.title}
width={96}
height={96}
/>
</div>
)}
</Link>
Expand Down
1 change: 0 additions & 1 deletion framework-boilerplates/hydrogen-2/app/routes/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export async function loader({request, context}: LoaderArgs) {
},
);
} catch (error) {
// eslint-disable-next-line no-console
console.error('There was a problem loading account', error);
session.unset('customerAccessToken');
return redirect('/account/login', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export default function Activate() {
aria-label="Password"
minLength={8}
required
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
/>
<label htmlFor="passwordConfirm">Re-enter password</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default function Login() {
required
placeholder="Email address"
aria-label="Email address"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
/>
<label htmlFor="password">Password</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default function Recover() {
<input
aria-label="Email address"
autoComplete="email"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
id="email"
name="email"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export default function Register() {
required
placeholder="Email address"
aria-label="Email address"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
/>
<label htmlFor="password">Password</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default function Reset() {
<input
aria-label="Password"
autoComplete="current-password"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
id="password"
minLength={8}
Expand Down
Loading