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

How to configure VSCode for TypeScript? #20807

Open
BryanCrotazGivEnergy opened this issue Dec 5, 2024 · 6 comments
Open

How to configure VSCode for TypeScript? #20807

BryanCrotazGivEnergy opened this issue Dec 5, 2024 · 6 comments

Comments

@BryanCrotazGivEnergy
Copy link

BryanCrotazGivEnergy commented Dec 5, 2024

node v20, new project, macOS

ember new ... --typescript --pnpm

in ./tsconfig.json

{
  "extends": "@tsconfig/ember/tsconfig.json",
  "compilerOptions": {
  ...

vscode shows an error on this file:

File '@tsconfig/ember/tsconfig.json' not found.ts
Path to base configuration file to inherit from (requires TypeScript version 2.1 or later), or array of base files, with the rightmost files having the greater priority (requires TypeScript version 5.0 or later).

In a service, @tracked fails in vscode with

import Service from '@ember/service';
import { tracked } from '@glimmer/tracking';

export default class BlocklyService extends Service {
  @tracked toolboxElement?: HTMLElement = null;
}

Vscode error:

Unable to resolve signature of property decorator when called as an expression.
  Argument of type 'ClassFieldDecoratorContext<BlocklyService, HTMLElement> & { name: "toolboxElement"; private: false; static: false; }' is not assignable to parameter of type 'string | symbol'.ts(1240)
@NullVoxPopuli
Copy link
Contributor

Do you have a repro?
Do you have @tsconfig/ember installed?

@BryanCrotazGivEnergy
Copy link
Author

Brand new project, just ember g service after ember new.

Adding --embroider to ember new has fixed it

@BryanCrotazGivEnergy
Copy link
Author

Do you have @tsconfig/ember installed?

Only if ember new installed it.

@NullVoxPopuli
Copy link
Contributor

Did it?

I'm wondering if the bug is that it was accidentally omitted, or if we need to look elsewhere

@BryanCrotazGivEnergy
Copy link
Author

BryanCrotazGivEnergy commented Dec 5, 2024

Creating new test projects...

ember new --embroider --typescript --pnpm installs it
ember new --typescript --pnpm installs it

@NullVoxPopuli
Copy link
Contributor

that's good, so then this is something with your vscode.

I see no problem in neovim or my vscode.

what extensions do you have installed?

@kategengler kategengler changed the title [Bug] Ember 6.0.1 fails to lint in vscode How to configure VSCode for TypeScript? Dec 5, 2024
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