mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 01:55:46 +08:00
DEV: adds prettier (#5956)
Run `prettier --write "app/assets/stylesheets/**/*.scss" "plugins/**/*.scss"` after making sure you installed it with `yarn` It's recommended to configure your editor to run prettier on file save.
This commit is contained in:
@ -39,14 +39,27 @@ task 'docker:test' do
|
||||
begin
|
||||
@good = true
|
||||
unless ENV['SKIP_LINT']
|
||||
puts "Running linters"
|
||||
puts "Running linters/prettyfiers"
|
||||
if ENV["SINGLE_PLUGIN"]
|
||||
@good &&= run_or_fail("bundle exec rubocop --parallel plugins/#{ENV["SINGLE_PLUGIN"]}")
|
||||
@good &&= run_or_fail("eslint --ext .es6 plugins/#{ENV['SINGLE_PLUGIN']}")
|
||||
|
||||
puts "Listing prettier offenses in #{ENV['SINGLE_PLUGIN']}:"
|
||||
@good &&= run_or_fail("prettier --list-different 'plugins/#{ENV['SINGLE_PLUGIN']}/**/*.scss'")
|
||||
else
|
||||
@good &&= run_or_fail("bundle exec rubocop --parallel") unless ENV["SKIP_CORE"]
|
||||
@good &&= run_or_fail("eslint app/assets/javascripts test/javascripts") unless ENV["SKIP_CORE"]
|
||||
@good &&= run_or_fail("eslint --ext .es6 app/assets/javascripts test/javascripts plugins") unless ENV["SKIP_PLUGINS"]
|
||||
|
||||
unless ENV["SKIP_CORE"]
|
||||
puts "Listing prettier offenses in core:"
|
||||
@good &&= run_or_fail('prettier --list-different "app/assets/stylesheets/**/*.scss"')
|
||||
end
|
||||
|
||||
unless ENV["SKIP_PLUGINS"]
|
||||
puts "Listing prettier offenses in plugins:"
|
||||
@good &&= run_or_fail('prettier --list-different "plugins/**/*.scss"')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user