Socket
Socket
Sign inDemoInstall

@thibaudcolas/eslint-plugin-cookbook

Package Overview
Dependencies
228
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @thibaudcolas/eslint-plugin-cookbook

Shareable ESLint config, based on airbnb/javascript, bundled as a plugin


Version published
Maintainers
2
Install size
11.5 MB
Created

Changelog

Source

6.0.0 (2020-06-03)

Features

  • config: update all config dependencies, with major updates (6c893b9)
  • deps: open ESLint peerDependency range to any version above 5.6.0 (a5239e7)

BREAKING CHANGES

  • config: this updates all configs/plugins this package is based on, as well as supporting ESLint 7. Please refer to the table below:

| package | from | to | | ------------------------- | ----------------- | ------- | | eslint | ^5.6.0 and ^6.0.0 | >=5.6.0 | | eslint-config-airbnb | 18.0.1 | 18.1.0 | | eslint-config-prettier | 6.1.0 | 6.11.0 | | eslint-plugin-import | ^2.18.2 | ^2.20.2 | | eslint-plugin-jsx-a11y | ^6.2.3 | ^6.2.3 | | eslint-plugin-react | ^7.14.3 | ^7.20.0 | | eslint-plugin-react-hooks | ^1.7.0 | ^4.0.4 |

Readme

Source

@thibaudcolas/eslint-plugin-cookbook ESLint

npm Build Status

Shareable ESLint config, based on airbnb/javascript, bundled as a plugin.

Why

We want shareable configs to have as low of an overhead as possible. Users shouldn't have to know exactly what plugins are required by the config, install them and manage their versions manually. This plugin contains a shareable config, with plugin dependencies automatically installed.

See https://github.com/eslint/eslint/issues/3458 for further discussion on this topic.

Usage

Install ESLint and the config:

npm install --save-dev eslint @thibaudcolas/eslint-plugin-cookbook

Then configure ESLint to use this config. As a .eslintrc.js in the root of your project:

module.exports = {
  // https://github.com/thibaudcolas/eslint-plugin-cookbook
  extends: "plugin:@thibaudcolas/cookbook/recommended",
};

With Prettier

This recommended config is Prettier-compatible. First, install Prettier:

npm install --save-dev prettier

Then, to configure Prettier itself, create a prettier.config.js file in the root of your project. You can use the following to get started:

// https://github.com/thibaudcolas/eslint-plugin-cookbook
module.exports = require("@thibaudcolas/eslint-plugin-cookbook/prettier.config");

Switching to this config

Read on: Upgrading to a stricter ESLint config.

Overriding the rules

Should further customisation be required, rules coming from external plugins require the @thibaudcolas/cookbook prefix:

module.exports = {
  // https://github.com/thibaudcolas/eslint-plugin-cookbook
  extends: "plugin:@thibaudcolas/cookbook/recommended",
  rules: {
-    "react/react-in-jsx-scope": ["warn"],
+    "@thibaudcolas/cookbook/react/react-in-jsx-scope": ["warn"],
-    "import/prefer-default-export": ["warn"],
+    "@thibaudcolas/cookbook/import/prefer-default-export": ["warn"],
  },
};

Tips

To get the most out of this config, it is assumed that projects have the following tools set up:

Rules

Extends

Cookbook config

Rules of airbnb

Disabled rules

Keywords

FAQs

Last updated on 03 Jun 2020

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