Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@searchspring/eslint-config

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@searchspring/eslint-config

Our style

  • 1.0.8-0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

eslint-config

This is based on the AirBnB style guide, but includes a number of additional plugins and some custom rules for our preferences.

Checkout the index.js for the details.

Plugins

Occasionally look here for new good stuff.

Install

To install just the config, use the line below.

npm i -D @searchspring/eslint-config

It's recommended to also install the Searchspring prettier config:

npm i -D @searchspring/prettier

In order to install all the related dependencies and a typical configuration for a JS project, also run the following:

npm i -D eslint husky lint-staged prettier fixpack

Then update your package.json with the following:

{
	husky: {
		hooks: {
			// Runs staged files for a commit through the scripts below
			'pre-commit': 'lint-staged',
		},
	},
	// Scripts for staged files
	'lint-staged': {
		'./package.json': ['fixpack', 'prettier --write'],
		'*.{js,ts}': ['prettier --write', 'eslint --fix'],
	},
	scripts: {
		format: 'prettier --write "**/*.{js,ts,json}"',
		lint: 'eslint --fix "**/*.{js,ts}"',
		// Important to run the fixpack before format, as format will fix the indentation
		style: 'fixpack && npm run format && npm run lint',
	},
}

Additional config if you are using Mocha

Update your eslint configuration with following:

	env: {
		...
+		mocha: true,
	},
	extends: [
		...
+		'plugin:mocha/recommended',
	]
+	plugins: [..., 'mocha'],
	rules: {
		...
+		'mocha/handle-done-callback': 'error',
+		'mocha/max-top-level-suites': 'off',
+		'mocha/no-exclusive-tests': 'error',
+		'mocha/no-global-tests': 'error',
+		'mocha/no-hooks-for-single-case': 'off',
+		'mocha/no-identical-title': 'error',
+		'mocha/no-mocha-arrows': 'off',
+		'mocha/no-nested-tests': 'error',
+		'mocha/no-pending-tests': 'error',
+		'mocha/no-return-and-callback': 'error',
+		'mocha/no-sibling-hooks': 'error',
	}

Keywords

FAQs

Package last updated on 27 Jan 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc