google / google/closure-compiler
Fail on ignored inline types
Open
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
I've been experimenting with inline types such as:
``` javascript
var myFoo = function /** number */ (x) { return "a"; }
```
Now this isn't supported (https://github.com/google/closure-compiler/issues/1063) and silently passes. Making it hard to feel one's way around the correct syntax.
I propose a check condition which fails when a single-line potential inline type annotation is found that has no effect:
``` javascript
... /** something */ someJsCode
someJsCode /** something */ ...
```
I'd do it myself with a PR but it's a bit out of my depth without some pointers.
Contributor guide
Assessment
This issue has not been assessed yet.