-
Notifications
You must be signed in to change notification settings - Fork 13
Add grunt scss lint to your jekyll site.
Yuri edited this page Dec 30, 2015
·
1 revision
scsslint
is a tool to help keep your SCSS files clean and readable
npm install grunt-scss-lint --save-dev
Install gem scss-lint
:
gem update --system && gem install scss-lint
Add this line to the readme file of your project
If you use 'load-grunt-tasks' do nothing.
Else:
Enabled inside your Gruntfile with this line of JavaScript
grunt.loadNpmTasks('grunt-scss-lint');
Add .scss-lint.yml
file to project's root:
Example file (explanation in comments):
# Configuration scss-lint for THESITE
# Path to your scss folder
scss_files: "app/_scss/**/*.scss"
# Configutation linters.
linters:
# Disable some linters
ColorKeyword:
enabled: false
ColorVariable:
enabled: false
HexLength:
enabled: false
HexNotation:
enabled: false
IdSelector:
enabled: false
LeadingZero:
enabled: false
PropertySortOrder:
enabled: false
# Set nesting depth:
NestingDepth:
max_depth: 6
SelectorDepth:
max_depth: 5
# Disable linter for sertain file/s.
SelectorFormat:
exclude:
- 'app/_scss/main.scss'
The linter's list
grunt.initConfig({
...
scsslint: {
allFiles: [
'<%= yeoman.app %>/_scss/**/*.scss'
],
options: {
config: '.scss-lint.yml',
exclude: '<%= yeoman.app %>/_scss/_code.scss',
colorizeOutput: true,
force: true
}
}
}
The list Options
watch: {
scsslint: {
files: ['<%= yeoman.app %>/_scss/*.scss'],
tasks: ['scsslint']
},
}
...
concurrent: {
server: [
'bootlint',
...
],
},
...