node-rs
node-rs copied to clipboard
deno-lint: ignore directives do not work
According to the docs, a // deno-lint-ignore directive should ignore a failing rule on the next line. The following is an example I ran where this fails:
~$ cat main.js
// deno-lint-ignore require-await
async function main() {
console.log('hello world!');
}
main();
~$ npx denolint
error[require-await]: Async function 'main' has no 'await' expression.
--> ~/main.js:2:1
|
2 | / async function main() {
3 | | console.log('hello world!');
4 | | }
| |_^
|
= help: Remove 'async' keyword from the function or use 'await' expression inside.
You can use eslint ignore directives as a workaround:
...
// eslint-disable-next-line no-empty
} catch {}
UPDATE: Just the eslint-disable-next-line.