Skip to content

Commit

Permalink
Chore: Enable erblint in turbo stream files (#3974)
Browse files Browse the repository at this point in the history
Because:
* We are using turbo more and more and have no lint coverage in these
files.
  • Loading branch information
KevinMulhern authored Jul 15, 2023
1 parent 1f94cee commit b480f39
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
glob: "**/app/**/*.{html,turbo_stream,js}{+*,}.erb"
exclude:
- '*vendor/*'
- '*app/views/svg/*'
Expand Down
8 changes: 4 additions & 4 deletions app/views/lessons/completions/create.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<% if params[:icon_only] %>
<%= turbo_stream.replace dom_id(@lesson, "complete-button") do %>
<%= turbo_stream.replace dom_id(@lesson, 'complete-button') do %>
<% @lesson.completed? %>
<%= render Complete::IconComponent.new(lesson: @lesson, current_user: current_user, animate: true) %>
<%= render Complete::IconComponent.new(lesson: @lesson, current_user:, animate: true) %>
<% end %>
<% else %>
<%= turbo_stream.replace "complete-button" do %>
<%= turbo_stream.replace 'complete-button' do %>
<%= render Complete::ButtonComponent.new(lesson: @lesson, animate: true) %>
<% end %>
<% end %>
<%= turbo_stream.update dom_id(@lesson.course, "progress") do %>
<%= turbo_stream.update dom_id(@lesson.course, 'progress') do %>
<%= render ProgressCircle::Component.new(percentage: @lesson.course.progress_for(current_user).percentage) %>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= turbo_stream.prepend "submissions-list" do %>
<%= render ProjectSubmissions::ItemComponent.new(project_submission: @project_submission, current_user: current_user) %>
<%= turbo_stream.prepend 'submissions-list' do %>
<%= render ProjectSubmissions::ItemComponent.new(project_submission: @project_submission, current_user:) %>
<% end %>
<%= turbo_stream.update "add-submission-button", "" %>
<%= turbo_stream.update 'add-submission-button', '' %>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= turbo_stream.remove @project_submission %>
<%= turbo_stream.update "add-submission-button" do %>
<%= render "lessons/v2_project_submissions/add_button", lesson: @lesson %>
<%= turbo_stream.update 'add-submission-button' do %>
<%= render 'lessons/v2_project_submissions/add_button', lesson: @lesson %>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%= turbo_stream.replace @project_submission do %>
<%= render ProjectSubmissions::ItemComponent.new(project_submission: @project_submission, current_user: current_user) %>
<%= render ProjectSubmissions::ItemComponent.new(project_submission: @project_submission, current_user:) %>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%= turbo_stream.replace @project_submission do %>
<%= render ProjectSubmissions::ItemComponent.new(project_submission: @project_submission, current_user: current_user) %>
<%= render ProjectSubmissions::ItemComponent.new(project_submission: @project_submission, current_user:) %>
<% end %>
8 changes: 4 additions & 4 deletions app/views/themes/update.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= turbo_stream.update "theme_switcher" do %>
<%= render Theme::SwitcherComponent.new(current_theme: current_theme, type: :icon_only) %>
<%= turbo_stream.update 'theme_switcher' do %>
<%= render Theme::SwitcherComponent.new(current_theme:, type: :icon_only) %>
<% end %>
<%= turbo_stream.update "theme_switcher_mobile" do %>
<%= render Theme::SwitcherComponent.new(current_theme: current_theme, type: :mobile) %>
<%= turbo_stream.update 'theme_switcher_mobile' do %>
<%= render Theme::SwitcherComponent.new(current_theme:, type: :mobile) %>
<% end %>

0 comments on commit b480f39

Please sign in to comment.