@pplancq/eslint-config v4.1.0
@pplancq/eslint-config
This package provides a simplified and customizable ESLint configuration for your React/Node.js applications. Whether you are a beginner or an experienced developer, this package helps you configure ESLint with strict rules to ensure better code structure. Based on Airbnb’s ESLint configuration, it includes additional rules for TypeScript files and test files.
Getting Started
Prerequisites
- Node.js 18.18.0 or higher
Installation
npm install --save-dev eslint@9 @pplancq/eslint-configUsage
Automatic Configuration
To enable the default configuration automatically, use the following command:
npx init-eslint-configManual Configuration
Alternatively, you can create an eslint.config.mjs file in the root of your project:
// eslint.config.mjs
import { defineConfig } from '@pplancq/eslint-config';
export default defineConfig({
enableReact: true,
enableVitest: true,
});Options
The following options can be passed to the defineConfig function. All options are optional. By default, this configuration includes rules for base, import, and TypeScript files.
| Option | Default | Description |
|---|---|---|
| tsFiles | '*/.ts?(x)' | Patterns for TypeScript files |
| unitTestFiles | '*/.{test,spec,steps}.{js,jsx,ts,tsx}' | Patterns for unit test files |
| unitE2eFiles | 'tests/*/.{test,spec}.{js,jsx,ts,tsx}' | Patterns for end-to-end (E2E) test files (ex: Playwright) |
| enableReact | false | Enables rules for React and Testing Library files |
| enableVitest | false | Enables rules for Vitest files |
| enableJest | false | Enables rules for Jest files |
| enablePlaywright | false | Enables rules for Playwright E2E test files |
| enablePrettier | 'off' | 'off' disables Prettier rules'on' enables Prettier rules'disableStyleOnly' enables Prettier rules but disables the 'prettier/prettier' rule, not using Prettier CLI for formatting your code |
| extendConfig | [] | Extends the ESLint configuration |
Prettier Configuration
If you set enablePrettier: 'on', you will need to install the following packages:
npm install --save-dev prettier eslint-plugin-prettierMigration
If you are upgrading from version 3 to version 4 of @pplancq/eslint-config, please refer to the Migration Guide for detailed instructions.
7 months ago
10 months ago
10 months ago
6 months ago
7 months ago
6 months ago
6 months ago
5 months ago
6 months ago
11 months ago
11 months ago
9 months ago
10 months ago
10 months ago
5 months ago
1 year ago
1 year ago
12 months ago
12 months ago
8 months ago
8 months ago
7 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months 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