Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thoughtbot/eslint-config
A sharable ESLint configuration that enforces thoughtbot’s JavaScript guides.
https://github.com/thoughtbot/eslint-config
code-quality eslint eslintconfig javascript js
Last synced: about 2 months ago
JSON representation
A sharable ESLint configuration that enforces thoughtbot’s JavaScript guides.
- Host: GitHub
- URL: https://github.com/thoughtbot/eslint-config
- Owner: thoughtbot
- License: mit
- Created: 2019-07-28T15:09:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-04T15:46:15.000Z (4 months ago)
- Last Synced: 2024-10-05T21:45:14.868Z (3 months ago)
- Topics: code-quality, eslint, eslintconfig, javascript, js
- Language: JavaScript
- Homepage: https://thoughtbot.com
- Size: 138 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# thoughtbot ESLint Config
Batteries-included sharable [ESLint][eslint] configurations for React, React
Native, TypeScript, and Node.js that enforce [thoughtbot’s JavaScript
guides][thoughtbot-js-guides]. These configurations are largely based off of and
compatible with [AirBnb’s ESLint config][airbnb-config].[eslint]: https://eslint.org/
[thoughtbot-js-guides]: https://github.com/thoughtbot/guides/tree/main/javascript
[airbnb-config]: https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb## Installation
If using **npm**, run:
```bash
npm install @thoughtbot/eslint-config --save-dev
```If using **Yarn**, run:
```bash
yarn add @thoughtbot/eslint-config --dev
```## Usage
This package includes configurations for most common tech stacks. Update your [ESLint configuration][eslint-configuration] to extend the appropriate setup:
- `@thoughtbot/eslint-config` - React web, Jest, Testing Library, Prettier
- `@thoughtbot/eslint-config/react` - React web (same as above)
- `@thoughtbot/eslint-config/base` - base web config, no React or Prettier
- `@thoughtbot/eslint-config/native` - React Native, Jest, RN Testing Library, Prettier
- `@thoughtbot/eslint-config/prettier` - Prettier, automatically used when using React or Native config
- `@thoughtbot/eslint-config/typescript` - TypeScript config, add this if using TypescriptThe configurations that include Prettier turn off all formatting rules that are also handled by Prettier to reduce conflicts between the two tools. It is recommended to add Prettier to your project and ensure that your CI environment also runs Prettier to verify code formatting.
### Example usage:
Following are some example usages of this config (eg. in `.eslintrc.js`).
React with TypeScript:
```json
{
"extends": [
"@thoughtbot/eslint-config",
"@thoughtbot/eslint-config/typescript"
]
}
```React Native with TypeScript:
```json
{
"extends": [
"@thoughtbot/eslint-config/native",
"@thoughtbot/eslint-config/typescript"
]
}
```Base web without React or TypeScript
```json
{
"extends": ["@thoughtbot/eslint-config/base"]
}
```You can override rules from the shared configuration, by setting your
own values within the `rules` property:```json
{
"extends": "@thoughtbot/eslint-config",
"rules": {
"react/jsx-newline": "warn"
}
}
```You might also need to add the following to your ESLint config if you get an error about Jest not being able to detect the version:
```json
{
"settings": {
"jest": { "version": "detect" }
}
}
```Consult the [ESLint documentation][eslint-configuration] for more information about configuring ESLint, and take a look at the config files in this repo for more information about the rules and plugins they include.
[eslint-configuration]: https://eslint.org/docs/user-guide/configuring
## License
thoughtbot ESLint Config is copyright (c) 2023 thoughtbot, inc.
It is free software, and may be redistributed under the
terms specified in the [LICENSE] file.[LICENSE]: /LICENSE.md
## About thoughtbot
![thoughtbot](https://thoughtbot.com/thoughtbot-logo-for-readmes.svg)
This repo is maintained and funded by thoughtbot, inc.
The names and logos for thoughtbot are trademarks of thoughtbot, inc.We love open source software!
See [our other projects][community].
We are [available for hire][hire].[community]: https://thoughtbot.com/community?utm_source=github
[hire]: https://thoughtbot.com/hire-us?utm_source=github