Bug 1577606 - Adjust eslint and prettier config for reformatting. r=darktrojan draft
authorPaul Morris <paul@thunderbird.net>
Thu, 29 Aug 2019 15:09:53 -0400
changeset 78319 57477e8c827154097767e4cf12326f1272858a0b
parent 78318 c7fc05334d48e2a15f15112dc9d05bf4482506ea
child 78320 7e8927cfbe228606e4f79da4a47de64afe0f920c
push id9205
push userpaul@paulwmorris.com
push dateFri, 30 Aug 2019 15:16:40 +0000
treeherdertry-comm-central@e45a5591430c [default view] [failures only]
reviewersdarktrojan
bugs1577606
Bug 1577606 - Adjust eslint and prettier config for reformatting. r=darktrojan
.prettierignore
calendar/.eslintrc.js
calendar/.prettierrc
--- a/.prettierignore
+++ b/.prettierignore
@@ -6,16 +6,15 @@
 *.xhtml
 *.xul
 *.xml
 
 # Ignore .eslintrc.js for now.
 .eslintrc.js
 
 # Ignore all top-level directories that contain JS files (for now).
-calendar/**
 chat/**
 common/**
 editor/**
 ldap/**
 mail/**
 mailnews/**
 suite/**
--- a/calendar/.eslintrc.js
+++ b/calendar/.eslintrc.js
@@ -27,17 +27,18 @@ module.exports = {
 
         // We should get better at complexity, but at the moment it is what it is
         "complexity": [2, 90],
 
         // Enforce curly brace conventions for all control statements.
         "curly": 2,
 
         // Enforce the spacing around the * in generator functions.
-        "generator-star-spacing": [2, "after"],
+        // Turned off to override comm/.eslintrc.js and let Prettier handle it.
+        "generator-star-spacing": "off",
 
         // Require space before/after arrow function's arrow
         "arrow-spacing": [2, { before: true, after: true }],
 
         // Enforces spacing between keys and values in object literal properties.
         "key-spacing": [2, { beforeColon: false, afterColon: true, mode: "minimum" }],
 
         // Disallow the omission of parentheses when invoking a constructor with no
@@ -398,19 +399,16 @@ module.exports = {
         "dot-notation": 2,
 
         // Disallow named function expressions
         "func-names": [2, "never"],
 
         // Enforce placing object properties on separate lines
         "object-property-newline": [2, { allowMultiplePropertiesPerLine: true }],
 
-        // Enforce consistent line breaks inside braces
-        "object-curly-newline": [2, { multiline: true }],
-
         // Do Not Require Object Literal Shorthand Syntax
         // (Override the parent eslintrc setting for this.)
         "object-shorthand": "off",
 
         // Disallow whitespace before properties
         "no-whitespace-before-property": 2,
 
         // Disallow unnecessary escape usage
@@ -434,19 +432,16 @@ module.exports = {
         "no-unmodified-loop-condition": 2,
 
         // Suggest using arrow functions as callbacks
         "prefer-arrow-callback": [2, { allowNamedFunctions: true }],
 
         // Suggest using the spread operator instead of .apply()
         "prefer-spread": 2,
 
-        // Quoting style for property names
-        "quote-props": [2, "consistent-as-needed", { keywords: true }],
-
         // Disallow negated conditions
         "no-negated-condition": 2,
 
         // Enforce a maximum number of statements allowed per line
         "max-statements-per-line": [2, { max: 2 }],
 
         // Disallow arrow functions where they could be confused with comparisons
         "no-confusing-arrow": 2,
@@ -467,19 +462,16 @@ module.exports = {
                 /* mail/calendar words */ "to", "cc",
                 /* Components */ "Ci", "Cc", "Cu", "Cr",
             ]
         }],
 
         // Disallow lexical declarations in case/default clauses
         "no-case-declarations": 2,
 
-        // Enforce consistent indentation (4-space)
-        "indent-legacy": [2, 4, { SwitchCase: 1, }],
-
         // The following rules will not be enabled currently, but are kept here for
         // easier updates in the future.
         "no-else-return": 0,
     },
     "overrides": [{
         files: [
             "base/modules/utils/calAuthUtils.jsm",
             "base/modules/utils/calEmailUtils.jsm",
new file mode 100644
--- /dev/null
+++ b/calendar/.prettierrc
@@ -0,0 +1,5 @@
+{
+  "printWidth": 100,
+  "tabWidth": 2,
+  "trailingComma": "es5"
+}