-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
lib/generators/auxiliary_rails/install_stylelint_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'rails' | ||
|
||
module AuxiliaryRails | ||
class InstallStylelintGenerator < ::Rails::Generators::Base | ||
PACKAGES = %w[ | ||
stylelint | ||
stylelint-config-standard | ||
].freeze | ||
|
||
source_root File.expand_path('templates/stylelint', __dir__) | ||
|
||
def copy_config_files | ||
copy_file 'stylelintrc_template.yml', | ||
'.stylelintrc.yml' | ||
end | ||
|
||
def install_stylelint_packages | ||
run 'yarn add -D ' + PACKAGES.join(' ') | ||
end | ||
|
||
def show_instructions | ||
say %( | ||
Run `stylelint` using this command: | ||
=> yarn run stylelint app/assets/stylesheets/ | ||
) | ||
end | ||
end | ||
end |
1 change: 1 addition & 0 deletions
1
lib/generators/auxiliary_rails/templates/stylelint/stylelintrc_template.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extends: "stylelint-config-standard" |