Dan Dascalescu
Dan Dascalescu

Reputation: 151702

Using typescript-eslint with Deno

typescript-eslint recommends using "dual-linting" with Deno...

using those linters for what they support, then adding in ESLint for typed linting in a parallel or second step

...but doesn't explain how to add Deno support.

So how can typescript-eslint be configured to support Deno syntax, such as:

For example, the following main_test.ts should be linted without errors:

import { assertEquals } from "@std/assert";

Deno.test(function addTest() {
  assertEquals(2 + 3, 5);
});

What I've tried so far:

  1. Asked in the deno_lint repo in June 2024 - no responses, but a bunch of support.
  2. Found this 2020 SO question, but the top answer doesn't achieve what I'm looking for.
  3. NPM search for "eslint deno" - garbage
  4. Googling found eslint-import-resolver-deno - no updates in 5 years, others tried using it and gave up, and in the meantime we have Deno v2 and flat config.
  5. Next, @redabacha/eslint-import-resolver-deno but it doesn't document how to actually make eslint aware of Deno.

Upvotes: 5

Views: 236

Answers (1)

user16930239
user16930239

Reputation: 9788

This is the closest thing to what you are looking for.

using custom resolver to resolve .ts

to resolve Deno's remote dependencies eslint-import-resolver-deno is used

there are some problems from typescript language itself

Upvotes: 0

Related Questions