!actionsactions-badge
!versionversion-badgepackage !downloadsdownloads-badgenpmtrends
!Code Coveragecoverage-badgecoverage
!semantic-releasesemantic-release-badgesemantic-release
!code style: prettierprettier-badgeprettier
Add
This can be overridden exactly the same as the eslint-import-resolver-webpackeslint-import-resolver-webpack configuration.
@comparto/eslint-config
This package provides a shareable ESLint configuration with rules for react, typescript, javascript, jest, and @testing-library.Usage:
This will enablejest
, react
, typescript
or @testing-library
rules if their respective dependency exists.- Install stuff:
```sh
npx install-peerdeps --dev @comparto/eslint-config
```
or if you wish this to be a common dependency in a yarn workspaces monorepo:
```sh
# -Y --yarn, -x --extra-args, -W --ignore-workspace-root-check
npx install-peerdeps @comparto/eslint-config --dev -Y -x -W
```
- Add
"extends": "@comparto/eslint-config"
to your.eslintrc
Prettier:
yarn add -D @comparto/prettier-config
Add
"prettier": "@comparto/prettier-config"
to your package.json
or any configurationprettier-config of your choice.Using webpack aliases?
This config uses eslint-import-resolver-webpackeslint-import-resolver-webpack with a default setting of:settings:
import/resolver:
webpack:
config: 'webpack.dev.config.js' # or {} if not found
This can be overridden exactly the same as the eslint-import-resolver-webpackeslint-import-resolver-webpack configuration.
Using typescript?
This config uses some rules that require type information like naming-conventionts-eslint-naming-conventions-so, so@typescript-eslint/parser
's parserOptions.projecteslint-parser-options is set to "./tsconfig.json"
. Override this value if your tsconfig.json
is located somewhere else.