From 40fdd6d91c578934b9e1035a167888032fb85d28 Mon Sep 17 00:00:00 2001 From: Eli White Date: Mon, 10 Jul 2017 12:01:50 -0700 Subject: [PATCH] Enable eslint on circle ci Reviewed By: zertosh Differential Revision: D5374369 fbshipit-source-id: 5ffd246bc6fa735d781ed71cd293b7883184b786 --- .eslintignore | 1 + .eslintrc | 37 ++++++++++++------------------------- Libraries/Network/fetch.js | 3 +++ circle.yml | 1 + 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.eslintignore b/.eslintignore index d0528c4a5..d67d67ef2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,3 +3,4 @@ **/staticBundle.js **/main.js Libraries/vendor/**/* +Libraries/Renderer/* diff --git a/.eslintrc b/.eslintrc index ef11f5e96..1c9e76717 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,4 +1,6 @@ { + "root": true, + "parser": "babel-eslint", "ecmaFeatures": { @@ -11,6 +13,7 @@ }, "plugins": [ + "flowtype", "react" ], @@ -49,33 +52,17 @@ "setTimeout": false, "window": false, "XMLHttpRequest": false, - "pit": false, - - // Flow global types. - "ReactComponent": false, - "ReactClass": false, - "ReactElement": false, - "ReactPropsCheckType": false, - "ReactPropsChainableTypeChecker": false, - "ReactPropTypes": false, - "SyntheticEvent": false, - "$Either": false, - "$All": false, - "$ArrayBufferView": false, - "$Tuple": false, - "$Supertype": false, - "$Subtype": false, - "$Shape": false, - "$Diff": false, - "$Keys": false, - "$Enum": false, - "$Exports": false, - "$FlowIssue": false, - "$FlowFixMe": false, - "$FixMe": false + "pit": false }, "rules": { + // Flow Plugin + // The following rules are made available via `eslint-plugin-flowtype` + "flowtype/define-flow-type": 1, + "flowtype/use-flow-type": 1, + + // General + "comma-dangle": 0, // disallow trailing commas in object literals "no-cond-assign": 1, // disallow assignment in conditional expressions "no-console": 0, // disallow use of console (off by default in the node environment) @@ -241,6 +228,6 @@ "react/prop-types": 0, "react/react-in-jsx-scope": 1, "react/self-closing-comp": 1, - "react/wrap-multilines": 0, + "react/wrap-multilines": 0 } } diff --git a/Libraries/Network/fetch.js b/Libraries/Network/fetch.js index e8170f874..163897752 100644 --- a/Libraries/Network/fetch.js +++ b/Libraries/Network/fetch.js @@ -10,6 +10,9 @@ * @nolint * */ + +/* eslint-disable */ + 'use strict'; import 'whatwg-fetch'; diff --git a/circle.yml b/circle.yml index 6b36c93d5..d5f2dead8 100644 --- a/circle.yml +++ b/circle.yml @@ -51,6 +51,7 @@ test: override: # eslint bot. This GitHub token grants public_repo access scope. - cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js + - npm run lint # JS tests for dependencies installed with npm3 - npm run flow -- check - npm test -- --maxWorkers=1