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-vocovo

v2.0.0

Published

A reasonable lint standard for VoCoVo javascript projects. Uses ESLint and Prettier

Downloads

1,821

Readme

eslint-config-vocovo

This VoCoVo linting standard expects developers to use Prettier for code formatting, and ESLint for code smell. This config uses Prettier both inside and outside ESLint. ESLint is only concerned with Javascript, but Prettier can format many different languages. The detail below explains how to use Prettier to good effect in both situations.

Installation in your project

You will need to have eslint and prettier installed to use this: npm install --save-dev eslint prettier.

  1. Install with: npm install --save-dev eslint-config-vocovo

  2. Add "extends": ["vocovo"] to your .eslintrc file to enable the config

For formatting independent of ESLint

If you choose to run prettier on its own you will need to give prettier a config. Typically this is done with a .prettierrc file into which you add rules.

Manually defining/maintaining prettier rules in your own project risks it falling out of sync with this config, so one way to use this project's .prettierrc file without defining rules manually is to add a "prettier" key within your package.json thus:

"prettier": "eslint-config-vocovo/prettierrc"

Configuring VSCode so linting and auto-fixing work

  1. Install Prettier for VSCode
  2. Install ESLint for VSCode
  3. Open the VSCode settings (Code -> Preferences -> Settings) in json mode, using the {} symbol in the top right of the setting screen. then, ensure you have at least the following defined:
{
  // ESLint auto-fixes JS by using Prettier in the background. ESLint requires one of two possible settings
  // depending on the VSCode ESLint plugin version: eslint.autoFixOnSave or editor.codeActionsOnSave.
  // When using Prettier on non-JS files, Prettier expects to see editor.formatOnSave.
  // Thus both settings are necessary.

  // INSTRUCTIONS FOR VSCODE ESLINT PLUGING 1.X (delete as applicable)
  "eslint.autoFixOnSave": true,

  // INSTRUCTIONS FOR VSCODE ESLINT PLUGING 2.X (delete as applicable)
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },

  // We enable this here, but _disable_ it (below) on the files we want ESLint to handle.
  "editor.formatOnSave": true,

  // Turn it OFF for JS and JSX, we will do this via eslint
  "[javascript]": {
    "editor.formatOnSave": false
  },
  "[javascriptreact]": {
    "editor.formatOnSave": false
  },

  // We want to use vanilla Prettier (i.e not via ESLint) for other languages like CSS and HTML.
  // But we turn it off for JS since we are doing it through Eslint
  "prettier.disableLanguages": ["javascript", "javascriptreact"]
}

Maintenance

All contributions are welcome and encouraged. If this standard doesn't suit your purposes it would be better that we modify this standard so it does, rather than overriding it within each project.

Publishing

To publish a version:

  1. Create a PR which bumps the version number and get it reviewed and merged
  2. Create a release on Github with the new version as the tag and title (no description needed), the release should target main
  3. Authorise your NPM account either with npm login (if you have an account) or by using the Publish token listed at the bottom of the NPM - Machine User entry in 1Password. The publish token should be set in an environment variable NPM_PUBLISH_TOKEN. If you use the publish token, you will need to use the two factor code in 1Password when publishing.
  4. Checkout main, make sure the branch is up to date, and run npm publish.