stylelint

Public
Set up stylelint
Icons/chart bar
Used 16 times
Created by
T TobiasBales

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/VD7sGv"
Template Source

Review the code before running this template on your machine.

if File.exists? ".stylelintrc.json"
  puts ".stylelintrc.json already exists, aborting stylelint setup"
  return 
end

def yarn(*packages)
  run("yarn add --dev #{packages.join(" ")}")
end

def file_contains(file, string)
  File.foreach(file).detect { |line| line.include?(string) }
end

yarn 'stylelint', 'stylelint-config-standard'

create_file '.stylelintrc.json' do <<~JSON
  {
    "extends": "stylelint-config-standard"
  }
  JSON
end
Comments

Sign up or Login to leave a comment.

© 2023 GoRails, LLC