Sha256: 40ac232bd702d96c8a8c37fa9b8dd61255aee98016589d6c33d8ac6ad2483c6f
Contents?: true
Size: 1020 Bytes
Versions: 2
Compression:
Stored size: 1020 Bytes
Contents
require "rails/generators" module ReactOnRails module Generators class LintersGenerator < Rails::Generators::Base hide! source_root File.expand_path("../templates", __FILE__) def add_linter_gems linter_gems = <<-GEMS # require: false is necessary for the linters as we only want them loaded # when used by the linting rake tasks. group :development do gem("rubocop", require: false) gem("ruby-lint", require: false) gem("scss_lint", require: false) end GEMS append_to_file("Gemfile", linter_gems) end def copy_linter_config_files base_path = "linters/" %w(client/.eslintrc client/.eslintignore client/.jscsrc).each { |file| copy_file(base_path + file, file) } end def copy_linting_and_audting_tasks base_path = "linters/" %w(lib/tasks/brakeman.rake lib/tasks/ci.rake lib/tasks/linters.rake).each { |file| copy_file(base_path + file, file) } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
react_on_rails-1.0.1 | lib/generators/react_on_rails/linters_generator.rb |
react_on_rails-1.0.0 | lib/generators/react_on_rails/linters_generator.rb |