Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
- name: Install dependencies with yarn
run: yarn install
- name: Lint Ruby files
run: bundle exec rake rubocop eslint
run: bundle exec rake rubocop eslint herb
48 changes: 48 additions & 0 deletions .herb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Configuration for Herb (https://herb-tools.dev/configuration)
version: 0.11.3

framework: actionview

linter:
enabled: true

# Don't print info/hint diagnostics (still shown in editors)
logLevel: warning

# These rules have existing offenses. Fix them and re-enable each rule.
rules:
erb-closing-tag-indent:
enabled: false
erb-comment-syntax:
enabled: false
erb-no-instance-variables-in-partials:
enabled: false
erb-no-interpolated-class-names:
enabled: false
erb-no-output-in-attribute-name:
enabled: false
erb-no-output-in-attribute-position:
enabled: false
erb-no-trailing-comment:
enabled: false
erb-no-trailing-whitespace:
enabled: false
erb-no-unsafe-raw:
enabled: false
erb-no-unused-block-argument:
enabled: false
erb-no-unused-expressions:
enabled: false
erb-require-trailing-newline:
enabled: false
erb-require-whitespace-inside-tags:
enabled: false
html-aria-label-is-well-formatted:
enabled: false
html-attribute-double-quotes:
enabled: false
html-no-space-in-tag:
enabled: false

formatter:
enabled: false
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Dir.glob('./lib/tasks/*.rake').each { |f| load f }

require 'engine_cart/rake_task'

task default: %i[rubocop eslint ci]
task default: %i[rubocop eslint herb ci]
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
</div>
</td>

<%= tag.td class: 'text-muted' do %>
<%= document.containers.join(', ') %>
<% end %>
<%= tag.td class: 'text-muted' do %>
<%= document.containers.join(', ') %>
<% end %>

<%= tag.td class: 'text-end' do %>
<%= tag.td class: 'text-end' do %>
<%= helpers.render_index_doc_actions document, wrapping_class: 'd-inline-flex justify-content-end' %>
<% end %>
</div>
<% end %>

<%= render Arclight::IndexMetadataFieldComponent.with_collection(@presenter&.field_presenters.select { |field| field.field_config.collection_context }, classes: ['col pl-0 my-0']) %>
<% end %>
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "app/assets/javascript/arclight/arclight.js",
"files": ["app/assets"],
"devDependencies": {
"@herb-tools/linter": "^0.11.3",
"eslint": "^8.26.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.2.0",
Expand All @@ -15,6 +16,7 @@
"build": "sass ./app/assets/stylesheets/arclight/build.scss:./app/assets/builds/arclight.css --no-source-map --load-path=node_modules",
"lint": "eslint './app/assets/javascripts/**/*.{js,es6}'",
"lint:fix": "eslint --fix './app/assets/javascripts/**/*.{js,es6}'",
"lint:erb": "herb-lint",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions tasks/arclight.rake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ task :eslint do
exit 1 unless system './node_modules/.bin/eslint app/assets/javascripts'
end

desc 'Run Herb linter on ERB templates'
task :herb do
raise DependencyNotInstalled, 'Herb not found. Please run yarn install.' unless File.exist?('./node_modules/.bin/herb-lint')

exit 1 unless system './node_modules/.bin/herb-lint'
end

namespace :arclight do
desc 'Generate a test application'
task generate: %w[engine_cart:generate]
Expand Down
Loading