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

mofo-style

v2.4.0

Published

A Javascript style guide including linters for the Mozilla Foundation Engineering team.

Downloads

69

Readme

Mozilla Foundation JS Style Guide

This repo contains an ESLint "RC" file, which defines our standard JavaScript formatting rules.

Additionally, ESLint will discover common syntax errors in your code.

Installing ESLint

Assuming you already have Node and npm installed, run npm install -g eslint in your terminal. This will create a global install of the ESLint CLI.

Setup

Even if you have ESLint as a global install, it's good practice to require it as a development dependency for your project. This ensures that it will be available for all developers regardless of their local configuration. It will also ensure that Travis is able to validate your code, which is a good idea since it ensures malformed code won't be deployed or merged.

Simply run npm install eslint --save-dev in your project root.

After you include ESLint in your project you can use npm to install this RC file as a module, which you can direct ESLint to use.

Run npm install mofo-style --save-dev

Once you have ESLint and this RC file, you can lint your project's code.

For example:

eslint --config ./node_modules/mofo-style/.eslintrc.yaml example.js

It's recommended that you add a linting task to your project's task runner (preferably npm) as well as instruct Travis to execute it.

Automated formatting

ESLint has a very helpful flag, --fix, which will automatically fix many styling issues for you (anything with a wrench icon on this page).

If you incorporate --fix into your task runner, then it's recommended that you make a new task for it instead of adding it to your standard linting task. This will allow you to safely connect your standard read-only test to Travis without running the risk of it modifying your committed code.

Extending The RC

The RC provided in this repo is intended to cover any ES6 based project. It's up to you to extend it to cover your project's specific environment(s). You can either specify environments via the --env flag or add a eslintConfig field to your package.json with your extended configuration. Read more on this topic here.

Rules

Refer to the RC file and the corresponding rule definitions for specifics.

EditorConfig

To more easily follow the rules you can add the EditorConfig plugin to your editor (if it needs one), which will read an .editorconfig file. Unfortunately, EditorConfig doesn't allow you to dynamically set a path for the config, so you'll need to copy .editorconfig into your project's root directory if it doesn't already have one.