mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 04:22:04 +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 {
|
||||
glob,
|
||||
debug,
|
||||
download,
|
||||
shouldServe,
|
||||
createLambda,
|
||||
@@ -14,7 +13,7 @@ exports.analyze = ({ files, entrypoint }) => files[entrypoint].digest;
|
||||
|
||||
exports.version = 3;
|
||||
|
||||
exports.build = async ({ workPath, files, entrypoint, meta, config }) => {
|
||||
exports.build = async ({ workPath, files, entrypoint, meta }) => {
|
||||
const outDir = await getWritableDirectory();
|
||||
|
||||
await download(files, workPath, meta);
|
||||
|
||||
@@ -6,6 +6,7 @@ if (!process.env.NODE_ENV) {
|
||||
import { Server } from 'http';
|
||||
import { Bridge } from './now__bridge';
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const page = require(__LAUNCHER_PAGE_PATH__);
|
||||
|
||||
// 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
|
||||
// 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.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');
|
||||
|
||||
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 probe = nowjson.probes[0];
|
||||
const probeUrl = `https://${deploymentUrl}${probe.path}`;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = async function({ deploymentUrl, fetch, randomness }) {
|
||||
module.exports = async function({ deploymentUrl, fetch }) {
|
||||
const nowjson = require('./now.json');
|
||||
const probe = nowjson.probes[0];
|
||||
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 { tmpdir } = require('os');
|
||||
const { mkdirSync, writeFileSync } = require('fs');
|
||||
@@ -20,14 +19,14 @@ function getRandomText(wordCount) {
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
function getRandomFileData(min) {
|
||||
function getRandomFileData() {
|
||||
const wordCount = getRandomInt(1000, 2000);
|
||||
return getRandomText(wordCount);
|
||||
}
|
||||
|
||||
function createRandomFile(dir, i) {
|
||||
function createRandomFile(dir) {
|
||||
const fileName = getRandomId() + '.txt';
|
||||
const data = getRandomFileData(i);
|
||||
const data = getRandomFileData();
|
||||
writeFileSync(join(dir, fileName), data, 'utf8');
|
||||
}
|
||||
|
||||
@@ -40,8 +39,8 @@ function createRandomProject(dir, fileCount) {
|
||||
writeFileSync(join(dir, 'now.json'), nowJson, 'utf8');
|
||||
const publicDir = join(dir, 'public');
|
||||
mkdirSync(publicDir);
|
||||
Array.from({ length: fileCount }).forEach((_, i) =>
|
||||
createRandomFile(publicDir, i)
|
||||
Array.from({ length: fileCount }).forEach(() =>
|
||||
createRandomFile(publicDir)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const {
|
||||
getLatestNodeVersion,
|
||||
glob,
|
||||
getWriteableDirectory,
|
||||
} = require('@now/build-utils');
|
||||
|
||||
Reference in New Issue
Block a user