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

path-lint

v0.2.4

Published

Lint your project tree for filenames that don't match your conventions

Downloads

8

Readme

path-lint

Lints your tree's filenames with minimal configuration.

Installation

NPM

npm install -g path-lint

Or install it locally to your project:

npm install --save-dev path-lint

and add it to your lint script in package.json:

{
  "scripts": {
    "lint": "path-lint && <other-linters>"
  }
}

Cargo

cargo install path-lint

Usage

path-lint # lints the current directory for kebab-case formatting
path-lint -p src -f snake_case # lints the src directory for snake_case formatting
$ path-lint --help
Usage: path-lint [OPTIONS]

Options:
  -p, --path <PATH>              The root path to lint [default: .]
  -f, --formatting <FORMATTING>  Expected formatting for files [default: kebab-case] [possible values: kebab-case, lower-camel-case, pascal-case, shouty-kebab-case, shouty-snake-case, snake-case, title-case, train-case, upper-camel-case]
  -h, --help                     Print help
  -V, --version                  Print version

Configuration

One of the goals of this project is to avoid configuration. As of right now, the only configuration is the formatting you want to enforce. This is done via the -f or --formatting flag.

Help! A file I cannot rename is failing the linter

Because of the goal to be as configuration-less as possible, we encourage you to open a PR to add the file to src/ignore.rs if the file is required to have a specific casing by some tool. For example, package-lock.json is already excluded as it is required to be in kebab-case by npm.

While this of course is a hassle right now, the end goal is to have this tool be as simple as possible for everyone in the future, something which would not be possible if everyone had to configure their own ignore list.

Comparison to ls-lint

path-lint is a similar tool made to lint filenames. The approach taken by path-lint is however very different. ls-lint relies heavily on configuration, meaning that you have to specify everything from the ground up. path-lint on the other hand automatically parses any .gitignore files present in your tree and assumes that you want all non-configuration files to follow the same convention. This means that you can get started with path-lint in seconds, while ls-lint requires you to configure quite a bit.

On a very quick, non-scientific benchmark, path-lint and ls-lint perform roughly the same though as ls-lint cannot be configured to lint all files, the results are not directly comparable. ls-lint also required a ~40 lines long configuration file with specialized regex to lint the same files as path-lint.