Closed ralexmatthews closed 1 year ago
I had a look at your rage output, and it seems you're still running an old version of the VSCode extension.
I suggest to update it, close VSCode, kill the LSP server (via rome stop
or using the process manager) and re open it.
If you still see the issue and you can't reproduce it in the playground (I couldn't), it means the issue is fixed on main
.
Hmmm... I checked for updates and it said there were none. It was on v0.20.0
. I then tried uninstalling and reinstalling, restarting the rome server, and still same thing.
I then tried switching to the prerelease version, v0.21.20221217
, and restarting the lsp and still same thing.
What would be the current version?
I've just ran into this too. Here's a minimal example that's reproducible on the command-line:
$ mkdir new-project
$ cd new-project
$ npm install rome
$ npx rome --version
Rome CLI version 11.0.0
$ cat > rome.json <<EOT
{
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUndeclaredVariables": "warn"
}
}
}
}
EOT
$ echo "const a = [1, 2, 3] as const;" > index.ts
$ npx rome check index.ts
index.ts:1:24 lint/correctness/noUndeclaredVariables ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ The const variable is undeclared
> 1 │ const a = [1, 2, 3] as const;
│ ^^^^^
2 │
Checked 1 file(s) in 3ms
👋 @rome/staff please triage this issue by adding one of the following labels: S-Bug: confirmed
, S-Planned
, S-Wishlist
or umbrella
This should be fixed by https://github.com/rome/tools/pull/3981
The fix will be in the incoming release.
Environment information
What happened?
So I had an existing project and had been using Rome as its full time formatter and linter, but then I turned on
noUndeclaredVariables
andnoUnusedVariables
and now running
yarn rome check .
and the vscode extension both give me errors ofeverywhere I try to do something like
But I can upload this code to the playground and it works as expected, so it seems like this is just a bug somewhere in my setup. I have tried removing and reinstalling my node_modules, and I am on version 11.0.0, which is just installed locally to my project.
rome_rage.txt
Expected result
const
should be a valid global typescript type.Code of Conduct