-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
87 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,95 @@ | ||
# eslint-config | ||
|
||
An ESLint shareable config for JavaScript/TypeScript ecosystem's. | ||
[![npm version](https://badge.fury.io/js/%40msobiecki%2Feslint-config.svg)](https://badge.fury.io/js/%40msobiecki%2Feslint-config) | ||
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/msobiecki/eslint-config/blob/master/LICENSE) | ||
|
||
// BASE | ||
// base + best-practice | ||
> Custom ESLint configuration for projects. It extends popular Airbnb ESLint config and other popular configs in one place. | ||
// REACT | ||
// react | ||
// react-jsx | ||
## Installation | ||
|
||
// NEXT | ||
// next | ||
```bash | ||
npm install --save-dev @msobiecki/eslint-config | ||
``` | ||
|
||
// BASE JEST | ||
// base jest | ||
## Usage | ||
|
||
// DOM JEST | ||
// base jest + dom jest | ||
To use this ESLint configuration, you need to extend it in your project's `.eslintrc` file: | ||
|
||
// REACT JEST | ||
// base jest + react jest | ||
### base javascript/typescript configuration | ||
|
||
```json | ||
{ | ||
"extends": "@msobiecki/eslint-config" | ||
} | ||
``` | ||
|
||
### react javascript/typescript configuration | ||
|
||
```json | ||
{ | ||
"extends": [ | ||
"@msobiecki/eslint-config/react", | ||
"@msobiecki/eslint-config/react-jsx" | ||
] | ||
} | ||
``` | ||
|
||
### next configuration | ||
|
||
```json | ||
{ | ||
"extends": ["@msobiecki/eslint-config/next"] | ||
} | ||
``` | ||
|
||
### jest configuration | ||
|
||
```json | ||
# base | ||
{ | ||
"extends": [ | ||
"@msobiecki/eslint-config/jest" | ||
] | ||
} | ||
|
||
# dom | ||
{ | ||
"extends": [ | ||
"@msobiecki/eslint-config/jest" | ||
"@msobiecki/eslint-config/jest-dom" | ||
] | ||
} | ||
|
||
# react | ||
{ | ||
"extends": [ | ||
"@msobiecki/eslint-config/jest" | ||
"@msobiecki/eslint-config/jest-react" | ||
] | ||
} | ||
``` | ||
|
||
If you have an existing ESLint configuration, you can merge it with this configuration using the `extends` property: | ||
|
||
```json | ||
{ | ||
"extends": ["@msobiecki/eslint-config", "your-existing-config"] | ||
} | ||
``` | ||
|
||
Make sure to install the necessary peer dependencies as well: | ||
|
||
- `eslint` | ||
- `prettier` | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! If you find any issues or have suggestions, please open an issue or submit a pull request. | ||
|
||
Before submitting a pull request, please make sure to: | ||
|
||
1. Run `lintstage` to ensure your changes adhere to the ESLint rules. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |