]> git.openstreetmap.org Git - rails.git/blobdiff - config/eslint.js
Merge pull request #5421 from tomhughes/ecma-version
[rails.git] / config / eslint.js
index a52b1e63f85c28cb2e82557fd635e676a56e1c71..b4d0429e4ae8417db3fbfe4b3324fe721e20fc39 100644 (file)
@@ -5,7 +5,7 @@ module.exports = [
   js.configs.recommended,
   {
     languageOptions: {
   js.configs.recommended,
   {
     languageOptions: {
-      ecmaVersion: 2015,
+      ecmaVersion: 2021,
       sourceType: "script",
       globals: {
         ...globals.browser,
       sourceType: "script",
       globals: {
         ...globals.browser,
@@ -122,6 +122,18 @@ module.exports = [
       "yoda": "error"
     }
   },
       "yoda": "error"
     }
   },
+  {
+    // Additional configuration for test files
+    files: ["test/**/*.js"],
+    languageOptions: {
+      globals: {
+        ...globals.mocha,
+        expect: "readonly",
+        assert: "readonly",
+        should: "readonly"
+      }
+    }
+  },
   {
     files: ["config/eslint.js"],
     languageOptions: {
   {
     files: ["config/eslint.js"],
     languageOptions: {