In my Eclipse setup with JSHint, I encountered an issue when configuring "esversion": 6
. This resolved arrow function warnings but introduced async and await warnings instead. Switching to esversion 8 or 9 eliminated the async and await warnings but brought back the arrow function warnings.
Given that ES9 should support arrow functions, is there a way to configure JSHint to allow both without warnings?
{
// == Enforcing Options ===============================================
//
// These options tell JSHint to be more strict towards your code. Use
// them if you want to allow only a safe subset of JavaScript, very
// useful when your codebase is shared with a big number of developers
// with different skill levels. Was all true.
"bitwise" : true,
...
"esversion" : 9,
// == Relaxing Options ================================================
//
// These options allow you to suppress certain types of warnings. Use
// them only if you are absolutely positive that you know what you are
// doing. Was all false.
...
// == Environments ====================================================
...
// == JSLint Legacy ===================================================
...
// == Undocumented Options ============================================
...
"predef" : [
"Java", "JavaFX", "$ARG"
]
//, "indent" : 2 // Specify indentation spacing
}
After some editing, I did manage to resolve this by adding async and await to the global variables list. However, I believe there might be a better solution out there.
"globals" : {
"async" : true,
"await" : true,
"describe" : true,
"expect" : true,
"it" : true
},