Socket
Socket
Sign inDemoInstall

eslint-config-pipedrive

Package Overview
Dependencies
190
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-config-pipedrive

Pipedrive specific linting configurations for JavaScript projects


Version published
Maintainers
3
Install size
9.28 kB
Created

Readme

Source

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.

Keywords

FAQs

Last updated on 25 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc