Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] VSCode Integration Not Working #40

Closed
nlfurniss opened this issue Nov 28, 2022 · 6 comments
Closed

[Bug] VSCode Integration Not Working #40

nlfurniss opened this issue Nov 28, 2022 · 6 comments

Comments

@nlfurniss
Copy link

🐞 Describe the Bug

VSCode is not showing Prettier errors in gjs files, but does in js files

gjs no errors

js yes errors

However, the prettier plugin is working, as it can be successfully invoked from the commandline:

nfurniss: bs-proj (master) $ yarn prettier app/components/test.gjs
yarn run v1.22.10
$ code/bs-proj/node_modules/.bin/prettier app/components/test.gjs
app/components/test.gjs
const q
= 123;
= 123;
const q = 123;

<template>
  <Foo />"lol"
</template>
✨  Done in 0.77s.

🔬 Minimal Reproduction

Repro repo: nlfurniss/bs-proj@61a82ea

😕 Actual Behavior

No red squiggles in VSCode

🤔 Expected Behavior

Red squiggles in VSCode

🌍 Environment

  • prettier-plugin-ember-template-tag version: - ^0.2.1
  • ember-template-imports version: - ^3.4.0

➕ Additional Context

Installed VSCode plugins:

  • ESLint
  • Prettier - Code formatter
  • vscode-glimmer
@gitKrystan
Copy link
Collaborator

Sounds like you might be running Prettier as a linter rule via ESLint and eslint-plugin-ember. If so, this sounds like ember-cli/eslint-plugin-ember#1659

@nlfurniss
Copy link
Author

Oh so is the issue that the error w/using eslint-plugin-prettier w/this plugin throws an error thats silently causing the red squiggles to not show?

I can do Format Document in VSCode just fine (with and without the eslint prettier plugin)

@gitKrystan
Copy link
Collaborator

Oh so is the issue that the error w/using eslint-plugin-prettier w/this plugin throws an error thats silently causing the red squiggles to not show?

Most likely this, yes. What happens when you try to run eslint? I would expect one of the issues mentioned in ember-cli/eslint-plugin-ember#1659

I think Format Document uses straight prettier.format(), which works fine.

@nlfurniss
Copy link
Author

Oh so is the issue that the error w/using eslint-plugin-prettier w/this plugin throws an error thats silently causing the red squiggles to not show?

Most likely this, yes. What happens when you try to run eslint? I would expect one of the issues mentioned in ember-cli/eslint-plugin-ember#1659

I think Format Document uses straight prettier.format(), which works fine.

Oddly no...

nfurniss: bs-proj (master) $ node_modules/eslint/bin/eslint.js app/components/test.gjs

/Users/nfurniss/code/bs-proj/app/components/test.gjs
  1:7   error  'q' is assigned a value but never used                                                                                                                                                               no-unused-vars
  1:1   error  Replace `` with `·`                                                                                                                                                                                 prettier/prettier
  0:0   error  Replace `__GLIMMER_TEMPLATE(`<Foo·/>"lol"`,·{·strictMode:·true,·scope:·()·=>·({Foo})·})]` with `⏎··__GLIMMER_TEMPLATE(`<Foo·/>"lol"`,·{⏎····strictMode:·true,⏎····scope:·()·=>·({·Foo·}),⏎··}),⏎]⏎`  prettier/prettier
  4:12  error  'Foo' is not defined                                                                                                                                                                                 no-undef

@gitKrystan
Copy link
Collaborator

Note that the line:column for the prettier/prettier error when run via eslint is 0:0 which is incorrect. As a result, VSCode doesn't know where to put the squiggly lines. Fixing ember-cli/eslint-plugin-ember#1659 should resolve this issue as well.

@gitKrystan
Copy link
Collaborator

Going to close this since it's roughly the same issue with the same solution as #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants