@ialexanderbrito/eslint-config
v2.2.0
Published
ESLint configuration used by ALX.
Downloads
42
Readme
ALX ESLint Config
Shareable ESLint 9 flat config for Node.js, React, and Next.js projects.
English
✨ Features
- ⚡ ESLint 9 with Flat Config support
- 📘 TypeScript first-class support
- ⚛️ React & React Hooks plugins
- ♿ JSX A11y for accessibility rules
- 🎨 Prettier integration
- 📦 Import ordering with automatic sorting
- ▲ Next.js optimized configuration
📦 Installation
# npm
npm install -D eslint @ialexanderbrito/eslint-config
# yarn
yarn add -D eslint @ialexanderbrito/eslint-config
# pnpm
pnpm add -D eslint @ialexanderbrito/eslint-config🚀 Usage
Create an eslint.config.mjs file in your project root:
Node.js / TypeScript
import alxConfig from '@ialexanderbrito/eslint-config/node';
export default [...alxConfig];React
import alxConfig from '@ialexanderbrito/eslint-config/react';
export default [...alxConfig];Next.js
import alxConfig from '@ialexanderbrito/eslint-config/next';
export default [...alxConfig];⚙️ Customization
Add your own rules after spreading the configuration:
import alxConfig from '@ialexanderbrito/eslint-config/react';
export default [
...alxConfig,
{
rules: {
// your custom rules here
},
},
];🔄 Migration from v2 to v3
ESLint 9 introduced the new "Flat Config" format. Here are the main changes:
- Rename
.eslintrc.jsonor.eslintrc.jstoeslint.config.mjs - Configuration format changed from object to array
- No more
extendsproperty - use spread operator instead
Before (v2):
{
"extends": "@ialexanderbrito/eslint-config/react"
}After (v3):
import alxConfig from '@ialexanderbrito/eslint-config/react';
export default [...alxConfig];Português
✨ Funcionalidades
- ⚡ ESLint 9 com suporte a Flat Config
- 📘 TypeScript suporte completo
- ⚛️ Plugins React e React Hooks
- ♿ JSX A11y para regras de acessibilidade
- 🎨 Integração com Prettier
- 📦 Ordenação de imports automática
- ▲ Configuração otimizada para Next.js
📦 Instalação
# npm
npm install -D eslint @ialexanderbrito/eslint-config
# yarn
yarn add -D eslint @ialexanderbrito/eslint-config
# pnpm
pnpm add -D eslint @ialexanderbrito/eslint-config🚀 Como usar
Crie um arquivo eslint.config.mjs na raiz do seu projeto:
Node.js / TypeScript
import alxConfig from '@ialexanderbrito/eslint-config/node';
export default [...alxConfig];React
import alxConfig from '@ialexanderbrito/eslint-config/react';
export default [...alxConfig];Next.js
import alxConfig from '@ialexanderbrito/eslint-config/next';
export default [...alxConfig];⚙️ Personalização
Adicione suas próprias regras após o spread da configuração:
import alxConfig from '@ialexanderbrito/eslint-config/react';
export default [
...alxConfig,
{
rules: {
// suas regras personalizadas aqui
},
},
];🔄 Migração da v2 para v3
O ESLint 9 introduziu o novo formato "Flat Config". Principais mudanças:
- Renomeie
.eslintrc.jsonou.eslintrc.jsparaeslint.config.mjs - O formato mudou de objeto para array
- Não existe mais a propriedade
extends- use spread operator
Antes (v2):
{
"extends": "@ialexanderbrito/eslint-config/react"
}Depois (v3):
import alxConfig from '@ialexanderbrito/eslint-config/react';
export default [...alxConfig];📄 License
MIT © Alexander Brito
