@fullhaus/eslint-config
v0.4.0
Published
Default ESLint configuration for FULLHAUS projects.
Keywords
Readme
FULLHAUS ESLint configuration
This repository contains the ESLint configuration used for projects maintained by FULLHAUS. It provides a comprehensive set of ESLint rules configurations for modern flat setups (ESLint v9+).
Installation
You can install the FULLHAUS ESLint configuration using a package manager of your choice:
pnpm add @fullhaus/eslint-config --save-devUsage
Flat config
For projects using the flat configuration, you can use following setup:
import fhEslint from '@fullhaus/eslint-config';
export default [
...fhEslint.configs.default,
];[!WARNING] The TypeScript config includes the
prefer-nullish-coalescingrule which requiresstrictNullChecksto be enabled in yourtsconfig.json
Legacy config
This package no longer supports legacy ESLint (v8) configurations. If you still rely on the legacy setup, you can use @fullhaus/[email protected], but note that its rules are no longer maintained or up to date.
Custom Configurations
In case your project requires specific configurations (for example, a JavaScript-only codebase or just stylistic rules), you can selectively extend the configurations you need.
import fhEslint from '@fullhaus/eslint-config';
export default [
...fhEslint.configs.baseConfig, // js only
...fhEslint.configs.stylisticConfig, // stylistic only
];React
For React projects, you can extend your ESLint configuration with React-specific rules.
import fhEslint from '@fullhaus/eslint-config';
export default [
...fhEslint.configs.default,
...fhEslint.configs.reactConfig,
// or when using React with TypeScript (.tsx):
...fhEslint.configs.typedReactConfig,
];Frameworks
Frameworks (like Next.js) come with their own ESLint configuration, which can lead to plugin conflicts. To prevent these issues, our configuration provides all necessary rules. Here’s an example setup for a Next.js project:
// example using next.js
import fhEslint from '@fullhaus/eslint-config';
export default [
...compat.extends('next/core-web-vitals'),
...fhEslint.configs.default,
{
rules: fhEslint.rules.typedReactRules,
},
];[!NOTE] Adjust the usage of
compat.extendsas required by your project’s setup.
Available Configurations and Rules
The FULLHAUS ESLint Configuration package provides a modular set of configurations and rules designed to accommodate different project needs. Below is a list of the available options:
Configurations
| Config | Description |
|--------------------|---------------------------------------------|
| default | The full recommended configuration |
| baseConfig | JavaScript-focused configuration |
| stylisticConfig | Stylistic rules for code consistency |
| reactConfig | Contains React-specific ESLint rules |
| typedReactConfig | React configuration for TypeScript projects |
| typescriptConfig | TypeScript-focused configuration |
| unicornConfig | Opinionated JS code style configuration |
| importConfig | Configuration for best practice imports |
Rules
| Rule Name | Description |
|-------------------|----------------------------------|
| baseRules | Rules for JavaScript |
| commentsRules | Rules for ESLint comments |
| reactRules | Rules for React |
| stylisticRules | Rules for code styling |
| typedReactRules | Rules for React using TypeScript |
| typescriptRules | Rules for TypeScript |
| unicornRules | Rules for extended code styles |
| importRules | Rules for best practice imports |
Feel free to mix and match these configurations and rules to best suit your project’s requirements.
License
This project is licensed under the MIT License. See the LICENSE file for details.
