Skip to content

Commit

Permalink
Fix rubocop to v1.61 & css-loader to v6 (#1606)
Browse files Browse the repository at this point in the history
This is to prevent linting issues with newer versions. This can prevent
annoying CI failures.

This is a minimal and temporary fix to prevent breaking changes in
css-loader v7
  • Loading branch information
ahangarha authored Apr 5, 2024
1 parent 77dba20 commit 47ea981
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile.development_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ group :development, :test do
gem "pry-doc"
gem "pry-rails"
gem "pry-rescue"
gem "rubocop", "~>1.59", require: false
gem "rubocop", "1.61.0", require: false
gem "rubocop-performance", "~>1.20.0", require: false
gem "rubocop-rspec", "~>2.26", require: false
gem "scss_lint", require: false
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/react_on_rails/base_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def add_yarn_dependencies
css_minimizer_webpack_plugin_version = node_major_version >= 18 ? "" : "@<6.0.0"
css_minimizer_webpack_plugin = "css-minimizer-webpack-plugin#{css_minimizer_webpack_plugin_version}"

run "yarn add css-loader '#{css_minimizer_webpack_plugin}' mini-css-extract-plugin style-loader"
run "yarn add 'css-loader@<7.0.0' '#{css_minimizer_webpack_plugin}' mini-css-extract-plugin style-loader"

puts "Adding dev dependencies"
run "yarn add -D @pmmmwh/react-refresh-webpack-plugin react-refresh"
Expand Down
2 changes: 1 addition & 1 deletion lib/react_on_rails/git_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module ReactOnRails
module GitUtils
def self.uncommitted_changes?(message_handler, git_installed = true)
def self.uncommitted_changes?(message_handler, git_installed: true)
return false if ENV["COVERAGE"] == "true"

status = `git status --porcelain`
Expand Down
6 changes: 3 additions & 3 deletions spec/react_on_rails/git_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module ReactOnRails
expect(message_handler).to receive(:add_error)
.with("You have uncommitted code. Please commit or stash your changes before continuing")

expect(described_class.uncommitted_changes?(message_handler, true)).to be(true)
expect(described_class.uncommitted_changes?(message_handler, git_installed: true)).to be(true)
end
end

Expand All @@ -24,7 +24,7 @@ module ReactOnRails
allow(described_class).to receive(:`).with("git status --porcelain").and_return("")
expect(message_handler).not_to receive(:add_error)

expect(described_class.uncommitted_changes?(message_handler, true)).to be(false)
expect(described_class.uncommitted_changes?(message_handler, git_installed: true)).to be(false)
end
end

Expand All @@ -36,7 +36,7 @@ module ReactOnRails
expect(message_handler).to receive(:add_error)
.with("You do not have Git installed. Please install Git, and commit your changes before continuing")

expect(described_class.uncommitted_changes?(message_handler, false)).to be(true)
expect(described_class.uncommitted_changes?(message_handler, git_installed: false)).to be(true)
end
end
end
Expand Down

0 comments on commit 47ea981

Please sign in to comment.