fix: removed linting errors on yarn lint (#4178)

This commit is contained in:
Nimish Gupta
2020-04-28 18:41:46 +05:30
committed by GitHub
parent e77ea00e9d
commit 9570d64b67
8 changed files with 12 additions and 13 deletions

View File

@@ -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);

View File

@@ -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

View File

@@ -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;

View File

@@ -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(

View File

@@ -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}`;

View File

@@ -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
View File

@@ -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)
);
}

View File

@@ -1,5 +1,4 @@
const {
getLatestNodeVersion,
glob,
getWriteableDirectory,
} = require('@now/build-utils');