Sublime Text 3 CSSLint Package not using .csslintrc - sublimetext

I'm trying to use CSSLint with Sublime Text 3, but I can't seem to get it to use the .csslintrc file I've got in my project root.
Originally I thought it would be in JSON format, but then it turned out you have to use a command line syntax, so as a test I tried these in my .csslintrc file:
--ignore=ids,important
and
ignore=ids,important
But neither stop the linter from warning about the use of either??? Any suggestions? It does work if I just stick it in the user settings file, but since I use .jshintrc and other files in my projects for linting etc, and not everyone uses Sublime Text (I don't know why they wouldn't :), I'd prefer to have it all in .csslintrc
"linters": {
"csslint": {
"#disable": false,
"args": [],
"errors": "",
"excludes": [],
"ignore": "ids,important", // WORKS
"warnings": ""
},
}

First solution, you can add a .csslintrc file in the CSS folder (and duplicate it for each sub folder...) :
--ignore=ids,important
Otherwise, you can add a .sublimelinterrc file in your project root :
{
"linters": {
"csslint": {
"ignore": ["ids, important"]
}
}
}

Related

pa11y-ci: How to specify filename for default html report?

I have Pa11y working well with the Json output, but I wanted to provide a HTML report for clients. We do manual WCAG checks right now and are migrating to a more automated approach. I've installed the Pa11y HTML reporter, and it seems to want to produce the output into the CI. It's a better output but how do I specify the filename for the html file such as myreport.html?
Here is my config file:
{
"defaults": {
"reporters": [
"pa11y-reporter-html"
],
"timeout": 10000,
"standard": "WCAG2A",
"viewport": {
"width": 800,
"height": 600
}
}
}
Here is how I'm calling it from the command line:
pa11y-ci --sitemap https://oursite.co.uk/sitemaps/sitemap.xml
Also, how do I add the sitemap to the config file? When I add it in like this it seems to ignore it:
"sitemap:":"https://oursite.co.uk/sitemaps/sitemap.xml",
The solution was to use:
pa11y-ci-reporter-html -s results.json
The json is the separate .json output from pally-ci generated separately.
The ci-reporter is installed gloablly using:
> npm install -g pa11y-ci-reporter-html
So you have to keep pa11y-ci set to json mode for this to work.

How to ignore specific rules in Sublime Linter SCSS (Sass)?

I'm trying to learn how to silence a rule in SublimeLinter-scss-lint (specifically EmptyLineBetweenBlocks).
For SublimeLinter-csslint, I can run scss-lint --list-rules in Terminal, locate the rule I don't like in the output, and add it to the ignore array in SublimeLinter.sublime-settings (as below).
{
"user": {
// ...
"linters": {
"csslint": {
// ...
"ignore": [
// Following rules will be ignored.
"adjoining-classes",
"box-model",
"box-sizing",
"fallback-colors",
"ids",
"universal-selector"
],
// ...
},
// ...
}
}
}
For SCSS, there doesn't appear to be a similar way to find rule names in Terminal, and there's no scss-lint object in Sublime Linter settings. So…how is this done?
Thank you.
Here's a way I found to make it work.
I created a file in my Home directory (~/) named .scss-lint.yml.
In it, I copy–pasted rules I wanted to modify from the default.yml file located in/Library/Ruby/Gems/2.0.0/gems/scss_lint-0.39.0/config/, preserving indentation.
Close and re-open any SCSS files in Sublime to see the changes.
Example:
linters:
EmptyLineBetweenBlocks:
enabled: false
LeadingZero:
enabled: true
style: include_zero
MergeableSelector:
force_nesting: false

How can I make a Sublime Text project file to only show certain folders?

SublimeText has a project-settings file that includes a folder_include_patterns option.
I have a folder called (my app name).project-settings (which according to some research, is the correct name for the file) in the top level of my project. I am trying to make Sublime not show all the files under node_modules except my-module:
{
"folders": [
{
"path": "node_modules",
"folder_include_patterns": [
"my-module"
]
}
]
}
However SublimeText still shows all the files under node_modules. How can I make a Sublime Text project file to only show certain folders?
I assume you don't want to ignore all the other modules in node_modules.
You could ignore your node_modules directory and include your module as another folder.
{
"folders":
[
{
"folder_exclude_patterns":
[
"node_modules",
],
"path": "."
},
{
"path": "node_modules/mymodule"
},
]
}
My syntax is correct, but making the file isn't enough to make a dir into a project.
Since there is no 'new project' button in Sublime, you can make a folder with:
Open the folder in Sublime.
Click Project > Save Project As
This makes:
your_project.sublime-project
{
"folders": [
{
"path": "."
},
{
"path": "node_modules",
"folder_include_patterns": [
"my-module"
]
}
]
}
your_project.sublime-workspace (left as defaults)
Additionally: you must open the project from the Project menu (otherwise it will still be a folder and ignore the .sublime-project file).

Ignore certain errors using SublimeLinter-scss-lint with Sublime TExt

When using SublimeLinter-scss-lint with my SASS files it throughs up errors for common things like,
indentation should be 2 spaces not 4 spaces, colan after property should be followed by one space etc etc.....how can get sublime to ignore these and just watch out for more important errors??
You can disable or configure each linter component of the scss linter plugin for Sublime Text 3. You just need to configure the user settings.
Go to:
Sublime Text Menu
-> Preferences
-> Package Settings
-> SublimeLinter
-> Settings - User
By default, this file is stored at the path below, but may not exist if you haven't configured any settings yet.
~/Library/Application Support/Sublime Text 3/Packages/User/SublimeLinter.sublime-settings
The basic structure of this file, in terms of linter plugins, is shown below and will vary based on what you have set and what plugins you are already using. (I have removed most of the other settings to focus on what is important for configuring the scss plugin.)
{
"user": {
... more settings ...
"linters": {
"csslint": {
...
},
"htmltidy": {
...
},
"jshint": {
...
},
"json": {
...
},
"php": {
...
},
"scss": {
"#disable": false,
"args": [],
"exclude-linter": "Indentation SpaceAfterPropertyColon",
"excludes": [],
"include-linter": ""
},
"xmllint": {
...
}
},
... more settings ...
}
}
The important bit that you want is under the "linters" -> "scss" section. You can explicitly list linters in the scss plugin to include or exclude.
Full list of default SCSS linters
As the configuration is set up above, it should disable both the Indentation and SpaceAfterPropertyColon linters for scss. You can add as many as you want to this list.
SublimeLinter documentation for the settings file

Compass not compiling in sublime text 2

Getting the following error when I'm trying to save my scss files:
File to import not found or unreadable: compass. (Sass::SyntaxError)
My Sass builder config:
{
"output_path": "../css",
"options": {
"cache": true,
"debug": true,
"line-comments": true,
"line-numbers": true,
"style": "nested"
}
}
Installed the following packages with my Sublime Text 2:
https://github.com/bnlucas/SassBuilder
https://github.com/WhatWeDo/Sublime-Text-2-Compass-Build-System
So the question is, what am I doing wrong here? Do I need to add something in my build config?
Thanks in advance!

Resources