diff --git a/.circleci/config.yml b/.circleci/config.yml index da2c737364e..bddea93d2bb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -183,6 +183,7 @@ jobs: yarn run lint yarn run typecheck bundle exec rubocop + make lint_erb make check_asset_strings NODE_ENV=production ./bin/webpack && yarn es5-safe build-release-container: diff --git a/.erb-lint.yml b/.erb-lint.yml new file mode 100644 index 00000000000..bc8381cc21a --- /dev/null +++ b/.erb-lint.yml @@ -0,0 +1,35 @@ +EnableDefaultLinters: false +linters: + DeprecatedClasses: + enabled: true + rule_set: + - deprecated: + - 'align-(top|middle|bottom|baseline)' + - '(left)-align' + - 'justify' + - 'nowrap' + - 'line-height-[3]' + - 'list-style-none' + - 'table(-cell)?' + - 'fit' + - 'max-width-[1-4]' + - 'mxn[4]' + - 'm[trbly]?-auto' + - 'pxn[1-4]' + - 'p[trblxy]?-auto' + - 'fixed' + - 'z[1-4]' + - 'col-(right|[579])' + - 'sm-col-11?' + - '(md|lg)-col(-(right|[1-9][0-2]?))?' + - '(sm|md|lg)-flex' + - 'flex-(column|none)' + - '(items|self|justify|content)-(start|end|center|baseline|stretch)' + - 'order-([0-3]|last)' + - 'not-rounded' + - 'rounded-(top|right|bottom|left)' + - '(md|lg)-hide' + - '(xs|md|lg)-show' + - 'btn-(small|big|narrow|transparent)' + - 'border-(black|gray|white|aqua|orange|fuchsia|purple|maroon|darken-[1-4]|lighten-[1-4])' + suggestion: 'Use USWDS classes instead of BassCSS.' diff --git a/Gemfile b/Gemfile index 99536c09d01..8c2e4582e1f 100644 --- a/Gemfile +++ b/Gemfile @@ -82,6 +82,7 @@ group :development, :test do gem 'aws-sdk-cloudwatchlogs', require: false gem 'bootsnap', '~> 1.5.0', require: false gem 'bullet', '>= 6.0.2' + gem 'erb_lint', '~> 0.0.37', require: false gem 'i18n-tasks', '>= 0.9.31' gem 'knapsack' gem 'nokogiri', '~> 1.11.0' diff --git a/Gemfile.lock b/Gemfile.lock index 478f3b821bb..37889e49c79 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -207,6 +207,14 @@ GEM coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) + better_html (1.0.15) + actionview (>= 4.0) + activesupport (>= 4.0) + ast (~> 2.0) + erubi (~> 1.4) + html_tokenizer (~> 0.0.6) + parser (>= 2.4) + smart_properties bindata (2.4.8) binding_of_caller (0.8.0) debug_inspector (>= 0.0.1) @@ -282,6 +290,14 @@ GEM launchy (~> 2.1) mail (~> 2.7) equalizer (0.0.11) + erb_lint (0.0.37) + activesupport + better_html (~> 1.0.7) + html_tokenizer + parser (>= 2.7.1.4) + rainbow + rubocop + smart_properties errbase (0.2.0) erubi (1.10.0) exception_notification (4.4.3) @@ -334,6 +350,7 @@ GEM thor highline (2.0.3) hiredis (0.6.3) + html_tokenizer (0.0.7) htmlentities (4.3.4) http_accept_language (2.1.1) httparty (0.18.1) @@ -613,6 +630,7 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) + smart_properties (1.15.0) sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -723,6 +741,7 @@ DEPENDENCIES devise (~> 4.7.2) dotiw (>= 4.0.1) email_spec + erb_lint (~> 0.0.37) exception_notification (>= 4.4.0) factory_bot_rails (>= 5.2.0) faker diff --git a/Makefile b/Makefile index 677caf5995e..c5a6ece469a 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ docker_setup: check: lint test lint: + @echo "--- erb-lint ---" + make lint_erb @echo "--- rubocop ---" bundle exec rubocop @echo "--- fasterer ---" @@ -28,6 +30,9 @@ lint: @echo "--- eslint ---" yarn run lint +lint_erb: + bundle exec erblint app/views/**/*.erb + lintfix: @echo "--- rubocop fix ---" bundle exec rubocop -R -a