npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

denolint

v2.0.14

Published

Deno lint command-line executable for Node.js

Downloads

495

Readme

denolint

Latest version Dependency status

Deno lint command-line executable for Node.js

A lot faster than eslint, handling both JavaScript and TypeScript sources.

This project started as fork of customised @node-rs/deno-lint, adding the flexibility of eslint:

  • Scan specific directories with specific ignore patterns (631, 647)
  • Scan directories configured by files.include (635, 645)
  • Fix handling of the configuration files.exclude (635, 646)
  • Support disabling rules in souces using eslint-disable (630, 642)
  • Execute the command-line tool denolint without loading the Node.js VM (648)
  • Allow specifying dirdctories, files and patterns as input for checking
  • Print warning messages in pretty or compact formats
  • Explain a rule or list all supported rules on the console

Synopsis

Scan sources in the current directory:

$ npx denolint

no-var

  × `var` keyword is not allowed.
  ╭─[src/index.js:3:3]
3 │ export function answer() {
4 │   var answer = 42
  ·   ───────────────
5 │   return answer
  ╰────
  help: https://lint.deno.land/#no-var

Unexpected token `return`. Expected this, import, async, function,
[ for array literal, { for object literal, @ for decorator, function, class,
null, true, false, number, bigint, string, regexp, ` for template literal, (,
or an identifier at test/index.js:4:3

Scan sources in the test subdirectory using an alternative config file:

npx denolint -c .denolint-tests.json tests

Usage

npx denolint [options] [dirs...]

The project directory will be scanned if no directory is specified either on the command line or in the config file. Directories on the command line take precedence over the directories in the config file.

--format, -f

Format of warnings printed on stderr. Either compact or pretty (default).

--project, -p

Root directory of the project, which contains files .denolintignore or .eslintignore. Defaults to the current directory.

--config, -c

Config path relative to the lint path. If not provided, a .denolint.json in the project directory will be tried to load.

Config file must be a JSON file:

Example:

{
  "files": {
    "include": ["src", "test"],
    "exclude": ["examples"]
  },
  "rules": {
    "tags": ["recommended"],
    "exclude": [
      "no-explicit-any",
      "ban-unknown-rule-code",
      "no-window-prefix",
      "no-empty-interface",
      "ban-types",
      "ban-untagged-todo",
      "no-unused-vars",
      "ban-ts-comment",
      "no-case-declarations",
      "no-this-alias"
    ]
  }
}

Check out deno_lint rules for all rules.

--no-config

Disables searching for the default config file if no specific config file is provided.

--dry-run

Only lists the files names, which would be processed, without checking their syntax. It can be used to learn what files will be processed.

--show-rule, -r

Explains a rule, or lists all rules, emphasizing the recommended ones, if no rule name is specified.

--help, -h

Prints the usage instructions and exits.

--version, -V

Prints the version of the package and exits.

Migration from @node-rs/deno-lint

If you specified the project root directory, do it using the -p, --project argument:

- npx denolint package/cmd
+ npx denolint -p package/cmd

If you used the -r, --root argument from the customised @node-rs/deno-lint, change it to the -p, --project argument:

- denolint -r package/cmd
+ denolint -p package/cmd

The argument --check-only known from @node-rs/deno-lint is not supported. If you needed to ignore the exit code, use an additional executable or shell alias, which exits successfully, for example:

- npx denolint--check-only
+ npx denolint || true

Troubleshooting

If the installation fails, set the environment variable DENOLINT_DEBUG to true and watch the debugging output on the console.

Support matrix

| Platform | node14 | node16 | node18 | | ---------------- | ------ | ------ | ------ | | Windows x64 | ✓ | ✓ | ✓ | | Windows x32 | ✓ | ✓ | ✓ | | Windows arm64 | ✓ | ✓ | ✓ | | MacOS x64 | ✓ | ✓ | ✓ | | MacOS arm64 | ✓ | ✓ | ✓ | | Linux x64 gnu | ✓ | ✓ | ✓ | | Linux x64 musl | ✓ | ✓ | ✓ | | Linux arm gnu | ✓ | ✓ | ✓ | | Linux arm64 gnu | ✓ | ✓ | ✓ | | Linux arm64 musl | × | × | × | | Android arm64 | × | × | × | | Android armv7 | × | × | × | | FreeBSD x64 | ✓ | ✓ | ✓ |

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

License

Copyright (c) 2020-2022 LongYinan Copyright (c) 2023 Ferdinand Prantl

Licensed under the MIT license.