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-config-pollinate

v3.0.4

Published

Pollinate eslint configurations

Downloads

1,045

Readme

eslint-config-pollinate

Purpose

This is a node package that houses ESLint configurations. It enforces a basic standard agreed upon by some of the maintainers of Pollinate’s core JavaScript libraries.

If you’re the maintainer of a project using these standards and wish to change or override these rules, you can:

The principle behind these standards is deviations from these standards are OK, but they should be a conscious decision, not a casual oversight.

console and debugger

console and debugger statements are allowed with a warning to keep debugging easy. However, this convenience comes at a cost.

debugger statements will stop JavaScript execution and should never be allowed in production. As such, you should consider how you will prevent them from making their way into production. One possible arrangement is to trigger a build failure on ESLint warnings for anything other than local development.

Verbose, always-on logging can have adverse performance effects in node and clutters shared environments like a browser where more than one script is likely to be running. Ideally, your app or library should use a logging module that’s set up with an inline ESLint rule and toggled on or off depending on an environment variable or query string parameter.

Installation

To install in your project:

$ npm install --save-dev eslint eslint-config-pollinate

You may have multiple environments (e.g. node build scripts and browser code) in the same repo. You can set up multiple .eslintrc.json files in the directories of each of your environments:

.eslintrc.json for generic browser code

{
  "extends": [
    "pollinate/environments/browser"
  ]
}

.eslintrc.json for Vue code (requires eslint-plugin-vue and babel-eslint)

{
  "extends": [
    "pollinate/environments/vue"
  ]
}

.eslintrc.json for node code

{
  "extends": [
    "pollinate/environments/node"
  ]
}

.eslintrc.json for universal (a.k.a. isomorphic) code

{
  "extends": [
    "pollinate/environments/universal"
  ]
}

You may also want to add environments for common libraries and an ESLint plugin for templating languages such as JSX that mix JavaScript with proprietary markup.

Last but not least: set your build up to enforce ESLint. JavaScript developers tend to use a variety of editors set up in a variety of ways. It’s up to you to ensure that a contributor to your project who isn’t running ESLint in their editor won’t run afoul of your project’s rules and trip up the next contributor who is running ESLint in theirs. ESLint has plugins for grunt, gulp and webpack. If you’re rolling your own build from scratch, ESLint’s CLI is pretty straightforward and is also accessible via a JavaScript API.

Automatic fixing

If you want linting errors to be automatically corrected, you have a couple of options:

  1. Set your build up to run the --fix option in the ESLint cli.
  2. Use a tool like eslint-to-editorconfig to dynamically generate an .editorconfig file.

There is no straightforward way to incorporate either of these options into this package, so they’re both optional and up to you to implement.

Versioning

This package follows semantic versioning (major.minor.patch). In this case:

  • A patch change fixes a bug or removes a rule. This should not generate any new linting errors.
  • A minor change may add a new rules that may generate some new linting errors, but they should be easily fixed.
  • A major change adds significant new rules, renames or restructures existing rules, or upgrades the ESLint dependency to a new major version.