From: Andy Allan Date: Wed, 5 Feb 2025 17:07:50 +0000 (+0000) Subject: Merge pull request #5559 from hlfan/eslint-plugin-erb X-Git-Tag: live~194 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/6142d8b8fe76acd10723e1e4658e05667287d2c6?ds=inline;hp=-c Merge pull request #5559 from hlfan/eslint-plugin-erb Add eslint-plugin-erb to provide linting of .js.erb files --- 6142d8b8fe76acd10723e1e4658e05667287d2c6 diff --combined config/eslint.js index 4e8881727,b99179d27..7cbb9575f --- a/config/eslint.js +++ b/config/eslint.js @@@ -1,9 -1,11 +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,10 -21,20 +21,19 @@@ 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",