embroider-build / addon-blueprint

Blueprint for v2-formatted Ember addons
MIT License
28 stars 23 forks source link

When generating or upgrading a v2 addon linting is broken in VsCode #287

Open Mikek2252 opened 1 month ago

Mikek2252 commented 1 month ago

Creating or updating a v2 addon with this blueprint gives an error for the linting in VS code. with the following error Parsing error: Cannot find module '@babel/plugin-proposal-decorators'

The error only occurs with ember in vscode, running it with terminal passes.

The command i used was: pnpx ember-cli@latest init -b @embroider/addon-blueprint@latest --pnpm pnpx ember-cli@latest my-addon-name -b @embroider/addon-blueprint@latest --pnpm

plugins being used. ESLint v2.4.4 Prettier ESLint v6.0.0

NullVoxPopuli commented 1 month ago

what sub-project is throwing the error?

Mikek2252 commented 1 month ago

Only on the test app i believe.

NullVoxPopuli commented 1 month ago

Does the same behavior happen when you do pnpx ember-cli@latest new my-app --pnpm?

Mikek2252 commented 1 month ago

No issues when i use that command

NullVoxPopuli commented 1 month ago

is @babel/plugin-proposal-decorators declared in your test-app's package.json?

Mikek2252 commented 1 month ago

Yeah it is "@babel/plugin-proposal-decorators": "^7.24.1",

NullVoxPopuli commented 1 month ago

What happens if you add that to the root package.json?

Mikek2252 commented 1 month ago

That seems to fix it, happy to create a PR to fix it, if that is the correct fix

ef4 commented 1 month ago

I think we probably only need @babel/plugin-syntax-decorators, not the actual transform.

NullVoxPopuli commented 1 month ago

This also feels like a bug in the VSCode editor extension for eslint :thinking: