eslint-config-beacon
Shareable Config for Beacon Platform, Inc. JavaScript Developers
An ESLintStep 1: Installation
Global
Global installation is recommended for Beacon Platform, Inc. JavaScript developers. To install or upgrade the config along with its peer dependencies:
npm install -g git+ssh://git@gitlab.wsq.io:kevin.ho/eslint-config-beacon.git eslint eslint-plugin-react babel-eslint
In your global ~/.eslintrc.json
file:
Note that the eslint-config-
portion of the module name is assumed by ESLint.
Local
A specific project can extend this definition by including eslint eslint-config-beacon eslint-plugin-react babel-eslint
as saved dev-dependencies, and defining a local .eslintrc.json
. Project-level eslintrc files are recommended to be set as root
, which prevents users' global configs from producing inconsistent results:
Note on Parsing
This config now uses babel-eslint
as the parser by default. This enables linting some relatively modern code which ESLint's default parser does not handle, and was necessary for this project to lint itself. You still need to install babel-eslint
manually as it is a peer dependency of this config.
Step 2: Editor Integration
Using ESLint from the command line is not ideal. We want to integrate linting as an automatic step in our workflow, and even better -- as a background step in our code editor of choice. In this way, your editor will produce colored warnings and error marks in real-time as you write code. Beyond saving you from making mistakes, it also actively and effectively helps you to avoid definite errors and maintain a consistent company-wide code style.
Directions for ESLint's various editor integrations can be found here. ESLint is platform agnostic, so it works with WebStorm, VSCode, SublimeText, Atom, even Emacs and PyCharm!
Extending
Any rules added to your global or local .eslintrc.json
files will override the rules defined by this package. For example:
This turns on enforcing the use of semicolons, a rule which is ALREADY turned on by default in the current version of the eslint-config-beacon
package.
Background
The ESLint linting system is a popular one for its support of ES6 syntax, pluggable rules, automatic rule names in warning messages, and shareable / extendable config files.
This npm package provides a thorough starting config file. It was developed at Beacon Platform, Inc. to help JavaScript developers avoid definite errors and maintain a consistent company-wide code style.
This package was bootstrapped via Fullstack Academy of Code / Grace Hopper Academy's eslint-config-fullstack
package.
It is easy to override and extend this base config with custom rules, as explained above and in the ESLint docs.