Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcamp-code/eslint-config
My preferred ES Lint / Prettier Setup - Extends @antfu's configuration
https://github.com/jcamp-code/eslint-config
Last synced: 23 days ago
JSON representation
My preferred ES Lint / Prettier Setup - Extends @antfu's configuration
- Host: GitHub
- URL: https://github.com/jcamp-code/eslint-config
- Owner: jcamp-code
- License: mit
- Created: 2022-08-14T01:37:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-04T09:50:43.000Z (23 days ago)
- Last Synced: 2024-12-04T10:37:18.071Z (23 days ago)
- Language: TypeScript
- Size: 354 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @jcamp/eslint-config
This is my personal ESLint Config.
It extends [@antfu](https://github.com/antfu)'s [eslint-config](https://github.com/antfu/eslint-config).
It starts with his vue config and makes these changes:
- Uses only the vue config, omitting react
- Adds my Prettier config
- Adds the official TailwindCSS Prettier plugin
- Disables the antfu/if-newline rule as it will clash with Prettier
- Follows Prettier's [recommended configuration](https://prettier.io/docs/en/integrating-with-linters.html) with ESLint:
- It only integrates the [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) to disable conflicting rules
- It does not integrate the [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) to show the Prettier rules as ESLint warnings.## Usage
Note v2.0.0 is a breaking change, requires adjusting your setup.
For more eslint config details, see [@antfu/eslint-config]()
### Install
```bash
pnpm add -D eslint prettier @jcamp/eslint-config
```### Config `eslint.config.js`
```js
import { jcamp } from '@jcamp/eslint-config'export default jcamp(
// antfu options
{},
// additional rules to add
{},
// ignores
{
ignores: ['temp.js', '**/vendor/*.js'],
}
)
```> `.eslintignore` is no longer supported by [eslint flatconfig](https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores).
### Config `.prettierrc.js`
```js
import { jcPrettier } from '@jcamp/eslint-config'export default {
...jcPrettier,
/* make any changes here */
singleAttributePerLine: false,
}
```### Add script for package.json
For example:
```json
{
"scripts": {
"lint": "eslint .",
"fix": "eslint . --fix",
"format": "prettier . --check",
"clean": "prettier . --write"
}
}
```### Config VS Code auto fix
Create `.vscode/settings.json`
```json
{
"prettier.enable": true,
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never"
}
}
```## License
[MIT](./LICENSE) License © 2023-PRESENT [John Campion](https://github.com/JohnCampionJr/)