Add a new beautifier SassConvert for CSS, SCSS and Sass
This commit is contained in:
parent
b9f97895f9
commit
bef88cf4dc
|
@ -86,6 +86,8 @@ before_install:
|
|||
- gem install rubocop
|
||||
- gem install htmlbeautifier
|
||||
- gem install puppet-lint
|
||||
# Sass language support
|
||||
- gem install sass
|
||||
# Python language support
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo chmod 777 -R /opt/python; fi
|
||||
|
|
|
@ -93,6 +93,9 @@ install:
|
|||
# Puppet-Lint
|
||||
- gem install puppet-lint
|
||||
- where puppet-lint
|
||||
# Sass
|
||||
- gem install sass
|
||||
- where sass-convert
|
||||
|
||||
# emacs
|
||||
- cinst emacs -y
|
||||
|
|
|
@ -62,6 +62,7 @@ module.exports = class Beautifiers extends EventEmitter
|
|||
'rubocop'
|
||||
'ruby-beautify'
|
||||
'rustfmt'
|
||||
'sass-convert'
|
||||
'sqlformat'
|
||||
'stylish-haskell'
|
||||
'tidy-markdown'
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
"use strict"
|
||||
Beautifier = require('./beautifier')
|
||||
|
||||
module.exports = class SassConvert extends Beautifier
|
||||
name: "SassConvert"
|
||||
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
|
||||
|
||||
options:
|
||||
# TODO: Add support for options
|
||||
CSS: false
|
||||
Sass: false
|
||||
SCSS: false
|
||||
|
||||
beautify: (text, language, options, context) ->
|
||||
lang = language.toLowerCase()
|
||||
|
||||
@run("sass-convert", [
|
||||
@tempFile("input", text),
|
||||
"--from", lang, "--to", lang
|
||||
])
|
Loading…
Reference in New Issue