Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint issues in 'resources/*.js' files #1873

Merged
merged 1 commit into from May 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintrc.yml
Expand Up @@ -363,9 +363,5 @@ overrides:
no-console: off
no-sync: off
global-require: off
no-shadow: off #TODO
no-unused-vars: off #TODO
no-else-return: off #TODO
object-shorthand: off #TODO
no-inner-declarations: off #TODO
prettier/prettier: off #TODO
40 changes: 20 additions & 20 deletions resources/benchmark.js
Expand Up @@ -50,30 +50,30 @@ function prepareRevision(revision) {

if (revision === LOCAL) {
return babelBuild(LOCAL_DIR());
} else {
if (!fs.existsSync(TEMP_DIR())) {
fs.mkdirSync(TEMP_DIR());
}
}

const hash = hashForRevision(revision);
const dir = TEMP_DIR(hash);
if (!fs.existsSync(TEMP_DIR())) {
fs.mkdirSync(TEMP_DIR());
}

if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
execSync(`git archive "${hash}" | tar -xC "${dir}"`);
execSync('yarn install', { cwd: dir });
}
for (const file of findFiles(LOCAL_DIR('src'), '*/__tests__/*')) {
const from = LOCAL_DIR('src', file);
const to = path.join(dir, 'src', file);
fs.copyFileSync(from, to);
}
execSync(
`cp -R "${LOCAL_DIR()}/src/__fixtures__/" "${dir}/src/__fixtures__/"`
);
const hash = hashForRevision(revision);
const dir = TEMP_DIR(hash);

return babelBuild(dir);
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
execSync(`git archive "${hash}" | tar -xC "${dir}"`);
execSync('yarn install', { cwd: dir });
}
for (const file of findFiles(LOCAL_DIR('src'), '*/__tests__/*')) {
const from = LOCAL_DIR('src', file);
const to = path.join(dir, 'src', file);
fs.copyFileSync(from, to);
}
execSync(
`cp -R "${LOCAL_DIR()}/src/__fixtures__/" "${dir}/src/__fixtures__/"`
);

return babelBuild(dir);
}

function babelBuild(dir) {
Expand Down
1 change: 0 additions & 1 deletion resources/build.js
Expand Up @@ -9,7 +9,6 @@

'use strict';

const fs = require('fs');
const path = require('path');
const assert = require('assert');
const babel = require('@babel/core');
Expand Down
4 changes: 2 additions & 2 deletions resources/fs-utils.js
Expand Up @@ -12,8 +12,8 @@
const fs = require('fs');
const path = require('path');

function mkdirRecursive(path) {
fs.mkdirSync(path, { recursive: true });
function mkdirRecursive(dirPath) {
fs.mkdirSync(dirPath, { recursive: true });
}

function rmdirRecursive(dirPath) {
Expand Down
2 changes: 1 addition & 1 deletion resources/inline-invariant.js
Expand Up @@ -25,7 +25,7 @@ module.exports = function inlineInvariant(context) {

return {
visitor: {
CallExpression: function(path) {
CallExpression(path) {
const node = path.node;
const parent = path.parent;

Expand Down
10 changes: 2 additions & 8 deletions resources/watch.js
Expand Up @@ -22,7 +22,7 @@ const srcDir = resolvePath(cmd, '../src');
function exec(command, options) {
return new Promise((resolve, reject) => {
const child = spawn(command, options, {
cmd: cmd,
cmd,
env: process.env,
stdio: 'inherit'
});
Expand All @@ -37,7 +37,7 @@ function exec(command, options) {
}

const flowServer = spawn(flowBinPath, ['server'], {
cmd: cmd,
cmd,
env: process.env
});

Expand Down Expand Up @@ -160,17 +160,11 @@ function isTest(filepath) {

const CLEARSCREEN = '\u001b[2J';
const CLEARLINE = '\r\x1B[K';
const CHECK = green('\u2713');
const X = red('\u2718');

function invert(str) {
return `\u001b[7m ${str} \u001b[27m`;
}

function red(str) {
return `\x1B[K\u001b[1m\u001b[31m${str}\u001b[39m\u001b[22m`;
}

function green(str) {
return `\x1B[K\u001b[1m\u001b[32m${str}\u001b[39m\u001b[22m`;
}
Expand Down