X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d62caf5fe21911a8c07c9831170cbb1f74936d24..1e0377e6b38aac74a7da221d22b3248ec69b50d7:/config/eslint.js diff --git a/config/eslint.js b/config/eslint.js index 4e8881727..cb421a992 100644 --- a/config/eslint.js +++ b/config/eslint.js @@ -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 @@ -23,6 +25,15 @@ module.exports = [ 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", @@ -100,11 +111,10 @@ module.exports = [ "no-nested-ternary": "error", "no-new": "error", "no-new-func": "error", - "no-new-object": "error", "no-new-wrappers": "error", + "no-object-constructor": "error", "no-octal-escape": "error", "no-param-reassign": "error", - "no-process-env": "error", "no-proto": "error", "no-script-url": "error", "no-self-compare": "error",