Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Enable erblint in turbo stream files #3974

Merged
merged 1 commit into from
Jul 15, 2023
Merged
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
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 %>