Socket
Socket
Sign inDemoInstall

@automattic/calypso-eslint-overrides

Package Overview
Dependencies
0
Maintainers
26
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @automattic/calypso-eslint-overrides

Shared Calypso eslint config


Version published
Weekly downloads
2
increased by100%
Maintainers
26
Install size
9.82 kB
Created
Weekly downloads
 

Readme

Source

@automattic/calypso-eslint-overrides

This package contains ESlint configuration used to override default ESLint settings, grouped by runtime.

The main use case is when a package has code expected to run in a browser, and code expected to run in Node.js.

Usage

Imagine you have an .eslintrc.js that applies some config designed to enforce/prevent some code conventions that won't work well in a browser, or that inherits some rules from a parent .eslintrc.js

module.exports = {
	env: {
		browser: true
	},
	rules: {
		// Polyfill nodejs modules for the browser is expensive, disable them
		'import/no-nodejs-modules': 'error'
	}
}

If there is some section of the code that is meant to be run by Node.js (eg: a ./bin/ directory with some scripts), you can add an override like:

const { nodeConfig } = require('@automattic/calypso-eslint-overrides/node')

module.exports = {
	env: {
		browser: true
	},
	rules: {
		// Polyfill nodejs modules for the browser is expensive, disable them
		'import/no-nodejs-modules': 'error'
	},
	overrides: [
		{
			files: "./bin/**.*"
			...nodeConfig
		}
	]
}

Keywords

FAQs

Last updated on 08 Oct 2021

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