addon-blueprint
addon-blueprint copied to clipboard
When generating or upgrading a v2 addon linting is broken in VsCode
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
what sub-project is throwing the error?
Only on the test app i believe.
Does the same behavior happen when you do pnpx ember-cli@latest new my-app --pnpm
?
No issues when i use that command
is @babel/plugin-proposal-decorators
declared in your test-app's package.json?
Yeah it is "@babel/plugin-proposal-decorators": "^7.24.1",
What happens if you add that to the root package.json?
That seems to fix it, happy to create a PR to fix it, if that is the correct fix
I think we probably only need @babel/plugin-syntax-decorators
, not the actual transform.
This also feels like a bug in the VSCode editor extension for eslint :thinking:
FWIW I've seen this issue in several different projects where there's an app or addon that isn't at the project route (monorepo style). Another solution is to define the working directories for eslint in .vscode/settings.json
, which would look like this for this particular case:
{
"eslint.workingDirectories": [
"./my-addon",
"./test-app",
]
}
I haven't noticed any other impacts of adding this config besides it fixing the issue described at the top of this thread.
I think this is, in general, resolved.
I generated a new project,
npx ember-cli@latest addon test-eslint --blueprint @embroider/addon-blueprint --pnpm
cd test-eslint
and then opened vscode, typed some gibberish, and got eslint errors
if anyone is having an issue, let's start a new thread with specifics to your environment.
Thanks all!