Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/darenmalfait/eslint-config-daren


https://github.com/darenmalfait/eslint-config-daren

Last synced: 16 days ago
JSON representation

Awesome Lists containing this project

README

        

> ⚠️ **Not maintained**: The package is longer maintained, please use
> [@nerdfish/config](https://github.com/darenmalfait/nerdfish-config) instead.


eslint-config-daren

These are my settings for ESLint and Prettier


You might like them - or you might not. Don't worry you can always change them.


---

[![Build Status][build-badge]][build]
[![version][version-badge]][package]
[![MIT License][license-badge]][license]

## Table of Contents

- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Configuring ESLint, Prettier, and TypeScript Together](#configuring-eslint-prettier-and-typescript-together)
- [Prettier (Formatting)](#prettier-formatting)
- [Eslint (Linting)](#eslint-linting)
- [Other configs](#other-configs)
- [React example](#react-example)

## Installation

This module should be installed as one of your project's `devDependencies`:

```bash
npm install --dev eslint-config-daren
```

```bash
yarn add -D eslint-config-daren
```

```bash
pnpm add -D eslint-config-daren
```

## Configuring ESLint, Prettier, and TypeScript Together

### Prettier (Formatting)

```json
// .vscode/settings.json​
{​
"editor.codeActionsOnSave": {"source.fixAll.eslint": "explicit"},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true​
}
```

```json
// .vscode/extensions.json​
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
```

```js
// prettier.config.js
/** @type {import("prettier").Config} */
module.exports = require('eslint-config-daren/prettier.config.cjs')
```

### Eslint (Linting)

Then add the extends to your .eslintrc.js:

```js
module.exports = {
extends: 'daren',
overrides: {
// your overrides
},
}
```

#### Other configs

You can use other configs in combination with the main eslint.

```js
module.exports = {
extends: ['daren', 'daren/'],
}
```

Or you can extend them like this:

```js
module.exports = {
extends: [
...[
'eslint-config-daren',
'eslint-config-daren/react',
'eslint-config-daren/jsx-a11y',
'eslint-config-daren/tailwind',
].map(config => require.resolve(config)),
],
overrides {
// your overrides
},
}
```

#### React example

```js
module.exports = {
extends: ['daren', 'daren/react', 'daren/jsx-a11y', 'daren/tailwind'],
overrides: {
// your overrides
},
}
```

[npm]: https://www.npmjs.com
[node]: https://nodejs.org
[build-badge]: https://img.shields.io/github/workflow/status/darenmalfait/eslint-config-daren/CI?logo=github&style=flat-square
[build]: https://github.com/darenmalfait/eslint-config-daren/actions?query=workflow
[version-badge]: https://img.shields.io/npm/v/eslint-config-daren.svg?style=flat-square
[package]: https://www.npmjs.com/package/eslint-config-daren
[downloads-badge]: https://img.shields.io/npm/dm/eslint-config-daren.svg?style=flat-square
[license-badge]: https://img.shields.io/npm/l/eslint-config-daren.svg?style=flat-square
[license]: https://github.com/darenmalfait/eslint-config-daren/blob/main/LICENSE