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

eslint-watch

v8.0.0

Published

Run eslint with watch mode

Downloads

669,596

Readme

Eslint Watch

Build Status Code Climate Dependencies

Don't want to import Webpack, Grunt, or some other task package into your project? Then this is the tool for you. Eslint Watch is a simple command line tool that wraps Eslint. Eslint Watch provides file watching and command line improvements to the currently existing Eslint command line interface. All commands that Eslint offers can be used with the addition of a watch command and a couple new templating views. Don't believe me? Checkout the code or some of the features below!

Requirements

To use this tool we require eslint to be installed on your project. The versions supported are:

  • "eslint": ">=8 <9.0.0"
  • node >= 12.0.0 <= LTS Non LTS versions will have limited support.

Getting started

To run eslint-watch without the global install, make an npm script.

Installing

  • npm i -g eslint eslint-watch or npm i -D eslint eslint-watch
  • yarn global add eslint eslint-watch or yarn add -D eslint eslint-watch

Features added

  • Watching
    • Multi-directory watching
    • Runs a full directory lint before the watch
    • Press enter to rerun directory lint while watching
    • Include directories to ignore on watch
  • Eslint Overrides
    • Default directory linting. A directory is no longer required.

Options/Usage

Eslint-Watch replaces only a few commands that it needs to take control over. All other commands are forwarded to Eslint unmodified. Please refer to their help text for full command support as the one provided below might not be up to date with the latest Eslint changes.

esw [options] [file.js ...] [dir ...]

ESW Options:
  -h, --help                     Show help
  -w, --watch                    Enable file watch
  --changed                      Enables single file linting while watch is enabled
  --clear                        Clear terminal when running lint
  -v, --version                  Prints Eslint-Watch Version
  --versions                     Prints Eslint-Watch and Eslint Versions
  --watch-ignore RegExp          Regex string of folders to ignore when watching - default:
                                 /.git|node_modules|bower_components|.eslintcache/
  --watch-delay Int              Delay(ms) for watcher to wait to trigger re-lint - default: 300

Basic configuration:
  --ext [String]                 Specify JavaScript file extensions - default: .js
  --no-eslintrc                  Disable use of configuration from .eslintrc.*
  -c, --config path::String      Use this configuration, overriding .eslintrc.* config options if present
  --env [String]                 Specify environments
  --global [String]              Define global variables
  --parser String                Specify the parser to be used
  --parser-options Object        Specify parser options
  --resolve-plugins-relative-to path::String  A folder where plugins should be resolved from CWD by default

Specifying rules and plugins:
  --rulesdir [path::String]      Use additional rules from this directory
  --plugin [String]              Specify plugins
  --rule Object                  Specify rules

Fixing problems:
  --fix                          Automatically fix problems
  --fix-dry-run                  Automatically fix problems without saving the changes to the file system
  --fix-type Array               Specify the types of fixes to apply (directive problem, suggestion, layout)

Ignoring files:
  --ignore-path path::String     Specify path of ignore file
  --no-ignore                    Disable use of ignore files and patterns
  --ignore-pattern [String]      Pattern of files to ignore (in addition to those in .eslintignore)

Using stdin:
  --stdin                        Lint code provided on <STDIN> - default: false
  --stdin-filename String        Specify filename to process STDIN as

Handling warnings:
  --quiet                        Report errors only - default: false
  --max-warnings Int             Number of warnings to trigger nonzero exit code - default: -1

Output:
  -o, --output-file path::String  Specify file to write report to
  -f, --format String            Use a specific output format - default: stylish
  --color, --no-color            Force enabling/disabling of color

Inline configuration comments:
  --no-inline-config             Prevent comments from changing config or rules
  --report-unused-disable-directives  Adds reported errors for unused eslint-disable directives

Caching:
  --cache                        Only check changed files - default: false
  --cache-file path::String      Path to the cache file. Deprecated: use --cache-location - default: .eslintcache
  --cache-location path::String  Path to the cache file or directory
  --cache-strategy String        Strategy to use for detecting changed files in the cache - either: metadata or content - default:
                                 metadata

Miscellaneous:
  --init                         Run config initialization wizard - default: false
  --env-info                     Output execution environment information - default: false
  --no-error-on-unmatched-pattern  Prevent errors when pattern is unmatched
  --exit-on-fatal-error          Exit with exit code 2 in case of fatal error - default: false
  --debug                        Output debugging information
  --print-config path::String    Print the configuration for the given file

Other Options

Eslint-Watch uses chokidar under the hood to watch for changes. Chokidar can be configured to poll for changes (this might be necessary if you are running Eslint-Watch inside a VM or Container) by setting the CHOKIDAR_USEPOLLING environment variable to true.

Functionality

Simple lint and watch

Donate: