@zestia/eslint-config
This package provides linting rules for JavaScript.
The rules are based on community standards, with a few extra ones specific to Zestia.
Installation
npm install --save-dev @zestia/eslint-config
Add the following to ~/.npmrc
to pull @zestia scoped packages from Github instead of NPM.
@zestia:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<YOUR_GH_TOKEN>
Setup
-
Create the following file
.eslintrc.js
, choosing the appropriate ruleset depending on your project:Vanilla JavaScript
module.exports = { extends: '@zestia/eslint-config' };
Ember apps
module.exports = { extends: '@zestia/eslint-config/ember-app' };
Ember addons
module.exports = { extends: '@zestia/eslint-config/ember-addon' };
-
Add the following to
scripts
inpackage.json
"lint:js": "eslint ."
Running
npm run lint:js
Notes
-
eslint:recommended
for minimal recommended defaults -
eslint-config-standard
for a set of community lint rules around best practices and catching errors -
eslint-config-prettier
for turning off eslint rules that conflict with prettier -
eslint-plugin-ember
for ember-specific recommended lint rules -
eslint-plugin-hbs
for linting handlebars in tagged templates within javascript files -
eslint-plugin-n
for linting ember-cli project files (node) -
eslint-plugin-qunit
for linting tests -
eslint-plugin-ember-data-sync-relationships
to enforce synchronous relationships -
eslint-plugin-no-relative-import-paths
for preferring absolute paths