Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
/ eslint-config Public archive

Mobile Jazz ESLint configuration

Notifications You must be signed in to change notification settings

mobilejazz/eslint-config

Repository files navigation

Mobile Jazz ESLint Config

Shared ESLint config used in Mobile Jazz projects.

This is meant to be used alongside Prettier (with @mobilejazz/prettier-config).

Usage

  1. Remove existing .eslintrc.* file, if present.

  2. Install eslint and the config.

    npm install -D eslint @mobilejazz/eslint-config
  3. Install all the needed dependencies from this library

    npx install-peerdeps --dev @mobilejazz/eslint-config
  4. Add the lint configuration that you need to yourpackage.json, javascipt, typescript or angular:

    "eslintConfig": {
      "extends": "@mobilejazz/eslint-config/angular"
    }

With Prettier and @mobilejazz/prettier-config

  1. Set up Prettier and @mobilejazz/prettier-config.

  2. When using with Prettier and @mobilejazz/prettier-config, ESLint should run first. Set up your scripts in package.json something like this:

    "scripts": {
      "lint": "npm run eslint && npm run prettier -- --check",
      "format": "npm run eslint -- --fix && npm run prettier -- --write",
      "prettier": "prettier \"src/**/*.ts\" \"src/**/*.js\" \"src/**/*.html\"",
      "eslint": "eslint \"src/**/*.ts\" \"src/**/*.js\" \"src/**/*.html\"",
    }
    • npm run lint: for checking if ESLint and Prettier complain
    • npm run format: attempt to autofix lint issues and autoformat code

    📝 Not every rule in this configuration is autofixable, so npm run format may continue failing until lint issues are addressed manually.

With Husky

⚠️ REVIEW THIS SECTION

Probably we should use lint-staged as we're already using that in other projects.

About

Mobile Jazz ESLint configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published