Can I stop stylelint extension from validating JavaScript file? - visual-studio-code

Good day,
In above picture, stylelint prompt a CSS error in a JS file. Is there a way to stop stylelint from validating javascript file, I coundn't find such option in their official configuration guide.
Thanks a lot.

The linter can be configured to ignore specific files using the ignoreFiles property of the stylelint configuration object.
You can try ignoring JavaScript files with:
{
"ignoreFiles": ["**/*.js"],
"rules": { .. }
}
I believe the stylelint Visual Studio Code extension will respect this property.

Look at this part in the documentation.
You can specify /* stylelint-disable */ at the top of a file to disable the whole file from being lint.
Or, better, juste specify /* stylelint-disable-line */ to disable for a single line.

stylelint:validate
You can stop style-lint from VScode to ignore the javascript file too.
In settings search for stylelint -> at the bottom you can see Stylelint:Validate part. Select javascript and delete. It should fix your problem

Related

Autocompletion for CakePHP finders in VSCode?

is there a way in VScode to have autocompletion for custom finders when using $this->Table->find('finderName') ? Each time I have to check in the Table file to see which finder exists.
I tried using PHP doc when defining the finder function
Thanks !
According to https://github.com/dereuromark/cakephp-ide-helper/wiki/Visual-Studio-Code
https://github.com/dereuromark/cakephp-ide-helper should work fine as long as you have Intelephense Extension.

Dynamically add VSCode snippets from an extension

I was asking myself recently if it is possible to add snippets to either one of the workspace, language-specific or global json snippet files through a VSCode extension.
// something like
Command.addSnippet('''
{
"prefix": "my_snippt",
.... etc.
}
''')
Reading through the API documentation I did not find anything. If there is no way, how would you go about creating kind of a snippet manager?
You can use SnippetString and a CompletionItemProvider to dynamically suggest snippets.
Here is an example.

How can I get autocomplete/intellisense features for Firefox extension APIs on vscode?

I am developing my first firefox extension on vscode and just discovered that autocomplete/intellisense isn't working for web extension APIs e.g. browser.tab, browser.extension like it does for regular JavaScript. I like the intellisense feature because it minimizes errors and docs consultation. A google search result suggested I add:
{
"typeAcquisition": {
"include": ["firefox"]
}
}
in a jsconfig.json file which I've done but the issue still persists. Is there a way I can get intellisense to work here or am I out of luck?
Create a jsconfig.json file in your source and add this line to it ⤵︎
{"typeAcquisition": {"include": ["firefox-webext-browser"]}}
You should then have suggestions for the browser namespace.

Load settings view from code

I'm working on an extension and I'm checking to see if settings have values, if not, I want to show an error and provide a button that launches the settings editor so the user can add those settings.
I think my path forward is to use executeCommand and provide a built in command that does this for me, but I've been having trouble finding a list of built-in available commands.
Hidden in the key-bindings section of the documentation, I found the command I was looking for - workbench.action.openGlobalSettings
The full solution looks like
commands.executeCommand('workbench.action.openGlobalSettings');

Tone down javascript intellisense

I find the default intellisense suggestions for Javascript irrelevant. Too many native browser functions I will never use.
Is there any way to turn off/limit intellisense? e.g. hide browser methods like the one in the link above.
To disable the default set of globals, create a jsconfig.json file at the root of your project with the content:
{
"compilerOptions": {
"lib": ["es6"]
}
}
This prevents the TypeScript service that VSCode uses for JavaScript IntelliSense from automatically including information about the DOM api.
You can read about all the avalible lib configuration options in the TypeScript documentation.