Skip to content

Commit

Permalink
chore(templates): fix ESLint errors (#4029)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored Aug 20, 2022
1 parent ba5c848 commit f4d6ff6
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 16 deletions.
14 changes: 13 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const OFF = 0;
const WARN = 1;

/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [
Expand All @@ -9,7 +13,15 @@ module.exports = {
{
files: ["rollup.config.js"],
rules: {
"import/no-extraneous-dependencies": 0,
"import/no-extraneous-dependencies": OFF,
},
},
{
files: ["templates/**/*.*"],
rules: {
"prefer-const": WARN,

"prefer-let/prefer-let": OFF,
},
},
],
Expand Down
3 changes: 0 additions & 3 deletions templates/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion templates/cloudflare-pages/app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function handleRequest(
responseHeaders: Headers,
remixContext: EntryContext
) {
let markup = renderToString(
const markup = renderToString(
<RemixServer context={remixContext} url={request.url} />
);

Expand Down
2 changes: 1 addition & 1 deletion templates/cloudflare-workers/app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function handleRequest(
responseHeaders: Headers,
remixContext: EntryContext
) {
let markup = renderToString(
const markup = renderToString(
<RemixServer context={remixContext} url={request.url} />
);

Expand Down
4 changes: 2 additions & 2 deletions templates/express/app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export default function handleRequest(
return new Promise((resolve, reject) => {
let didError = false;

let { pipe, abort } = renderToPipeableStream(
const { pipe, abort } = renderToPipeableStream(
<RemixServer context={remixContext} url={request.url} />,
{
onShellReady: () => {
let body = new PassThrough();
const body = new PassThrough();

responseHeaders.set("Content-Type", "text/html");

Expand Down
2 changes: 1 addition & 1 deletion templates/express/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function purgeRequireCache() {
// alternatively you can set up nodemon/pm2-dev to restart the server on
// file changes, but then you'll have to reconnect to databases/etc on each
// change. We prefer the DX of this, so we've included it for you by default
for (let key in require.cache) {
for (const key in require.cache) {
if (key.startsWith(BUILD_DIR)) {
delete require.cache[key];
}
Expand Down
4 changes: 2 additions & 2 deletions templates/fly/app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export default function handleRequest(
return new Promise((resolve, reject) => {
let didError = false;

let { pipe, abort } = renderToPipeableStream(
const { pipe, abort } = renderToPipeableStream(
<RemixServer context={remixContext} url={request.url} />,
{
onShellReady: () => {
let body = new PassThrough();
const body = new PassThrough();

responseHeaders.set("Content-Type", "text/html");

Expand Down
6 changes: 3 additions & 3 deletions templates/netlify/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ function getLoadContext(event, context) {
netlifyGraphToken = event.authlifyToken;
}

let authHeader = event.headers["authorization"];
let graphSignatureHeader = event.headers["x-netlify-graph-signature"];
const authHeader = event.headers["authorization"];
const graphSignatureHeader = event.headers["x-netlify-graph-signature"];

if (authHeader != null && /Bearer /gi.test(authHeader)) {
rawAuthorizationString = authHeader.split(" ")[1];
}

let loadContext = {
const loadContext = {
clientNetlifyGraphAccessToken: rawAuthorizationString,
netlifyGraphToken: netlifyGraphToken,
netlifyGraphSignature: graphSignatureHeader,
Expand Down
4 changes: 2 additions & 2 deletions templates/remix/app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export default function handleRequest(
return new Promise((resolve, reject) => {
let didError = false;

let { pipe, abort } = renderToPipeableStream(
const { pipe, abort } = renderToPipeableStream(
<RemixServer context={remixContext} url={request.url} />,
{
onShellReady: () => {
let body = new PassThrough();
const body = new PassThrough();

responseHeaders.set("Content-Type", "text/html");

Expand Down

0 comments on commit f4d6ff6

Please sign in to comment.