From 1e2de712907e5fe0d17648f0ff5c81d4384ca85b Mon Sep 17 00:00:00 2001 From: Eli White Date: Thu, 10 May 2018 19:06:41 -0700 Subject: [PATCH] Allow trailing commas Summary: This was previously set to disallow trailing commas on function arguments which prettier would add. Since we are dropping support for node < 8, we can now change this setting to require trailing commas everywhere and be consistent with the prettier config at Facebook. Reviewed By: hramos Differential Revision: D7961098 fbshipit-source-id: fbe49513183a8c8e027bb05467a767235dbfb15b --- .eslintrc | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.eslintrc b/.eslintrc index 9887d1c6d..395f7d824 100644 --- a/.eslintrc +++ b/.eslintrc @@ -57,18 +57,7 @@ "rules": { // General - - // 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" - }], - + "comma-dangle": [1, "always-multiline"], // allow or disallow trailing commas "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 @@ -267,27 +256,11 @@ }, "overrides": [ - { - "files": [ - "Libraries/**/*.js", - "RNTester/**/*.js", - "jest/**/*.js", - ], - "rules": { - // These folders currently run through babel and don't need to be - // compatible with node 4 - "comma-dangle": 0, - }, - }, { "files": [ "local-cli/**/*.js", ], "rules": { - // This folder currently runs through babel and doesn't need to be - // compatible with node 4 - "comma-dangle": 0, - "lint/extra-arrow-initializer": 0, "no-alert": 0, "no-console-disallow": 0,