Currently in development of deno we use ESLint to lint JavaScript and TypeScript code. Additionally std/ and cli/tests/unit are linted using deno lint as integration tests.
In deno_lint repository we have a small example binary called dlint that is essentially a small CLI on top of deno_lint crate (which is used as a basis for deno lint subcommand). There exists an issue to provide prebuilt dlint binaries on new releases of deno_lint crate (https://github.com/denoland/deno_lint/issues/367).
I propose we switch from ESLint to dlint to do linting during development for the following reasons:
ESLint (it's part of deno_third_party git submodule); I think ESLint is our last Node dependency and deno_lintdlint is significantly faster that ESLintIf we agree to do that then the order of action is as follows:
dlint - https://github.com/denoland/deno_lint/issues/367dlint binary with next deno_lint crate versiondlint binary to deno_third_party repositorytools/lint.py to use dlint binary instead of ESLintESLint from deno_third_partyCC @ry @kitsonk @lucacasonato @nayeemrmn @caspervonb
Just curious, is there anything the ESLint team can do to it easier to use ESLint? It seems like the Node.js dependency is the big issue?
@nzakas thanks for reaching out, I think there's really nothing ESLint could do at this point. We are working on our own linter written in Rust called deno_lint which has been available in Deno for a few months now.
This issue regards only internal code that gets built into the binary itself and would help to limit our dependence on Node.
I would be however interested in collaborating with ESLint team to allow using deno_lint's parser in ESLint which is significantly faster than estree (and produces similar AST).
denoland/deno_lint#367 has been resolved and dlint binaries are now available to download from GitHub release page.
We can now proceed to migrate tools/lint.py to use dlint instead of eslint - one note is that currently dlint requires to explicitly pass --script argument when linting scripts (= not ES modules) so tools/lint.py should run dlint on cli/rt/ with --script flag and without it for the rest of files.
@bartlomieju ah ok, thanks for the additional details.
I鈥檇 definitely be interested in collaborating to see what it would take to get your parser working in ESLint. The best way to get started is to open an issue in the eslint repo with a description of how the parser works and what sort of compatibility issues you know of.
Most helpful comment
@nzakas thanks for reaching out, I think there's really nothing ESLint could do at this point. We are working on our own linter written in Rust called
deno_lintwhich has been available in Deno for a few months now.This issue regards only internal code that gets built into the binary itself and would help to limit our dependence on Node.
I would be however interested in collaborating with ESLint team to allow using
deno_lint's parser in ESLint which is significantly faster thanestree(and produces similar AST).