Socket
Book a DemoInstallSign in
Socket

eslint-plugin-caleb

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-caleb

Caleb Eby's shareable ESLint configuration

latest
Source
npmnpm
Version
11.0.0
Version published
Weekly downloads
303
-32.96%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-calebeby

Caleb Eby's ESLint Configuration. This exports itself as a "super-plugin" because of a limitation of ESLint.

The way this works is that it requires all of the plugin dependencies, and exports them from this plugin under a prefix.

The plugins that this exposes are:

This also exposes a couple rules from shopify:

To override settings for any of these plugins, you must prefix the configuration with caleb/, because the plugins are exposed through this "super-plugin".

{
  "extends": ["plugin:calebeby/recommended"],
  "rules": {
    "caleb/unicorn/catch-error-name": "off",
    "caleb/@shopify/prefer-early-return": "off"
  }
}

Installation

npm i -D eslint-plugin-caleb eslint prettier

Usage

Add this to your package.json:

{
  "scripts": {
    "check-lint": "eslint . && prettier --check .",
    "lint": "eslint --fix . && prettier --write ."
  },
  "eslintConfig": {
    "extends": ["plugin:caleb/recommended"]
  },
  "prettier": {
    "singleQuote": true,
    "trailingComma": "all",
    "semi": false
  }
}

Configurations

This plugin exposes the following configurations:

  • recommended: This is the main configuration. This exposes base rules, as well as some overrides for .ts/.tsx files
  • react: This adds some settings for React-specific rules
  • preact: This is the same as react, except it excludes rules that are irrelevant for Preact
  • jest: This adds some jest rules for test files, and declares the jest globals in those files

To include these configurations, add the ones you want to your extends array:

["plugin:caleb/recommended", "plugin:caleb/jest"]

Checking on CI

npm run check-lint

Checking Locally

(this will automatically fix many linting issues)

npm run lint

Keywords

eslint

FAQs

Package last updated on 24 Aug 2020

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