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.

Pug templates. Highlighting js errors in VS Code working incorrectly

See original GitHub issue

Hello and thanks for this library!

I have errors in checking JS code in my Pug templates.

image

I described all details in issue to VS Code ESLint plugin because think what error in it, but we realized that the root of the problem is somewhere else. I also created an issue in eslint-plugin-pug repository about it. I just dont know where root of problem, therefore creating this issue also.

Please, can you read above issue and say you thoughts about it?

  • ESLint Version: 4.10.0
  • Node Version: 8.8.1
  • npm Version: 5.5.1

What parser (default, Babel-ESLint, etc.) are you using?

I dont know, sorry 😦 I just use Visual Studio Code and plugins for linting.

I use Visual Studio Code ide, vscode-eslint plugin, eslint-plugin-pug plugin.

Please show your full configuration:

Configuration
module.exports = {
    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaFeatures": {
            "experimentalObjectRestSpread": true,
            "jsx": true
        },
        "sourceType": "module",
    },
    "plugins": [
        "react",
        "html",
        "pug"
    ],
    "globals" : {
        "$" : true,
        "jQuery" : true,
        "Loader" : true,
        "Navigation" : true,
        "UserParams" : true,
        "opts" : true,
        "trans" : true,
        "ENV" : true,
        "User" : true,
        "HeaderToggler" : true,
        "RiotApps" : true,
        "riot" : true,
        "SystemJS" : true,
    },
    "rules": {
        "no-undef": 1,
        "no-unused-vars": 1,
        "no-console": "off",
        "no-case-declarations" : "off",
        "indent": [ "error", 4, {
            "SwitchCase" : 1 ,
            "ArrayExpression"  : "off",
            "ObjectExpression" : "off",
        } ],
        "linebreak-style": [
            "error",
            "unix"
        ],
        "semi": [
            "error",
            "never"
        ],
        "react/jsx-uses-vars": [2]
    }
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

You can try to play with linting js code in Pug files if you clone this repository.

.some-element
.testing

script.
    function ss() {

    }

I dont know how VS Code using eslint, sorry.

What did you expect to happen?

VS Code correctly highlight js errors in my Pug files.

What actually happened? Please include the actual, raw output from ESLint.

VS Code incorrectly highlight js errors in my Pug files.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
believer-ufacommented, Nov 15, 2017

Many thanks, now everything works fine! 😃

image

0reactions
not-an-aardvarkcommented, Nov 15, 2017

Great, I’ll close this issue then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code's Jade syntax highlighting is bad - pug - Stack Overflow
The syntax highlighting is bad with the comments due to this issue with the language grammar in VS Code. include , block ,...
Read more >
Javascript syntax highlighting it not working
This is in long standing working code that highlights fine in older VS versions. I have now uncheck the discussed option and it...
Read more >
prettier bracket spacing - Flip Robo
... interpolations syntax highlight for html / pug code outside vue script, fix: template type-checking incorrectly reports error when using pnpm, ...
Read more >
Parcel.js
Every error includes a syntax highlighted code frame pointing to the exact location where the error occurred, along with hints about how to...
Read more >
ESLint | PyCharm Documentation - JetBrains
View problems and apply quick-fixes in the editor ... To view the description of a problem, hover over the highlighted code. ESLint: errors...
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