Skip to content

Commit

Permalink
Allow trailing commas
Browse files Browse the repository at this point in the history
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
  • Loading branch information
elicwhite authored and facebook-github-bot committed May 11, 2018
1 parent cd7c91f commit 1e2de71
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1e2de71

Please sign in to comment.