Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions resources/interfaces/express.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* @flow */
/* Flow declarations for express requests and responses */
/* eslint-disable no-unused-vars */
declare class Request {
method: String;
body: Object;
Expand Down
3 changes: 2 additions & 1 deletion resources/mocha-bootload.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/* eslint-disable no-console */

require('babel/register')({
optional: ['es7.asyncFunctions']
optional: [ 'es7.asyncFunctions' ]
});

process.on('unhandledRejection', function (error) {
Expand Down
21 changes: 12 additions & 9 deletions resources/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/* eslint-disable no-console */

import sane from 'sane';
import { resolve as resolvePath } from 'path';
Expand All @@ -21,7 +22,7 @@ var srcDir = resolvePath(cmd, './src');
function exec(command, options) {
return new Promise(function (resolve, reject) {
var child = spawn(command, options, {
cmd: cmd,
cmd,
env: process.env,
stdio: 'inherit'
});
Expand All @@ -35,12 +36,12 @@ function exec(command, options) {
});
}

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

var watcher = sane(srcDir, { glob: ['**/*.js', '**/*.graphql'] })
var watcher = sane(srcDir, { glob: [ '**/*.js', '**/*.graphql' ] })
.on('ready', startWatch)
.on('add', changeFile)
.on('delete', deleteFile)
Expand Down Expand Up @@ -134,7 +135,8 @@ function runTests(filepaths) {
'--reporter', 'progress',
'--require', 'resources/mocha-bootload'
].concat(
allTests(filepaths) ? filepaths.map(srcPath) : ['src/**/__tests__/**/*.js']
allTests(filepaths) ? filepaths.map(srcPath) :
[ 'src/**/__tests__/**/*.js' ]
)).catch(() => false);
}

Expand All @@ -144,10 +146,11 @@ function lintFiles(filepaths) {
return filepaths.reduce((prev, filepath) => prev.then(prevSuccess => {
if (isJS(filepath)) {
process.stdout.write(' ' + filepath + ' ...');
return exec('eslint', [srcPath(filepath)])
return exec('eslint', [ srcPath(filepath) ])
.catch(() => false)
.then(success => {
console.log(CLEARLINE + ' ' + (success ? CHECK : X) + ' ' + filepath);
let msg = CLEARLINE + ' ' + (success ? CHECK : X) + ' ' + filepath;
console.log(msg);
return prevSuccess && success;
});
}
Expand All @@ -157,7 +160,7 @@ function lintFiles(filepaths) {

function typecheckStatus() {
console.log('\nType Checking\n');
return exec(flowBinPath, ['status']).catch(() => false);
return exec(flowBinPath, [ 'status' ]).catch(() => false);
}

// Filepath
Expand All @@ -177,7 +180,7 @@ function allTests(filepaths) {
}

function isTest(filepath) {
return isJS(filepath) && ~filepath.indexOf('__tests__/');
return isJS(filepath) && filepath.indexOf('__tests__/') !== -1;
}

// Print helpers
Expand Down