]> git.openstreetmap.org Git - rails.git/blobdiff - config/eslint.js
Merge remote-tracking branch 'upstream/pull/5612'
[rails.git] / config / eslint.js
index c9ef72e3e1357bad9d2bb2f6b92a1e818acdc719..cb421a9920ce3874ab151c49e340c4ce189fdb1e 100644 (file)
@@ -1,9 +1,11 @@
 const globals = require("globals");
 const js = require("@eslint/js");
+const erb = require("eslint-plugin-erb");
 const stylisticJs = require("@stylistic/eslint-plugin-js");
 
 module.exports = [
   js.configs.recommended,
+  erb.configs.recommended,
   {
     plugins: {
       "@stylistic": stylisticJs
@@ -19,11 +21,19 @@ module.exports = [
         L: "readonly",
         OSM: "writable",
         Matomo: "readonly",
-        Qs: "readonly",
         Turbo: "readonly",
         updateLinks: "readonly"
       }
     },
+    linterOptions: {
+      // The "unused disable directive" is set to "warn" by default.
+      // For the ERB plugin to work correctly, you must disable
+      // this directive to avoid issues described here
+      // https://github.com/eslint/eslint/discussions/18114
+      // If you're using the CLI, you might also use the following flag:
+      // --report-unused-disable-directives-severity=off
+      reportUnusedDisableDirectives: "off"
+    },
     rules: {
       "@stylistic/array-bracket-newline": ["error", "consistent"],
       "@stylistic/array-bracket-spacing": "error",