node-rs icon indicating copy to clipboard operation
node-rs copied to clipboard

deno-lint: ignore directives do not work

Open zachauten opened this issue 3 years ago • 1 comments

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.

zachauten avatar Apr 20 '22 23:04 zachauten

You can use eslint ignore directives as a workaround:

  ...
  // eslint-disable-next-line no-empty
} catch {}

UPDATE: Just the eslint-disable-next-line.

prantlf avatar Aug 01 '22 05:08 prantlf