Install deno_lint on Ubuntu 24.04

Install deno_lint on Ubuntu 24.04

The deno_lint is a static analysis tool (also known linter) for JavaScript and TypeScript programming language. While deno_lint is integrated into the Deno runtime and can be used via the Deno CLI, it is also available as a standalone binary. This tutorial explains how to install deno_lint on Ubuntu 24.04.

Install deno_lint

Download deno_lint archive to /usr/local/bin directory:

sudo wget -qO /usr/local/bin/dlint.gz https://github.com/denoland/deno_lint/releases/latest/download/dlint-x86_64-unknown-linux-gnu.zip

Extract the executable out of the archive:

sudo gunzip /usr/local/bin/dlint.gz

Set execute permission for file:

sudo chmod a+x /usr/local/bin/dlint

We can verify deno_lint version as follows:

dlint --version

Testing deno_lint

Create a simple JavaScript file for testing:

printf "var x = 1;\nconsole.log(x);" > test.js

To use deno_lint, run the command dlint run followed by the name of the JavaScript or TypeScript file. For example:

dlint run test.js

The command will analyze the code and provide feedback on any detected issues. Output:

error[no-var]: `var` keyword is not allowed.
 --> /home/adminer/test.js:1:1
  | 
1 | var x = 1;
  | ^^^

  docs: https://lint.deno.land/rules/no-var


Found 1 problem

Uninstall deno_lint

To uninstall deno_lint, delete the associated file:

sudo rm -rf /usr/local/bin/dlint

Leave a Comment

Cancel reply

Your email address will not be published.