Closed
Description
TypeScript Version: 2.9.0-dev.20180409
Search Terms:
- suggestion
- diagnostic / diagnostics
Code
For the js:
module.exports = function() {
console.log('hello world')
}
Problem
The Convert to ES6 module
suggestion covers the entire function:
[Trace - 10:21:34 AM] Event received: suggestionDiag (0).
Data: {
"file": "/Users/matb/Downloads/k388w8mmpo/src/button.js",
"diagnostics": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 3,
"offset": 2
},
"text": "File is a CommonJS module; it may be converted to an ES6 module.",
"code": 80001,
"category": "suggestion"
}
]
}
This means that we show a lightbulb when you are anywhere inside the exported function.
Instead I believe that the suggestion range should only cover the module.exports
part
Playground Link:
Related Issues: