question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin working incorrectly in Pug templates

See original GitHub issue
  • VSCode Version: 1.17.2
  • OS Version: Arch Linux, latest

Steps to Reproduce:

  1. run npm install --save-dev eslint-plugin-pug

  2. set VSCode config option:

    "eslint.validate": [ { "language" : "pug" } ]
    
  3. create some Pug template with script tag

  4. create an error in JS code inside that tag

  5. see what VSCode incorrectly highlighting that error

Example on screenshot:

image

In this example all file is fine, i just added function ss() {} string and you see what is going.

Please fix 😃 Thanks for you work and have a nice day!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dbaeumercommented, Nov 15, 2017

Using Jade I can reproduce this. The error I get back from ESLint looks like this:

capture

I simply take this information and transform it to a VS Code diagnostics. Since the value reported from ESLint spawns multiple lines it does the same in VS Code

If you think it is a problem then please report it to ESLint (https://github.com/eslint/eslint) directly or to the pug plugin.

0reactions
believer-ufacommented, Nov 14, 2017

Sorry, i dont understand you question, can you explain?

I checked it again and saw that it works only with next settings:

    "eslint.validate": [
        { "language" : "jade" },
    ]

Not pug as i think before… Linting works only with jade.

Let me explain: i started use VS Code just few days ago, i almost do not configured my VS Code. Just installed few extensions for linting and other.

You can look at my screenshot with installed extensions in my ide.

screenshot_20171115_011647

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugin working incorrectly in Pug templates #338 - GitHub
Run npm install to install eslint-plugin-pug dependency; Open folder with cloned project in VS Code (vscode need to read settings file in ...
Read more >
Vue plugin misbehaving when used with Pug - Stack Overflow
By default the plugin works fine and as expected, but when running the same code with Pug, I ran into issues. Working code:...
Read more >
Pug.js tutorial: A beginner's guide with examples
In this Pug.js tutorial, we'll show you how to integrate Vue.js into a backend app using Pug as a templating engine and Express.js....
Read more >
@volar/pug-language-service | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Pug: Getting Started
The general rendering process of Pug is simple. pug.compile() will compile the Pug source code into ... compileFile('template.pug'); // Render a set of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found