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

liquid-linter-cli

v1.0.3

Published

Command-line wrapper for the liquid template language linter.

Downloads

1,096

Readme

Liquid Linter CLI

Project Stage Maintenance Awesome License Dependency Status Latest Version on NPM

Staple Remover Logo

“Great things are done by a series of small things brought together.” ~ Vincent Van Gogh

This package is a wrapper for the NodeJs liquid-linter package, allowing it to be run from the command-line interface (CLI).

Installation

Install this package with NPM using npm install liquid-linter-cli --save (optionally adding --global for a system-wide install) or with Yarn using yarn add liquid-linter-cli (or yarn global add liquid-linter-cli for a system-wide install).

Usage

The lint command can be called with one or more paths of files or folders that need to be linted. The command has support for pipelines. when given a directory, it is scanned for the following file extensions:

  • .htm
  • .html
  • .liquid
  • .lqd
  • .markdown
  • .md

Currently the linter does not have a way to exclude files or folders. An example of how to achieve this is given in the "Pipes" section.

Simple usage

The most simple use is simply:

liquid-linter /path/to/directory/or/file/to/lint

Multiple sources

The lint command has support for multiple paths. This can be a mix of files and folders:

liquid-linter /path/to/directory/one /path/to/file /path/to/directory/two

Custom blocks and tags

Liquid has support for custom tags. The liquid-linter makes the distinction between tags (tags that do not require an end tag) and blocks (tags that do require an end tag).

Custom tags and blocks can be passed to the linter using the --custom-tag and --custom-block flags, respectively. Both can be added multiple times, to add more than one tag or block:

liquid-linter --custom-block section --custom-tag button --custom-tag color /path/to/directory

Piping

In order to exclude files and folder, the user has to create a list themselves which does not contain the files and/or folders that should be excluded.

One way to achieve this is by using a combination of find and xargs.

The following example shows how to lint all files and folders in the current directory except the node_modules and _site folders, and only for files with the .lqd extension (commonly used for includes)

find . -type f -name "*.lqd"     \
  -not -path './node_modules/*'  \
  -not -path './_site/*' -print0 \
| xargs -0 -n1 liquid-linter

Output

The output of the linter displays a list of files and the result of the linting of that file. Files with no issues are colored green, files with issues are colored red.

For files with issues, the line and column(s) at which the error occurred are show.

Example

screenshot of example output

The output is taken directly from liquid-linter. Any weird output or incorrect linting should be reported at the liquid-lint repository.

Contributing

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We've set up a separate document for our contribution guidelines.

Thank you for being involved! :heart_eyes:

Authors & contributors

The original idea and setup of this repository is by Potherca.

For a full list off all author and/or contributors, check the contributors page.

License

  • The logo for this project is the "Staple Remover" icon by Cassie McKown from the Noun Project

  • The code in this project is licensed under the MIT License

The MIT License (MIT)

Copyright (c) 2017 Dealerdirect B.V. Copyright (c) 2019 Potherca

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.