Détail du package

eslint-config-loopback

strongloop28.8kMIT13.1.0

ESLint configs for LoopBack projects.

eslint, eslint config, eslint config loopback, eslint-config

readme

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)

changelog

2019-04-08, Version 13.1.0

  • Add no-const-assign to error (Viktor Kuroljov)

2018-12-07, Version 13.0.0

  • Enable no-var and prefer-const rules (Miroslav Bajtoš)

  • Enable ES2017 and async functions (Miroslav Bajtoš)

2018-11-19, Version 12.1.0

  • Update "eslint-plugin-mocha" module to "^5.2.0" (Victor Nogueira)

2018-08-29, Version 12.0.0

  • add no-extra-semi (jannyHou)

2018-07-16, Version 11.0.0

  • Enable function-paren-newline rule (Dan Jarvis)

2017-12-11, Version 10.0.0

  • Add more mocha checks (Miroslav Bajtoš)

  • feat(mocha): add no-exclusive-tests (Samuel Reed)

  • Update LICENSE (Diana Lau)

  • Create Issue and PR Templates (#24) (Sakib Hasan)

  • Add CODEOWNER file (Diana Lau)

  • Add no-multi-spaces rule (deepakrkris)

  • Replicate new issue_template from loopback (Siddhi Pai)

  • Replicate issue_template from loopback repo (Siddhi Pai)

2017-01-31, Version 8.0.0

  • Enable no-redeclare (Miroslav Bajtoš)

2017-01-06, Version 7.0.1

  • func-call-spacing: never (Miroslav Bajtoš)

  • spaced-comment: always (Miroslav Bajtoš)

2016-12-14, Version 6.1.0

  • Add "es6" to the list of "env" (Miroslav Bajtoš)

  • Update paid support URL (Siddhi Pai)

2016-11-30, Version 6.0.0

  • Add parser option for ES6 (Simon Ho)

  • Put issues tab back (siddhipai)

  • Fix issues redirection in package.json (Siddhi Pai)

  • Remove issues warning from README.md (Siddhi Pai)

2016-11-15, Version 5.0.0

  • set eslint config disallow undeclared variables (Shing)

  • Update README.md (Simon Ho)

  • Fix bugs URL in package.json (Simon Ho)

  • Add where to post issues message in README.md (Simon Ho)

  • Update URLs in CONTRIBUTING.md (#8) (Ryan Graham)

2016-05-27, Version 4.0.0

  • Require "strict" mode enabled at global level (Miroslav Bajtoš)

2016-05-06, Version 3.0.1

  • update copyright notices and license (Ryan Graham)

2016-05-06, Version 3.0.0

  • Update README.md (Simon Ho)

  • Disable unused expressions (Miroslav Bajtoš)

  • Update object-curly-spacing rule (Simon Ho)

2016-04-19, Version 2.0.0

  • Disable multiple empty lines (Miroslav Bajtoš)

2016-04-04, Version 1.0.0

  • First release!