How can I disable errors when writing standalone nodejs shell scripts?
Using ALE with VIM and a somewhat outdated eslint (v7.32.0). (I am going to install new OS and for now I’m somewhat stuck with that version do to a myriad of version conflicts and a general mess when it comes to node.)
Anyhow: I often write small scripts for testing purposes or as stand-alone scripts. I.e. they do not have a .eslintrc – but merely rely on the global defaults.
As I can use await
at top-level I wonder how I can get rid of the error:
Parsing error: Cannot use keyword ‘await’ outside an async function
Can I use some inline /* eslint ... */
rule to fix this? Something like:
/* eslint sourceType: module */
/* eslint-disable await-oustide-async */
I use .mjs
extension for it to run with node.
Environment Info:
Node version: v16.16.0
npm version: v8.11.0
Local ESLint version: v7.32.0 (Currently used)
Global ESLint version: Not found
Have searched the web for a while, but it either is a unique issue, which I doubt, or that I use the wrong terms.