Closed meeroslav closed 1 year ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.74.0. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
The latest version has the same error
Minimal example:
export interface PackageJson {
exports?:
| string
| Record<
string,
string | { types?: string; require?: string; import?: string }
>;
}
export function foo() { }
This is limitation of grammar because there is no way to look beyond or before single line types do not cross line so at the end of string type scope ends and everything beyond will be expression. Moving |
on same line will help with the continuation of the scope.
Duplicate of #761
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
https://github.com/nrwl/nx/
packages/nx/src/utils/package-json.ts
Current behavior: The function call to
require.resolve
is marked with red parenthesis despite no error existing (nor being shown) and all the code after that line has broken visual representation.Expected behavior: Code should still maintain the proper theme in files that contain
require.resolve