A sharable eslint configuration with react and testing defaults.
Includes a base config and configs for react and testing with @testing-library/react and vitest.
To use the base config, install the config as well as it's dependencies:
yarn add -D \
@imccausl/eslint-config \
eslint \
prettier \
eslint-config-prettier \
eslint-plugin-prettier \
eslint-plugin-import-x \
eslint-import-resolver-typescript \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser
If you'd like to use the react config, include the following dependencies:
yarn add -D \
@tanstack\eslint-plugin-query \
eslint-plugin-react \
eslint-plugin-react-hooks
And for the testing config, include these dependencies:
yarn add -D \
@vitest/eslint-plugin \
@typescript-eslint/utils \
eslint-plugin-testing-library
Version 3+ uses the eslint flat config. You can set it up like this:
import eslintConfig from '@imccausl/eslint-config'
export default [
...eslintConfig
// other configs
]
If you are using earlier verisons of eslint, or are not yet ready for the flat config, you can continue to use version 2 (it won't be getting anymore updates though).
There are exports for base, react and testing which can be imported separately:
import reactEslintConfig from '@imccausl/eslint-config/react'
import testingEslintConfig from '@imcccausl/eslint-config/testing'
export default [
...reactEslintConfig,
...testingEslintConfig,
]