Bug 1639814 - Port bug 1617959: Switch to the babel-eslint parser. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 21 May 2020 20:15:08 +1200
changeset 39212 a15cee0df19fc84a95e32cb0e1ae1f438001c917
parent 39211 1f1af3f6677b3bf539cc86f1e42546ecdfe85aa1
child 39213 f8310228f5b2c75ff65bbb4e182eb6ce693c6e28
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersmkmelin
bugs1639814, 1617959
Bug 1639814 - Port bug 1617959: Switch to the babel-eslint parser. r=mkmelin
.eslintrc.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -17,24 +17,35 @@ const xpcshellTestPaths = [
   "**/test*/unit*/",
   "**/test*/xpcshell/",
   "chat/**/test*/",
 ];
 
 const browserTestPaths = ["**/test*/**/browser/"];
 
 module.exports = {
+  parser: "babel-eslint",
+  parserOptions: {
+    sourceType: "script",
+    babelOptions: {
+      plugins: [
+        "@babel/plugin-syntax-optional-chaining",
+        "@babel/plugin-syntax-nullish-coalescing-operator",
+      ],
+    },
+  },
+
   root: true,
 
   // We would like the same base rules as provided by
   // mozilla/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
   extends: ["plugin:mozilla/recommended"],
 
   // When adding items to this file please check for effects on sub-directories.
-  plugins: ["html", "mozilla"],
+  plugins: ["mozilla"],
 
   rules: {
     complexity: ["error", 80],
     "func-names": ["error", "never"],
     "mozilla/prefer-boolean-length-check": "off",
   },
 
   // To avoid bad interactions of the html plugin with the xml preprocessor in