You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TypeScript compiler allows suppressing errors and warnings using a // @ts-ignore comment above the offending line:
varx: number=123;// @ts-ignore: The compiler will suppress the error belowx="hello";
It also supports // @ts-nocheck at the top of files for suppressing errors in a whole file.
Would it make sense to add a similar feature in tl? I suppose it could be useful when migrating Lua codebases to Teal, to make the porting task more manageable.
Some potential concerns:
Not sure if processing comments in the compiler is a good idea...
These annotations could be handled by a separate tool, outside of the compiler.
The text was updated successfully, but these errors were encountered:
I don't think the core compiler should process those comments, but perhaps the parser could preserve them for use by other tools as in the experimental preserve-comments branch. Still, that branch only stores the comments in the AST, it does not expose them via tl types. But I think Cyan for example is using the API, so it would be a matter of adding API functionality in that branch to obtain comments [*], if that's a feature that's wanted in the build tool.
[*] if we add a public API to read comments from the source, it would be good to consider also other use-cases such as documentation generation. (Is tealdoc using its own parser? @SovietKitsune ?)
Tealdoc uses its own parser for comments by using the y position on each of the types.
Shiroko (a Teal linter) currently only looks at the end of a line for an ignore comment.
Related issue: teal-language/vscode-teal#41
The TypeScript compiler allows suppressing errors and warnings using a
// @ts-ignore
comment above the offending line:It also supports
// @ts-nocheck
at the top of files for suppressing errors in a whole file.Would it make sense to add a similar feature in tl? I suppose it could be useful when migrating Lua codebases to Teal, to make the porting task more manageable.
Some potential concerns:
The text was updated successfully, but these errors were encountered: