hilla
hilla copied to clipboard
Generated `tsconfig.json` is not `json` compliant
When generating the tsconfig.json
avoid any comment because IDE can complain about it.
Original report was in forum: https://vaadin.com/forum/thread/18187819/problem-vaadin-15-0-3-and-eclipse
If we really want to keep the comment AND make the file JSON-compliant, we could consider a hack like in
{
"__COMMENT__": [
"This TypeScript configuration file is generated by vaadin-maven-plugin.",
"This is needed for TypeScript compiler to compile your TypeScript code in the project.",
"It is recommended to commit this file to the VCS.",
"You might want to change the configurations to fit your preferences",
"For more information about the configurations, please refer to ",
"http://www.typescriptlang.org/docs/handbook/tsconfig-json.html",
"NOTE: this is a comment",
"But since JSON does not support //comments, it's added in this weird way."
],
"compilerOptions": {
"sourceMap": true,
This also happens in 14.1.27
This also happens in 14.1.27
A tsconfig.json
file in a Vaadin 14.1.27 app? That sounds very confusing to me as I am pretty confident Vaadin 14.x does not have built-in support for TypeScript. Could you please attach a reduced example project where you see this issue happen in Vaadin 14.1.27?
Hi @vlukashov,
I downloaded blank starter from Vaadin (14 LTS) and ran it with mvn jetty:run. A short while later the following shows up in eclipse.
This is the file contents
Thanks! Now I understand the issue better. The screenshot shows that Eclipse complains about a file deep inside the node_modules
folder. While this is not in direct control of Vaadin (it comes from a dependency and we do not generate this file nor can we modify it), I see how this becomes an annoying issue when you work with a Vaadin project in Eclipse.
I wonder, is there a way to configure Eclipse to not run any analysis on the contents of the node_modules
folder.
Yes you can configure eclipse not to run the json analysis for a project. Add exclude group and then add the rule. (Be sure the rule says 'folder' and not 'file')
Still it would be nice if there is no json problem at all.
Thanks @vlukashov and @BrunoEberhard. Best tip ever!
Exactly the same happens for Vaadin 14.3.0 and with latest Eclipse even for the my-todo starter.
And thanks to @BrunoEberhard , JSON Validator Exclude rule for npm_modules folder clears the errors.
I've made a PR for documentation on "using Eclipse" about disabling JSON syntax for node_modules
. This issue can be still considered for the generated tsconfig.json
file. But for 14 at least there is nothing else we can do.