eslint-config-hubside v1.2.0
eslint-config-hubside
This package provides Hubside's extensible eslint config files.
Usage
Several config files are available in this package:
eslint-config-hubside
eslint-config-hubside/i18n
eslint-config-hubside/react
eslint-config-hubside/typescript
eslint-config-hubside/typescript-migration
eslint-config-hubside/jest
The first one is the base required config in order to use any of the other configs.
The other ones are "pluggable" configs, so you can choose the one(s) you need and combine them. If your project uses Typescript however, either choose typescript
or typescript-migration
.
You'll find eslint-config-hubside/i18n-formatter
too, a re-export for eslint-plugin-i18n-json
's eslint formatter.
eslint-config-hubside
This is the base config. It is required in order to use any of the other hubside eslint configs. Make sure you put it before the others in your config file extends
field.
Install all
peerDependencies
listed inpackage.json
Install
eslint-config-airbnb-base
if you're not usingeslint-config-hubside/react
,eslint-config-airbnb
otherwise (seeoptionalDependencies
listed inpackage.json
)Add
"extends": "hubside"
to your.eslintrc
eslint-config-hubside/i18n
This brings extra config for projects with i18n json files.
Install dependencies as described for the base config
Install the following optional dependency:
eslint-config-i18n-json
Add
"extends": ["hubside", "hubside/i18n"]
to your.eslintrc
As the error messages from
eslint-config-i18n-json
need a special formatter, you can use the re-export fromeslint-config-hubside
in the eslint--format
option as follows :
eslint --ext .json --format node_modules/eslint-config-hubside/i18n-formatter.js
eslint-config-hubside/react
This brings extra config for react projects.
Install dependencies as described for the base config
Install the following optional dependencies:
eslint-config-airbnb
,eslint-plugin-react-hooks
Add
"extends": ["hubside", "hubside/react"]
to your.eslintrc
eslint-config-hubside/typescript
Use this config in a Typescript project. If your project is migrating to Typescript but is not quite fully migrated yet, use eslint-config-hubside/typescript-migration
instead.
Install dependencies as described for the base config
Install the following optional dependencies:
@typescript-eslint/eslint-plugin
,@typescript-eslint/parser
Add
"extends": ["hubside", "hubside/typescript"]
to your.eslintrc
eslint-config-hubside/typescript-migration
Use this config in a project which is being migrated to Typescript but is not fully migrated yet. If your project is already fully written in Typescript, use eslint-config-hubside/typescript
instead.
To use this config, do everything as described for eslint-config-hubside/typescript
, but add "extends": ["hubside", "hubside/typescript-migration"]
to your .eslintrc
instead.
eslint-config-hubside/jest
Use this config for a project that uses Jest. This is basically a wrapper for eslint-plugin-jest
's recommended config.
Install dependencies as described for the base config
Install the following optional dependency:
eslint-plugin-jest
Add
"extends": ["hubside", "hubside/jest"]
to your.eslintrc