From 4ddcfde5291bf09cd08fcd5714f14d13a2b4f954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 17 Mar 2023 18:44:04 +0100 Subject: [PATCH 1/3] Explicitly enable ERB linters I thought SelfClosingTag was enabled since it was on the list and the `enabled: false` got lost among all the `enabled: true`. ERB Lint 0.1 and later will also add RequireInputAutocomplete as a default linter, and we're not interested in it, at least for now. So, just like we do for Rubocop, we're disabling all linters and enabling the ones we use explicitly. --- .erb-lint.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.erb-lint.yml b/.erb-lint.yml index 1643ea6f6..025fe0acb 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -1,5 +1,8 @@ --- +EnableDefaultLinters: false linters: + AllowedScriptType: + enabled: true ClosingErbTagIndent: enabled: true ErbSafety: @@ -10,8 +13,10 @@ linters: enabled: true NoJavascriptTagHelper: enabled: true - SelfClosingTag: - enabled: false + ParserErrors: + enabled: true + RightTrim: + enabled: true SpaceAroundErbTag: enabled: true SpaceIndentation: From 09a62d6f2cf3a91b426eb8e51d6e0b374f5ce7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 17 Mar 2023 18:49:55 +0100 Subject: [PATCH 2/3] Bump erb_lint from 0.0.37 to 0.3.1 We also need to update pronto-erb_lint since the old version depended on erb_lint 0.0.x. --- Gemfile | 4 ++-- Gemfile.lock | 23 ++++++++++------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index 1546de3b6..2cada7af5 100644 --- a/Gemfile +++ b/Gemfile @@ -100,10 +100,10 @@ group :development do gem "capistrano-rails", "~> 1.6.2", require: false gem "capistrano3-delayed-job", "~> 1.7.6" gem "capistrano3-puma", "~> 5.2.0" - gem "erb_lint", "~> 0.0.37", require: false + gem "erb_lint", "~> 0.3.1", require: false gem "mdl", "~> 0.11.0", require: false gem "pronto", "~> 0.11.0", require: false - gem "pronto-erb_lint", "~> 0.1.5", require: false + gem "pronto-erb_lint", "~> 0.1.6", require: false gem "pronto-eslint", "~> 0.11.0", require: false gem "pronto-rubocop", "~> 0.11.2", require: false gem "pronto-scss", "~> 0.11.0", require: false diff --git a/Gemfile.lock b/Gemfile.lock index e0907195c..855126d24 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,12 +87,11 @@ GEM babel-source (>= 4.0, < 6) execjs (~> 2.0) bcrypt (3.1.18) - better_html (1.0.16) - actionview (>= 4.0) - activesupport (>= 4.0) + better_html (2.0.1) + actionview (>= 6.0) + activesupport (>= 6.0) ast (~> 2.0) erubi (~> 1.4) - html_tokenizer (~> 0.0.6) parser (>= 2.4) smart_properties bindex (0.8.1) @@ -184,10 +183,9 @@ GEM htmlentities (~> 4.3.3) launchy (~> 2.1) mail (~> 2.7) - erb_lint (0.0.37) + erb_lint (0.3.1) activesupport - better_html (~> 1.0.7) - html_tokenizer + better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow rubocop @@ -266,7 +264,6 @@ GEM rexml (~> 3.0) hashie (5.0.0) highline (2.0.3) - html_tokenizer (0.0.7) htmlentities (4.3.4) httparty (0.21.0) mini_mime (>= 1.0.0) @@ -420,9 +417,9 @@ GEM rexml (~> 3.2) rugged (>= 0.23.0, < 1.1.0) thor (>= 0.20.3, < 2.0) - pronto-erb_lint (0.1.5) - erb_lint (~> 0.0.24) - pronto (> 0.9.0) + pronto-erb_lint (0.1.6) + erb_lint (~> 0.1, >= 0.1.1) + pronto (~> 0.9, > 0.9.0) pronto-eslint (0.11.0) eslintrb (~> 2.0, >= 2.0.0) pronto (~> 0.11.0) @@ -695,7 +692,7 @@ DEPENDENCIES devise (~> 4.8.1) devise-security (~> 0.16.0) email_spec (~> 2.2.0) - erb_lint (~> 0.0.37) + erb_lint (~> 0.3.1) factory_bot_rails (~> 6.2.0) faker (~> 2.22.0) file_validators (~> 3.0.0) @@ -729,7 +726,7 @@ DEPENDENCIES pg (~> 1.4.3) pg_search (~> 2.3.6) pronto (~> 0.11.0) - pronto-erb_lint (~> 0.1.5) + pronto-erb_lint (~> 0.1.6) pronto-eslint (~> 0.11.0) pronto-rubocop (~> 0.11.2) pronto-scss (~> 0.11.0) From 99b0ef07f247b42d8fb0dd1edb628691c0a54917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 17 Mar 2023 18:58:04 +0100 Subject: [PATCH 3/3] Enable CommentSyntax ERB Linter It's a default linter in erb_lint 0.3.0, and it's useful during development since I'm always unsure about the right way to add ERB comments. --- .erb-lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.erb-lint.yml b/.erb-lint.yml index 025fe0acb..5e93f2fae 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -5,6 +5,8 @@ linters: enabled: true ClosingErbTagIndent: enabled: true + CommentSyntax: + enabled: true ErbSafety: enabled: true ExtraNewline: