This repository contains the ESLint configuration used across products at Feedzai. We share this configuration to promote the use of linters in JavaScript and to share our conventions and best practices in the hope of inspiring others when defining their configurations.
This repo includes two distinct ESLint configurations:
-
@feedzai/eslint-config-feedzai
- This configuration contains our ESLint rules, including the ones for ECMAScript 6+. If you're using React in your projects please check the@feedzai/eslint-config-feedzai-react
. This packages requireseslint
andeslint-plugin-import
. -
@feedzai/eslint-config-feedzai-react
- This configuration extends the@feedzai/eslint-config-feedzai
and includes the rules for React, a11y and Jest. This package requireseslint
,@feedzai/eslint-config-feedzai
,eslint-plugin-import
,eslint-plugin-jest
,eslint-plugin-jsx-a11y
andeslint-plugin-react
.
In order to list the correct versions of each package you could use this command:
npm info "@feedzai/eslint-config-feedzai@latest" peerDependencies
After this command, you can install those packages manually or if you're using the npm version > 5 you could use this shortcut:
npx install-peerdeps --dev @feedzai/eslint-config-feedzai-react
If you want to do all manually you should use:
npm install --save-dev @feedzai/eslint-config-feedzai eslint@^#.#.# eslint-plugin-import@^#.#.#
or :
npm install --save-dev @feedzai/eslint-config-feedzai-react eslint@^#.#.# @feedzai/eslint-config-feedzai@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-jest@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-react@^#.#.#
Add "extends": "@feedzai/eslint-config-feedzai"
for JavaScript projects or "extends": "@feedzai/eslint-config-feedzai-react"
for React projects to your .eslintrc
file.
You can check if those packages follow our coding style conventions by using npm run lint
in the root folder of each package.
The available commands are:
deploy:major
- creates a git tag and publish the X.0.0 version. This command should be executed only in themaster
branch.deploy:minor
- creates a git tag and publish the X.Y.0 version. This command should be executed in the hot-fix branches (hf-X.x.x
).deploy:patch
- creates a git tag and publish the X.Y.Z version. This command should be executed in the hot-fix branches (hf-X.x.x
).