Run eslint on all js files

Reviewed By: zertosh

Differential Revision: D5405047

fbshipit-source-id: 5ade9d8beb3688d8bb08a208709c0dbf1ec671b2
This commit is contained in:
Eli White 2017-07-12 13:48:49 -07:00 committed by Facebook Github Bot
parent 1d353b4ef7
commit fc86f25f9a
13 changed files with 29 additions and 18 deletions

View File

@ -4,3 +4,11 @@
**/main.js **/main.js
Libraries/vendor/**/* Libraries/vendor/**/*
Libraries/Renderer/* Libraries/Renderer/*
website/node_modules
pr-inactivity-bookmarklet.js
question-bookmarklet.js
flow/
website/core/metadata.js
website/core/metadata-blog.js
website/src/react-native/docs/
website/src/react-native/blog/

View File

@ -10,8 +10,6 @@
* @nolint * @nolint
*/ */
/* eslint-disable */
// These annotations are copy/pasted from the built-in Flow definitions for // These annotations are copy/pasted from the built-in Flow definitions for
// Native Map. // Native Map.

View File

@ -10,8 +10,6 @@
* @nolint * @nolint
*/ */
/* eslint-disable */
declare class Position { declare class Position {
coords: Coordinates, coords: Coordinates,
timestamp: number, timestamp: number,

View File

@ -10,8 +10,6 @@
* @nolint * @nolint
*/ */
/* eslint-disable */
// These annotations are copy/pasted from the built-in Flow definitions for // These annotations are copy/pasted from the built-in Flow definitions for
// Native Promises with some non-standard APIs added in // Native Promises with some non-standard APIs added in
declare class Promise<+R> { declare class Promise<+R> {

View File

@ -10,8 +10,6 @@
* @nolint * @nolint
*/ */
/* eslint-disable */
// These annotations are copy/pasted from the built-in Flow definitions for // These annotations are copy/pasted from the built-in Flow definitions for
// Native Set. // Native Set.

View File

@ -10,8 +10,6 @@
* @nolint * @nolint
*/ */
/* eslint-disable */
declare module 'console' { declare module 'console' {
declare function assert(value: any, ...message: any): void; declare function assert(value: any, ...message: any): void;
declare function dir( declare function dir(

2
flow/react.js vendored
View File

@ -10,8 +10,6 @@
* @nolint * @nolint
*/ */
/* eslint-disable */
// Temporary patches for React.Component and React.Element. // Temporary patches for React.Component and React.Element.
declare var ReactComponent: typeof React$Component; declare var ReactComponent: typeof React$Component;
declare var ReactElement: typeof React$Element; declare var ReactElement: typeof React$Element;

View File

@ -8,6 +8,9 @@
* *
* @flow * @flow
*/ */
/* eslint-env node */
'use strict'; 'use strict';
const babel = require('babel-core'); const babel = require('babel-core');

View File

@ -161,7 +161,7 @@ function buildProject(xcodeProject, udid, scheme, configuration = 'Debug', launc
if (productNameMatch && productNameMatch.length && productNameMatch.length > 1) { if (productNameMatch && productNameMatch.length && productNameMatch.length > 1) {
return resolve(productNameMatch[1]);//0 is the full match, 1 is the app name return resolve(productNameMatch[1]);//0 is the full match, 1 is the app name
} }
return buildProcess.error? reject(error) : resolve(); return buildProcess.error? reject(buildProcess.error) : resolve();
}); });
}); });
} }

View File

@ -13,9 +13,11 @@ var script = process.argv[1];
var installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1; var installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1;
if (installedGlobally) { if (installedGlobally) {
const chalk = require('chalk');
console.error([ console.error([
'\033[31mLooks like you installed react-native globally, maybe you meant react-native-cli?', chalk.red('Looks like you installed react-native globally, maybe you meant react-native-cli?'),
'To fix the issue, run:\033[0m', chalk.red('To fix the issue, run:'),
'npm uninstall -g react-native', 'npm uninstall -g react-native',
'npm install -g react-native-cli' 'npm install -g react-native-cli'
].join('\n')); ].join('\n'));

View File

@ -116,7 +116,7 @@
"scripts": { "scripts": {
"test": "jest", "test": "jest",
"flow": "flow", "flow": "flow",
"lint": "eslint RNTester/ Libraries/", "lint": "eslint .",
"start": "/usr/bin/env bash -c './scripts/packager.sh \"$@\" || true' --", "start": "/usr/bin/env bash -c './scripts/packager.sh \"$@\" || true' --",
"test-android-setup": "docker pull containership/android-base:latest", "test-android-setup": "docker pull containership/android-base:latest",
"test-android-build": "docker build -t react/android -f ContainerShip/Dockerfile.android .", "test-android-build": "docker build -t react/android -f ContainerShip/Dockerfile.android .",

View File

@ -1,6 +1,11 @@
'use strict';
/** /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* 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.
*
* Used in run-ci-e2e-test.js and executed in Travis and Circle CI. * Used in run-ci-e2e-test.js and executed in Travis and Circle CI.
* E2e test that verifies that init app can be installed, compiled, started and Hot Module reloading and Chrome debugging work. * E2e test that verifies that init app can be installed, compiled, started and Hot Module reloading and Chrome debugging work.
* For other examples of appium refer to: https://github.com/appium/sample-code/tree/master/sample-code/examples/node and * For other examples of appium refer to: https://github.com/appium/sample-code/tree/master/sample-code/examples/node and
@ -20,6 +25,10 @@
* - node ../node_modules/.bin/_mocha ../android-e2e-test.js * - node ../node_modules/.bin/_mocha ../android-e2e-test.js
*/ */
/* eslint-env mocha */
'use strict';
const wd = require('wd'); const wd = require('wd');
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');

View File

@ -9,6 +9,7 @@
'use strict'; 'use strict';
var semverCmp = require('semver-compare'); var semverCmp = require('semver-compare');
/*eslint-disable no-undef */
require(`shelljs/global`); require(`shelljs/global`);
const CIRCLE_BRANCH = process.env.CIRCLE_BRANCH; const CIRCLE_BRANCH = process.env.CIRCLE_BRANCH;