Socket
Socket
Sign inDemoInstall

@bulb/eslint-config-bulb

Package Overview
Dependencies
Maintainers
68
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bulb/eslint-config-bulb

ESLint rules for Bulb packages


Version published
Maintainers
68
Created
Source

@bulb/eslint-config-bulb

A shared ESLint config for TypeScript codebases at Bulb.

This config extends the following existing configs, in this order of precedence:

  • react-app
  • airbnb
  • typescript-recommended
  • prettier

If your project is not using React, the React rules mostly won't have any impact.

If your project is not using Typescript+Prettier, update your project to use Typescript+Prettier immediately.

You can refer to index.ts for the full list of rules.

Getting started

To install:

yarn add --dev eslint@^6 @bulb/eslint-config-bulb

Then add the following to .eslintrc.json in the root of the directory you want to lint:

{
  "extends": ["@bulb/eslint-config-bulb", "@bulb/eslint-config-bulb/jest"]
}

If you're using mocha for testing, use the following instead:

{
  "extends": ["@bulb/eslint-config-bulb", "@bulb/eslint-config-bulb/mocha"]
}

The Jest config assumes your test files are using the extension .test.tsx?, mocha assumes .spec.ts.

Per-project rule overrides

Different projects have different needs. You can override rules in your .eslintrc.json. If you find yourself disabling the same rules in multiple projects, consider updating this config instead.

What about TSLint?

TSLint is being deprecated in favor of ESLint.

Add a lint script to package.json

Add the following script to the scripts section of your package.json:

{
  // ... other package.json stuff

  "scripts": {
    // ... other scripts

    "lint": "eslint --cache 'src/**/*.{ts,tsx,js,jsx}'"
  }
}

You may need to adjust the folders and file extensions based on your project.

Next steps

After getting ESLint set up locally, you probably want to:

  1. Add a lint check commit hook using lint-staged.
  2. Add a lint step to your build.

Keywords

FAQs

Package last updated on 09 Jan 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

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