@leandromatos/eslint-config v3.0.0-rc.23
ESlint Config
This package requires ESLint v9 or higher. For older ESLint versions, please use v2.x of this package.
This is a custom and sharable ESLint configuration for TypeScript, JavaScript, and React projects. It includes the following packages:
Core ESLint Packages
- eslint - The core ESLint linting engine
- @eslint/js - ESLint's built-in JavaScript rules and configurations
- @eslint/eslintrc - Compatibility utilities for ESLint configuration formats
TypeScript Support
- typescript - TypeScript compiler and language support
- typescript-eslint - Monorepo for TypeScript ESLint tooling
- @typescript-eslint/parser - ESLint parser for TypeScript code
- @typescript-eslint/eslint-plugin - ESLint rules specific to TypeScript
Code Formatting
- prettier - Opinionated code formatter
- eslint-plugin-prettier - Runs Prettier as an ESLint rule
- eslint-config-prettier - Disables ESLint rules that conflict with Prettier
- prettier-plugin-tailwindcss - Prettier plugin for sorting Tailwind CSS classes
Import Management
- eslint-plugin-import - ESLint plugin for validating imports/exports
- eslint-plugin-simple-import-sort - Auto-sorts imports and exports
React Support
- eslint-plugin-react - ESLint rules for React components
- eslint-plugin-react-hooks - ESLint rules for React Hooks
- eslint-plugin-jsx-a11y - Accessibility linting for JSX elements
Additional Linting
- eslint-plugin-markdownlint - ESLint plugin for Markdown files
Installation
It's crucial to note that you must install the
typescriptpackage, even in a project that uses only JavaScript. This is because ESLint leverages TypeScript to parse the code and provide more accurate error messages.
Use your preferred package manager to install the ESLint configuration:
yarn add --dev eslint typescript @leandromatos/eslint-configYou can use any package manager of your choice (npm, pnpm, bun, etc.)
Configuration
Create a new eslint.config.js file in the root of your project and add the following content:
const { config } = require("@leandromatos/eslint-config")
module.exports = [
...config
]ESM Projects
If you're using ES modules, create an eslint.config.mjs file instead:
import { config } from "@leandromatos/eslint-config"
export default [
...config
]Customization
If you want to override or add additional rules, you can extend the configuration by adding new configuration objects to the array:
const { config } = require("@leandromatos/eslint-config")
module.exports = [
...config,
{
rules: {
"no-unused-vars": "warn",
"prefer-const": "error"
}
}
]Project-specific Configuration
You can also apply different rules to specific file patterns:
const { config } = require("@leandromatos/eslint-config")
module.exports = [
...config,
{
files: ["**/*.test.{js,ts,jsx,tsx}"],
rules: {
"no-console": "off"
}
}
]License
This package is licensed under the MIT License. For more information, see the LICENSE file.
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
11 months ago
7 months ago
1 year ago
1 year ago
7 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago