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-plugin-quibble

v1.0.2

Published

ESLint plugin with stylistic code formatting rules that are often nitpicked in code review by quibbly developers.

Downloads

48

Readme

eslint-plugin-quibble

npm latest version license downloads

Supported rules

Learn more about each supported rules by reading their documentation:

  • no-excessive-whitespace: removes unnecessary whitespace characters, including leading and trailing spaces, as well as multiple spaces between class names.

By using ESLint extension for Visual Studio Code, you will get the following messages: errors

Latest changes

The vue-no-excessive-whitespace was renamed to no-excessive-whitespace and {j,t}sx support was added.

Check out the full changelog here.

Installation

1. Install eslint and eslint-plugin-quibble

pnpm i -D eslint eslint-plugin-quibble

2. Extend eslint configuration and enable rules

  • (Optional) Install Vue parser: pnpm i -D vue-eslint-parser

  • Inside your eslint.config.js:

import quibble from 'eslint-plugin-quibble'

export default [
  {
    plugins: {
      quibble
    },

    rules: {
      'quibble/no-excessive-whitespace': 'error'
    },
  },
  {
    files: ['*.vue'],
    languageOptions: {
      parser: 'vue-eslint-parser',
    }
  },
]

Adding vue-eslint-parser is optional - some popular configs such as antfu/eslint-config have it installed and configured already.

Future

In the future, this plugin will be expanded by the rules the community or myself find worth of adding.

FAQ

Quibble?

To argue about, or say you disapprove of, something that is not important:

  • There's no point quibbling about/over a couple of ~~dollars~~ whitespace characters.

What are your motivations?

To be perfectly honest, when doing code reviews at work, I often spot excessive whitespace characters, typos, or other stylistic errors - and it really irks me.

Should I nitpick the PR and point out those lines, saying:

Hey, could you remove this whitespace? I know it doesn't change much, but I'd be pleased to see it gone from the codebase. :)

Well, probably not. It's annoying to impose stylistic rules on developers that cannot be auto-fixed by their IDE - something I've learned from Theo. That's why I've developed this ESLint plugin.

Side note: The other option, to avoid making my fellow developers angry with me, was delivering the nitpicks in the form of a meme, which I actually did (at least) once #meme-driven-development.

missing-space

Why a separate plugin / why not contribute to already existing projects?

There are a few reasons why. The primary one is that I wanted to finally build a tool on my own. I've spent countless hours configuring ESLint to work the way I want, and my curiosity about how it works internally eventually won.

The second reason why, it takes time to get your PR reviewed, accepted and published. Where would the no-excessive-whitespace rule even fit? eslint-plugin-perfectionist, eslint-stylistic or maybe eslint-plugin-tailwindcss? There's an issue opened on the last one since Jul 21, 2023.

Therefore, it was easier to create a plugin from scratch - something I have a full control of, can use right away, and can learn from in the process.

Is the project open to contributions?

Yes! I very much welcome the community's input, and I would be pleased to see your ideas on how to expand or improve this plugin. Feel free to open an issue. :)

Why an ESLint plugin for code formatting / why not Prettier?

Following Anthony Fu's example with antfu/eslint-config, I'm migrating my projects to use only ESLint for both syntax highlighting and code formatting. Although prettier/eslint-plugin-prettier exists, I found it too annoying to configure both Prettier and ESLint, especially with the conflicts that can arise between the two.

Is flat config supported?

Yes.

Further reading

Eslint Config Inspector

You can check out your ESLint config by using the official tool - ESLint Config Inspector:

pnpm dlx @eslint/config-inspector@latest

Inspirations

I was heavily inspired by eslint-plugin-tailwindcss and eslint-plugin-vue as the source code (structure, methods of crawling into nodes, naming conventions etc.) for those plugins was essentially my entry point and the base to creating eslint-plugin-quibble.