1. eslint-config-fbjs
For the most part, this configuration matches the ESLint configuration we have internally at Facebook.
eslint-config-fbjs
Package: eslint-config-fbjs
Created by: facebook
Last modified: Sat, 19 Nov 2022 19:07:08 GMT
Version: 4.0.0
License: MIT
Downloads: 70,492
Repository: https://github.com/facebook/fbjs

Install

npm install eslint-config-fbjs
yarn add eslint-config-fbjs

eslint-config-fbjs

For the most part, this configuration matches the ESLint configuration we have internally at Facebook.

There are several exceptions:

  • No special cases for projects. Some projects have stricter lint rules. Those configurations are not present here. If you open source a project with different configuration, just specify the overrides in your own repository's .eslintrc
  • No fb-specific rules. We have a number of custom rules internally that are not synced out. We may do that in the future. This means there are several things which we will not catch here but will be caught in Phabricator. Beware of that when relying on this configuration as your only linting process.

Usage

Install:

npm

 npm install --save-dev \
  eslint-config-fbjs \
  eslint-plugin-babel \
  eslint-plugin-ft-flow \
  eslint-plugin-jsx-a11y \
  eslint-plugin-react \
  eslint \
  hermes-eslint

yarn

 yarn add --dev \
  eslint-config-fbjs \
  eslint-plugin-babel \
  eslint-plugin-ft-flow \
  eslint-plugin-jsx-a11y \
  eslint-plugin-react \
  eslint \
  hermes-eslint

Configure

Add extends: 'fbjs' to your local .eslintrc

Strict Configuration

This package also comes with a strict version of the config. This can be used to make all warnings be reported as errors. While this can be overly strict, it can be helpful to avoid the case where some CI configurations don't fail for warnings.

Use extends: fbjs/strict in your .eslintrc

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code