From 36f2d18b103c8e4c7ee18bea5213ec8a5d90d041 Mon Sep 17 00:00:00 2001 From: Eli White Date: Thu, 17 Aug 2017 16:14:16 -0700 Subject: [PATCH] Disallow trailing commas in react-native-github Reviewed By: cpojer Differential Revision: D5645043 fbshipit-source-id: 7378cc96ce39d3d18da7fba51d48db84cfdfa08f --- .eslintrc | 12 +++++++++++- Libraries/.eslintrc | 7 +++++++ RNTester/.eslintrc | 7 +++++++ jest/.eslintrc | 7 +++++++ local-cli/.eslintrc | 4 ++++ 5 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 Libraries/.eslintrc create mode 100644 RNTester/.eslintrc create mode 100644 jest/.eslintrc diff --git a/.eslintrc b/.eslintrc index 2e07c99e8..f840c3abc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -64,7 +64,17 @@ // General - "comma-dangle": 0, // disallow trailing commas in object literals + // This must be disallowed in this repo because the minimum supported + // version of node is 4 which doesn't support trailing commas. + // Once the minimum supported version is 8 or greater this can be changed + "comma-dangle": [2, { // disallow trailing commas in object literals + "arrays": "ignore", + "objects": "ignore", + "imports": "ignore", + "exports": "ignore", + "functions": "never" + }], + "no-cond-assign": 1, // disallow assignment in conditional expressions "no-console": 0, // disallow use of console (off by default in the node environment) "no-const-assign": 2, // disallow assignment to const-declared variables diff --git a/Libraries/.eslintrc b/Libraries/.eslintrc new file mode 100644 index 000000000..ddcf4e272 --- /dev/null +++ b/Libraries/.eslintrc @@ -0,0 +1,7 @@ +{ + "rules": { + // This folder currently runs through babel and doesn't need to be + // compatible with node 4 + "comma-dangle": 0 + } +} diff --git a/RNTester/.eslintrc b/RNTester/.eslintrc new file mode 100644 index 000000000..ddcf4e272 --- /dev/null +++ b/RNTester/.eslintrc @@ -0,0 +1,7 @@ +{ + "rules": { + // This folder currently runs through babel and doesn't need to be + // compatible with node 4 + "comma-dangle": 0 + } +} diff --git a/jest/.eslintrc b/jest/.eslintrc new file mode 100644 index 000000000..ddcf4e272 --- /dev/null +++ b/jest/.eslintrc @@ -0,0 +1,7 @@ +{ + "rules": { + // This folder currently runs through babel and doesn't need to be + // compatible with node 4 + "comma-dangle": 0 + } +} diff --git a/local-cli/.eslintrc b/local-cli/.eslintrc index 6f2bcc4db..dcb7e7947 100644 --- a/local-cli/.eslintrc +++ b/local-cli/.eslintrc @@ -1,5 +1,9 @@ { "rules": { + // This folder currently runs through babel and doesn't need to be + // compatible with node 4 + "comma-dangle": 0, + "extra-arrow-initializer": 0, "no-alert": 0, "no-console-disallow": 0