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

v13.0.4

Published

Pipedrive specific linting configurations for JavaScript projects

Downloads

41,053

Readme

eslint-config-pipedrive

This is a shared config for ESLint that is based in Pipedrive internal coding standards. It is mainly intended to be used with the internal node-hooks library, but can be used completely separately as well.

Table of Contents

Installing without node-hooks

Install Pipedrive shared config:

npm install --save-dev eslint
npm install --save-dev eslint-config-pipedrive

Configuration

All you really need to configure is the flavour of the configuration package. You use the rules by extending the shared config:

{
	"extends": ["pipedrive"]
}

Rulesets

There are essentially 6 rulesets that you can extend:

  • "pipedrive" (or "pipedrive/es9"): Default ES9 (ES2018) based rules for Pipedrive
  • "pipedrive/es5": ES5 specific rules for Pipedrive
  • "pipedrive/es6": ES6 (ES2015) specific rules for Pipedrive
  • "pipedrive/es8": ES8 (ES2017) specific rules for Pipedrive
  • "pipedrive/es9": ES9 (ES2018) specific rules for Pipedrive
  • "pipedrive/react": React specific rules for Pipedrive
  • "pipedrive/typescript": Typescript specific rules for Pipedrive

Using React

Using React rules also requires additional ESLint plugin for the rules to work. To install dependency:

npm install --save-dev eslint-plugin-react

If you want to enable rules for React Hooks project, you must also install the react-hooks eslint module:

npm install --save-dev eslint-plugin-react-hooks

Using Typescript

Using Typescript rules also requires a few specific Typescript plugins for ESLint. Install dependencies:

npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser

Using Prettier

Install dependencies:

npm install --save-dev prettier eslint-config-prettier @pipedrive/prettier-config

Create your .eslintrc.json:

{
	"extends": ["pipedrive", "prettier"]
}

Create your .prettierrc.js file:

module.exports = require('@pipedrive/prettier-config');

Add Prettier to your pre-commit hook

  • For void core projects verify-staged will automatically run Prettier:
{
	"scripts": {
		"verify-staged": "bin/verify-staged.sh"
	},
	"pre-commit": ["verify-staged", "npm-version-check"]
}
  • For other projects add a format script to your package.json, which you can use to format whole project with prettier:
{
	"scripts": {
		"format": "npx prettier . --write"
	},
	"pre-commit": ["format", "lint", "test", "npm-version-check"]
}

When using VS Code, make sure you have the esbenp.prettier-vscode plugin installed and set the settings properly.

{
	// Format using Prettier
	"editor.defaultFormatter": "esbenp.prettier-vscode",
	// Fix eslint errors on save
	"editor.codeActionsOnSave": {
		"source.fixAll.eslint": true
	}
}

Contribution and rule proposals

The rules are defined by the Pipedrive developer community. So if there are some new rules that should be added, or would make things better, submit the new issue and fill in the details.

After submitting the issue, post the issue in an appropriate public channel. Voting happens with simple :+1: / :-1: system. And if there is enough interest in the change, it will be adopted.