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

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

Related

Using Git Bash terminal in VS Code - how to force it to open internally

Duplicate: I asked this on SuperUser without answer
Using:
editor: VS Code
terminal: Git Bash
VS Code offers a shortcut Ctrl+Shift+C to open it externally and a shortcut Ctrl+` (or in my case Ctrl+F1) to open it internally.
In my case it opens it externally with both shortcuts as well as with menu View->Terminal.
I turned Google upside down to the best of my knowledge to find this solution.
I have reinstalled Git from git-scm.com.
I checked my VS Code settings (Code\User\settings.json) to find a clue, if I accidentally set to force external opening myself.
I know I shouldn't paste an entire file, but maybe you find where the problem in settings.json lies:
{
// Chosen Terminal
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
// Prevent losing aliases, colorization etc. for the Git bash terminal
// "terminal.integrated.shellArgs.windows": [
// "--login",
// "--init-file",
// "C:\\Program Files\\Git\\etc\\profile"
// ],
// Windows Terminal
"terminal.external.windowsExec": "C:\\Program Files\\Git\\bin\\bash.exe",
// Chosen Theme Color and Color Customization
"workbench.colorTheme": "Monokai",
"workbench.colorCustomizations": {
"[Monokai]": {
// "statusBar.background": "#666666",
// "panel.background": "#555555",
// "sideBar.background": "#444444",
"tab.activeBackground": "#999999",
"tab.activeForeground": "#333333"
}
},
// Emmet Customization
"emmet.triggerExpansionOnTab": true,
// Editor Customization
"editor.fontSize": 14,
"editor.wordWrap": "on",
"editor.codeActionsOnSave": {},
"editor.tabSize": 2,
// PHP Tooltip Suggestions
"php.suggest.basic": false,
"php.validate.executablePath": "C:\\xampp\\php\\php.exe", //for linting
"php.validate.run": "onSave", //change to onType if need be
"explorer.confirmDelete": false,
"beautify.language": {
"js": {
"type": [
"javascript",
"json",
"jsonc"/*,
"html"*/
],
"filename": [
".jshintrc",
".jsbeautifyrc"
]
},
"css": [
"css",
"scss"
],
"html": [
"htm",
"html"
]
},
"beautify.config": {
"indent_size": 2,
"indent_char": " ",
"css": {
"indent_size": 2
}
},
// Git costumization
"window.zoomLevel": 0,
"workbench.colorCustomizations": {
"gitDecoration.addedResourceForeground": "#f45342",
"gitDecoration.modifiedResourceForeground": "#3888d8"
},
"workbench.settings.useSplitJSON": true,
"files.trimTrailingWhitespace": true,
"minify.minifyExistingOnSave": true
}
If I use Ctrl+Shift+C shortcut, let's say on two different projects, it opens two external terminals just as one would expect.
If I use Ctrl+F1 (default Ctrl+`) shortcut it wants to open them internally so bottom part of VS Code windows looks like this:
And it still opens them externally:
Can anyone provide some insight?
It seems adding "terminal.external.windowsExec": "C:\\Program Files\\Git\\bin\\bash.exe" to Settings is the old way and doesn't work as expected.
Delete all lines related to bash from Settings JSON (check User, Workspace and Folder Settings to be sure) and save the file.
Then just open Command Palette (Ctrl + Shift + P) and type in
Select Default Shell
and choose bash from there.
Now all you have to do is restart VS Code and terminal will be running as expected.
For shells that aren't in your %PATH%, see the other answers.
See the complete Visual Studio Code shell reference.
There should be pre existing Terminal profiles already configured so it should be as simple as adding:
"terminal.integrated.defaultProfile.windows": "Git Bash",
to your settings.json

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).

Sublime Text 3 CSSLint Package not using .csslintrc

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"]
}
}
}

Grunt - DSS Plugin

I'm trying to get this Grunt plugin to work:
https://npmjs.org/package/dss
This documentation plugin ironically seems to be lacking proper documentation. Can someone help me out by giving me an example of something that worked for them. The main thing that's screwing me up is the "your_target" property. Not sure what's suppose to go in there.
Say I have a SASS file in the following path from the root directory:
sass/main.scss
What would my ouput be by default? And where would it output to? Also what format does it ouput to?
grunt.initConfig({
DSS: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
Is "your_target" property the path to my sass file or the path to the documentation file I'm trying to create? Would it be defined like this?
...
your_target: {
// Target-specific file lists and/or options go here.
sass: "sass/main.scss"
},
...
I don't know what the property name should be. :(
dss: {
docs: {
options: {
},
files: {
'api/': 'css/**/*.{css,scss,sass,less,styl}'
}
}
}

Resources