Package detail

eslint-config-fbjs

facebook185.1kMIT4.0.0

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

readme

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

changelog

[4.0.0] - 2022-07-11

Changed

  • Updated dependencies
  • Switch babel-eslint for hermes-eslint
  • Switch eslint-plugin-flowtype for eslint-plugin-ft-flow

[3.1.1] - 2019-08-20

Changed

  • Added peer dependencies for eslint (6.x), eslint-plugin-flowtype (3.x, 4.x).

[3.1.0] - 2019-03-20

Removed

  • Removed peer dependency of eslint-plugin-relay.

Changed

  • Upgraded ESLint and other peer dependencies.

[2.0.1] - 2017-11-26

Changed

  • Updated peer dependency of eslint-plugin-relay to allow a range.

[2.0.0] - 2017-07-19

Added

  • Includes eslint-plugin-jsx-a11y and eslint-plugin-relay

Changed

  • Upgraded ESLint and other peer dependencies to latest versions.

[1.1.1] - 2016-09-13

Fixed

  • Added 'use strict' to ensure the strict config works in Node.js v4.x

[1.1.0] - 2016-09-07

Added

  • fbjs/strict config, with the same rules enabled as the default config, with each warning upgraded to an error.

Changed

  • Switched to use eslint-plugin-flowtype for Flow-related rules

[1.0.0] - 2016-07-12

Added

  • Initial import from fbjs-scripts
  • Synced out additional configuration, enabled several plugins