I am using VSCode's ESLint extension to fix and format my TS code. I would like to remove all the warnings (such as red underlines) from ESLint, because I find them really annoying and distracting.
Using the config
"eslint.enable": true,
removes all warnings, but also disables the formatting.
In VS Code settings you can define an entry called "eslint.rules.customizations" and provide an array of rules with a severity setting set to "off".
{
"eslint.rules.customizations": [
{ "rule": "<rule-name>", "severity": "off" }
],
}
For example, if you are trying to remove the red (error) or yellow (warn) squigglies for the rules "react/jsx-curly-brace-presence" and "prettier/prettier" you can configure the following:
{
"eslint.rules.customizations": [
{ "rule": "prettier/prettier", "severity": "off" },
{ "rule": "react/jsx-curly-brace-presence", "severity": "off" }
]
}
Related
I am using TextMate rules to try and write a custom VSC Rust color theme that's not quite as busy as the default one, following this explanation in the docs.
For a token without semantic information, the VSC scope inspector correctly reports the color I selected (#FF0000 in the screenshot), but does not render it. Am I misunderstandings how this feature works?
My minimal settings.json snippet looks like this:
"editor.tokenColorCustomizations": {
"[Default Dark+]": {
"textMateRules": [
{
"scope": "punctuation.brackets.curly.rust",
"settings": {
"foreground": "#FF0000"
}
}
]
}
},
"editor.semanticHighlighting.enabled": false
VSC v1.71.2, rust-analyzer v0.3.1221
I am using VS Code and would like to have markdown headings displayed underlined in the source code. I have added the following configuration:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"markup.heading.markdown",
],
"settings": {
"foreground": "#C0C3CA",
"fontStyle": "underline",
}
},
],
}
This basically works. The spaces in between the words however are not underlined, see this screenshot:
Is there a possibility to have these underlined as well?
According to the scope inspector the spaces also have the markup.heading.markdown scope, just like the words. So I don't see why they do not get underlined.
Any ideas?
It conflicts with "editor.renderWhitespace": "all" setting.
You can find out more a about why it happens on GitHub:
https://github.com/microsoft/vscode/issues/49462
https://github.com/eclipse/che-che4z-lsp-for-hlasm/issues/6
How do I disable the underlining of variables and their methods, like shown above? I find it quite distracting.
I don't think this is a duplicate of Disable wavy underline in VS Code because it's not a wavy underline.
{
"editor.semanticTokenColorCustomizations": {
"enabled": true,
"rules": {
"*.mutable": {
"underline": false,
}
}
}
}
Fixed it by dumping the above in settings.json
Try adding the following line to settings.json
"editor.semanticHighlighting.enabled": false,
Whenever I enter a . after a object the autocomplete dropdown contains a lot of unnecessary css classnames as options:
Is it possible to ignore css files for ts/tsx intellisense, so i only get relevant options?
VS Code version: 1.37.1
"[typescript]": {
"editor.suggest.showClasses": false
},
"[typescriptreact]": {
"editor.suggest.showClasses": false
}
Basically the same as Mark's answer but it looks like "editor.suggest.filteredTypes" has been deprecated since VSCode >= 1.40 in favor of settings like "editor.suggest.showClasses".
Try something like this in your settings:
"[typescript]": {
"editor.suggest.filteredTypes": {
"class": false,
}
},
"[typescriptreact]": {
"editor.suggest.filteredTypes": {
"class": false,
}
}
[it would be nice if you could combine these but [typescript, typescriptreact] didn't work for me.
From types of completions it looks like it is class that you want to filter out.
And see create language-specific settings to see how to create settings for specific languages.
You will have to reload vscode to see these changes take effect.
I can not make see that the parameters of the methods are of a certain color in the body too.
Any help will be appreciated.
Try:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.parameter.ts, variable.other.object.ts",
"settings": {
"foreground":"#f00"
}
}
]
}
If you examine your variables with the palette command Developer: Inspect TM Scopes you will see that both of your instances are variables but so are many other things. You can narrow down your scope with the two scopes I used above to achieve what you want.
This works fine in the function declaration:
Press ctrl+comma
from the top right menu, click on curly braces. (settings.json file)
Add the following settings:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "variable.parameter",
"settings": {
"fontStyle": "",
"foreground":"#413f39"
}
}
]
}
There are two conditions for successful coloring:
The language must support semantic parsing.
The current theme must contains
"semanticHighlighting": true