Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imccausl/eslint-config
Sharable eslint config with reasonable defaults
https://github.com/imccausl/eslint-config
eslint eslint-config eslintrc react testing-library vitest
Last synced: 7 days ago
JSON representation
Sharable eslint config with reasonable defaults
- Host: GitHub
- URL: https://github.com/imccausl/eslint-config
- Owner: imccausl
- License: mit
- Created: 2024-02-12T02:49:25.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-23T20:29:47.000Z (5 months ago)
- Last Synced: 2024-09-29T01:20:16.368Z (5 months ago)
- Topics: eslint, eslint-config, eslintrc, react, testing-library, vitest
- Language: TypeScript
- Homepage:
- Size: 1.28 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-config
[](https://github.com/semantic-release/semantic-release)
[](https://github.com/imccausl/eslint-config/actions/workflows/ci.yml)A sharable eslint configuration with react and testing defaults.
## Usage
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:
```bash
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:
```bash
yarn add -D \
@tanstack\eslint-plugin-query \
eslint-plugin-react \
eslint-plugin-react-hooks
```And for the testing config, include these dependencies:
```bash
yarn add -D \
@vitest/eslint-plugin \
@typescript-eslint/utils \
eslint-plugin-testing-library
```### Flat Config
Version 3+ uses the eslint flat config. You can set it up like this:
```js
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).
#### Using parts of the config
There are exports for base, react and testing which can be imported separately:
```js
import reactEslintConfig from '@imccausl/eslint-config/react'
import testingEslintConfig from '@imcccausl/eslint-config/testing'
export default [
...reactEslintConfig,
...testingEslintConfig,
]
```