mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 12:57:47 +00:00
fix: removed linting errors on yarn lint (#4178)
This commit is contained in:
@@ -3,7 +3,6 @@ const { mkdirp, copyFile } = require('fs-extra');
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
glob,
|
glob,
|
||||||
debug,
|
|
||||||
download,
|
download,
|
||||||
shouldServe,
|
shouldServe,
|
||||||
createLambda,
|
createLambda,
|
||||||
@@ -14,7 +13,7 @@ exports.analyze = ({ files, entrypoint }) => files[entrypoint].digest;
|
|||||||
|
|
||||||
exports.version = 3;
|
exports.version = 3;
|
||||||
|
|
||||||
exports.build = async ({ workPath, files, entrypoint, meta, config }) => {
|
exports.build = async ({ workPath, files, entrypoint, meta }) => {
|
||||||
const outDir = await getWritableDirectory();
|
const outDir = await getWritableDirectory();
|
||||||
|
|
||||||
await download(files, workPath, meta);
|
await download(files, workPath, meta);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ if (!process.env.NODE_ENV) {
|
|||||||
import { Server } from 'http';
|
import { Server } from 'http';
|
||||||
import { Bridge } from './now__bridge';
|
import { Bridge } from './now__bridge';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
const page = require(__LAUNCHER_PAGE_PATH__);
|
const page = require(__LAUNCHER_PAGE_PATH__);
|
||||||
|
|
||||||
// page.render is for React rendering
|
// page.render is for React rendering
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ export class Bridge {
|
|||||||
|
|
||||||
// This is just to appease TypeScript strict mode, since it doesn't
|
// This is just to appease TypeScript strict mode, since it doesn't
|
||||||
// understand that the Promise constructor is synchronous
|
// understand that the Promise constructor is synchronous
|
||||||
this.resolveListening = (info: AddressInfo) => {};
|
this.resolveListening = (_info: AddressInfo) => {}; // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||||
|
|
||||||
this.listening = new Promise(resolve => {
|
this.listening = new Promise(resolve => {
|
||||||
this.resolveListening = resolve;
|
this.resolveListening = resolve;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const babel = require('@babel/core');
|
const babel = require('@babel/core'); // eslint-disable-line @typescript-eslint/no-var-requires
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
const pluginTransformModulesCommonJs = require('@babel/plugin-transform-modules-commonjs');
|
const pluginTransformModulesCommonJs = require('@babel/plugin-transform-modules-commonjs');
|
||||||
|
|
||||||
export function compile(
|
export function compile(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module.exports = async function({ deploymentUrl, fetch, randomness }) {
|
module.exports = async function({ deploymentUrl, fetch }) {
|
||||||
const nowjson = require('./now.json');
|
const nowjson = require('./now.json');
|
||||||
const probe = nowjson.probes[0];
|
const probe = nowjson.probes[0];
|
||||||
const probeUrl = `https://${deploymentUrl}${probe.path}`;
|
const probeUrl = `https://${deploymentUrl}${probe.path}`;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = async function({ deploymentUrl, fetch, randomness }) {
|
module.exports = async function({ deploymentUrl, fetch }) {
|
||||||
const nowjson = require('./now.json');
|
const nowjson = require('./now.json');
|
||||||
const probe = nowjson.probes[0];
|
const probe = nowjson.probes[0];
|
||||||
const probeUrl = `https://${deploymentUrl}${probe.path}`;
|
const probeUrl = `https://${deploymentUrl}${probe.path}`;
|
||||||
|
|||||||
11
test/benchmark.js
vendored
11
test/benchmark.js
vendored
@@ -1,4 +1,3 @@
|
|||||||
const { execSync } = require('child_process');
|
|
||||||
const { join } = require('path');
|
const { join } = require('path');
|
||||||
const { tmpdir } = require('os');
|
const { tmpdir } = require('os');
|
||||||
const { mkdirSync, writeFileSync } = require('fs');
|
const { mkdirSync, writeFileSync } = require('fs');
|
||||||
@@ -20,14 +19,14 @@ function getRandomText(wordCount) {
|
|||||||
.join(' ');
|
.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomFileData(min) {
|
function getRandomFileData() {
|
||||||
const wordCount = getRandomInt(1000, 2000);
|
const wordCount = getRandomInt(1000, 2000);
|
||||||
return getRandomText(wordCount);
|
return getRandomText(wordCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createRandomFile(dir, i) {
|
function createRandomFile(dir) {
|
||||||
const fileName = getRandomId() + '.txt';
|
const fileName = getRandomId() + '.txt';
|
||||||
const data = getRandomFileData(i);
|
const data = getRandomFileData();
|
||||||
writeFileSync(join(dir, fileName), data, 'utf8');
|
writeFileSync(join(dir, fileName), data, 'utf8');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,8 +39,8 @@ function createRandomProject(dir, fileCount) {
|
|||||||
writeFileSync(join(dir, 'now.json'), nowJson, 'utf8');
|
writeFileSync(join(dir, 'now.json'), nowJson, 'utf8');
|
||||||
const publicDir = join(dir, 'public');
|
const publicDir = join(dir, 'public');
|
||||||
mkdirSync(publicDir);
|
mkdirSync(publicDir);
|
||||||
Array.from({ length: fileCount }).forEach((_, i) =>
|
Array.from({ length: fileCount }).forEach(() =>
|
||||||
createRandomFile(publicDir, i)
|
createRandomFile(publicDir)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
const {
|
const {
|
||||||
getLatestNodeVersion,
|
|
||||||
glob,
|
glob,
|
||||||
getWriteableDirectory,
|
getWriteableDirectory,
|
||||||
} = require('@now/build-utils');
|
} = require('@now/build-utils');
|
||||||
|
|||||||
Reference in New Issue
Block a user