@mobilejazz/eslint-config v1.0.3
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
- Remove existing
.eslintrc.*
file, if present. Install
eslint
and the config.npm install -D eslint @mobilejazz/eslint-config
Install all the needed dependencies from this library
npx install-peerdeps --dev @mobilejazz/eslint-config
Add the lint configuration that you need to your
package.json
,javascipt
,typescript
orangular
:"eslintConfig": { "extends": "@mobilejazz/eslint-config/angular" }
With Prettier and @mobilejazz/prettier-config
- Set up Prettier and
@mobilejazz/prettier-config
. When using with Prettier and
@mobilejazz/prettier-config
, ESLint should run first. Set up your scripts inpackage.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 complainnpm run format
: attempt to autofix lint issues and autoformat code
:memo: 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
- Follow the same strategy as Ionic
eslint-config
- Or, use
lint-staged
as suggested by PrettierProbably we should use
lint-staged
as we're already using that in other projects.
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago