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

https://github.com/totominc/eslint-config-next

An enhanced ESLint config for Next.js with Airbnb + TypeScript + Prettier + TailwindCSS support.
https://github.com/totominc/eslint-config-next

airbnb-eslint eslint eslint-config nextjs prettier prettier-eslint tailwindcss

Last synced: 7 months ago
JSON representation

An enhanced ESLint config for Next.js with Airbnb + TypeScript + Prettier + TailwindCSS support.

Awesome Lists containing this project

README

          

# eslint-config-next

## Installation

```bash
npm i -D @totominc/eslint-config-next eslint
```

Create `eslint.config.js` in the root of your project:

```js
import { totominc } from "@totominc/eslint-config-next";

export default totominc();
```

Add scripts to your `package.json`:

```json
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
```

Add VSCode settings to your `.vscode/settings.json`:

```json
{
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "prettier/prettier", "severity": "off", "fixable": true },
{ "rule": "style/*", "severity": "off", "fixable": true },
{ "rule": "format/*", "severity": "off", "fixable": true },
{ "rule": "*-indent", "severity": "off", "fixable": true },
{ "rule": "*-spacing", "severity": "off", "fixable": true },
{ "rule": "*-spaces", "severity": "off", "fixable": true },
{ "rule": "*-order", "severity": "off", "fixable": true },
{ "rule": "*-dangle", "severity": "off", "fixable": true },
{ "rule": "*-newline", "severity": "off", "fixable": true },
{ "rule": "*quotes", "severity": "off", "fixable": true },
{ "rule": "*semi", "severity": "off", "fixable": true }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"gql",
"graphql",
"astro",
"svelte",
"css",
"less",
"scss",
"pcss",
"postcss"
]
}
```