1. eslint-config-loopback
ESLint configs for LoopBack projects.
eslint-config-loopback
Package: eslint-config-loopback
Created by: strongloop
Last modified: Fri, 17 Jun 2022 19:37:40 GMT
Version: 13.1.0
License: MIT
Downloads: 26,064
Repository: https://github.com/strongloop/eslint-config-loopback

Install

npm install eslint-config-loopback
yarn add eslint-config-loopback

eslint-config-loopback

LoopBack's ESLint shareable configs.

Usage

Add eslint and eslint-config-loopback to devDependencies:

npm install -D eslint eslint-config-loopback

In your project root, create/modify .eslintrc:

{
  "extends": "loopback"
}

Then in package.json, set your run script:

...
"scripts": {
  "lint": "eslint ."
},
...

That's it. Try it out by running:

npm run lint

It is recommended to set a posttest run script to auto lint after
running tests:

...
"scripts": {
  "lint": "eslint .",
  "test": "mocha",
  "posttest": "npm run lint"
},
...

Overriding rules

To override a particular rule, use the rules key:

{
  "extends": "loopback",
  "rules": {
    "comma-dangle": "off"
  }
}

While adopting ESLint in existing projects, there may be too many errors to fix
at once. In such cases, it may be desirable to modify the rule setting
of individual rules:

  • "off" - Turn the rule off
  • "warn" - Turn the rule on as a warning (doesn't affect exit code)
  • "error" - Turn the rule on as an error (exit code is 1 when triggered)

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