Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

martinbean's avatar

Disable linter for specific lines in Visual Studio Code?

Does any one using Visual Studio Code know how to disable linting for specific lines in a file?

For example, if I use some Blade syntax in a JavaScript block, the JavaScript linter adds an error, as in this screen-shot:

It would be good if I could disable the linter for certain lines by doing something like:

// vscode: disable-linting
var stripe = Stripe('{{ config('services.stripe.key') }}');
// vscode: enable-linting

Does any one know if something like this is possible in VS Code?

0 likes
1 reply
topvillas's avatar

I don't think you need to disable linting here.

You have nested single quotes. I'd change that.

var stripe = Stripe("{{ config('services.stripe.key') }}");
1 like

Please or to participate in this conversation.