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.

Question: Lint a workspace in VSCode?

See original GitHub issue

When using VSCode workspace with multiple folders/apps, template linting doesn’t run, however the .js files are linted properly. eg.

My Workspace
     frontend-ember-app
     backend-ember-app

I’ve tried configuring the VSCode eslint extension to lint the entire workspace, the eslint server seems to pickup the config, but template linting doesn’t run for the .hbs files.

What additional config is required?

  "settings": {
    "eslint.autoFixOnSave": true,
    "eslint.workingDirectories": [
      {
        "directory": "/Users/Me/FrontEndApp",
        "changeProcessCWD": true
      },
            {
        "directory": "/Users/Me/BackEndApp",
        "changeProcessCWD": true
      }
    ],
    "eslint.lintTask.enable": true,
    "eslint.lintTask.options": "-c /Users/Me/FrontEndApp/.eslintrc.json --ignore-path /Users/Me/FrontEndApp/.eslintignore ."
  }
[Info  - 2:10:18 PM] ESLint server is running.
[Info  - 2:10:19 PM] ESLint library loaded from: /Users/Me/FrontEndApp/node_modules/eslint/lib/api.js

Reproduction -Init two ember apps. -Add both app folders to a workspace in VS code. -Add an empty <img /> to application.hbs

Expected Result should get a line error within the VScode editor for the line img tags must have an alt attribute : ember-template-lint but it doesn’t happen.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
danDanV1commented, Nov 22, 2019

I believe that’s true. It’s an issue with the Ember Language server extension for VScode, instead use the “Unstable Ember Language Server” from lifeart.vscode-ember-unstable extension instead. It’s a fork and has a lot of improvements, including linting for mono-repos, that from what I’ve heard will eventually be merged into the original Ember Langauge Server.

1reaction
rwjbluecommented, Feb 22, 2020

Fixed by https://github.com/ember-template-lint/ember-template-lint/pull/1138 (which will land in a 2.0.0 beta soon).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linting Python in Visual Studio Code
To enable linters, open the Command Palette (Ctrl+Shift+P) and select the Python: Select Linter command. The Select Linter command adds "python.linting.<linter> ...
Read more >
How To Enable Linting on Save with Visual Studio Code and ...
Learn how to lint your code on every file save using ESLint rules and VS Code settings.
Read more >
Show all warnings and errors in visual studio code
ES-Lint has introduced a new task in VS Code. You have to enable it in the workspace setings. "eslint.lintTask.enable": true.
Read more >
User and Workspace Settings - vscode-docs
The workspace settings file is located under the .vscode folder in your project. ... Controls problem severities used in the lint validation.
Read more >
No Problems have been detected in the workspace - VS Code
And thank you for your question. In VSCode, SonarLint should detect issues in open files and show them in the “Problems” view. I...
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