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

@bmearns/eslint-config

v2.1.1

Published

Standard linter config for me.

Downloads

5

Readme

eslint-config-mearns

My eslint styling rules for NodeJS projects.

Use

# > npm install --save-dev git+https://github.com/mearns/eslint-config-mearns.git
> npm install --save-dev @bmearns/eslint-config
> npm install --save-dev eslint@8

Set your .eslintrc.json as follows:

{
    "extends": ["@bmearns/eslint-config"]
}

Optionally, but recommended:

> npm install --save-dev prettier pretty-quick husky

And merge the following into your package.json:

{
    "scripts": {
        "lint": "mearns-lint .",
        "pretty": "pretty-quick --staged"
    },
    "husky": {
        "hooks": {
            "pre-commit": "npm run pretty -s"
        }
    }
}

Overview

Parses ECMA Version 12, rules based on "JavaScript Standard Style" and Prettier (v3), but with semicolons.

The rules start with "standard" but we put semicolons back in because some people are really adverse to relying on ASI. Our rules require the use of semicolons to terminate statements, require a space after a semicolon and prohibit a space before a semicolon, and prohibit the use of extra-semicolons (semicolons that create empty statements).

We also use the "prettier/recommended" configuration and specifically set all prettier rules to "error" level (some default to "warning").

Finally, we add a "no-warning-comments" rule which will fail if any comment contains strings "FIXME", "TODO", or "XXX" (case-insensitive in all cases). This isn't to imply you shouldn't use comments like this, these rules allow you to use them to flag things that you need to fix before you merge or publish. However, these rules do imply that there shouldn't be any long-lived use of these comments: use an issue tracker for that.

Variations

If you're using jest, you might want to extends "@bmearns/eslint-config/jest"; this will set appropriate overrides for files under the test/ directory. Or if you're using jest with your test files adjacent to the source files they test, use "@bmearns/eslint-config/jest-adjacent" instead. This assumes your files are named like "foobar.test.ext".

If you're writing in typescript, you probably want to use "@bmearns/eslint-config/typescript", which will set appropriate overrides for typescript files (based on ".ts" extension). Note that you'll want to have this after the jest variant if you're using both.