4.1.0 • Published 5 months ago

@pplancq/eslint-config v4.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@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-config

Usage

Automatic Configuration

To enable the default configuration automatically, use the following command:

npx init-eslint-config

Manual 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.

OptionDefaultDescription
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)
enableReactfalseEnables rules for React and Testing Library files
enableVitestfalseEnables rules for Vitest files
enableJestfalseEnables rules for Jest files
enablePlaywrightfalseEnables 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-prettier

Migration

If you are upgrading from version 3 to version 4 of @pplancq/eslint-config, please refer to the Migration Guide for detailed instructions.

4.0.19

7 months ago

4.0.9

10 months ago

4.0.8

10 months ago

4.0.21

6 months ago

4.0.20

7 months ago

4.0.23

6 months ago

4.0.22

6 months ago

4.0.25

5 months ago

4.0.24

6 months ago

4.0.5

11 months ago

4.0.4

11 months ago

4.0.10

9 months ago

4.0.7

10 months ago

4.0.6

10 months ago

4.1.0

5 months ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.3

12 months ago

4.0.2

12 months ago

4.0.16

8 months ago

4.0.15

8 months ago

4.0.18

7 months ago

4.0.17

8 months ago

4.0.12

9 months ago

4.0.11

9 months ago

4.0.14

8 months ago

4.0.13

8 months ago

3.0.1

1 year ago

3.0.0

1 year ago

2.3.0

1 year ago

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago