@snowyyd/eslint-config
v2.2.5
Published
Personal TypeScript ESLint configs
Downloads
38
Readme
eslint-config-x
eslint-config-x is a modern, modular ESLint configuration inspired by the widely-used Airbnb style guide, rewritten entirely using FlatConfig — the new configuration format introduced in ESLint v9.
This package offers optional TypeScript support, a handful of well curated extra configurations, as well as a personal config.
✨ Why use this?
- 📦 FlatConfig ready — designed for ESLint v9+
- 🧼 Airbnb base rules — familiar, community-tested style
- ✨ Airbnb-style, modernized — no more deprecated rules
- 🧠 Optional TypeScript support — no assumptions about your stack
- 🧩 Use only what you need — configurations are exported individually and can be composed freely
- 🚧 Includes my very personal config — for advanced tinkering (not for public use)
[!IMPORTANT]
Looking for a more faithful Airbnb FlatConfig conversion?
If you landed here expecting a closer 1:1 conversion of the original
eslint-config-airbnb-base(including legacy or deprecated rules), this config may not be what you're looking for — it makes modernizing decisions and drops outdated patterns.Instead, check out these alternatives:
- https://github.com/claabs/eslint-config-airbnb-typescript-x
- https://github.com/Kenneth-Sills/eslint-config-airbnb-typescript
- The
v1branch of this repository is based on the @claabs's implementation (this repository was a fork).
🚀 Quick Start
[!TIP] Please verify that your package manager correctly installs the “peerDependencies”.
- First, install eslint if it's not yet installed (locally or globally).
npm install -save-dev eslint- Then, install the package as a development dependency.
npm install --save-dev @snowyyd/eslint-config- Create an ESLint config file
eslint.config.mjsin the root folder of your project. You can use the following as an example:
// @ts-check
/* eslint-disable import-x/no-extraneous-dependencies */
import { configs } from '@snowyyd/eslint-config';
import tseslint from 'typescript-eslint';
export default tseslint.config(
configs.recommended,
configs.esm,
{
ignores: ['dist/**'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
);🍉 Exported presets
Each preset is conveniently exported in a “configs” object, as well as part of the default export.
import { configs } from '@snowyyd/eslint-config';
import configX from '@snowyyd/eslint-config'; // access configs on configsX.configsThe list of presets includes:
recommended: The main preset for this project. It includes all the Airbnb rules, as well as the recommended eslint, typescript-eslint, recommended typed linting and stylistic presets.esm: Extra rules for ESM projects.airbnb: Airbnb configuration exported for convenience, without any additions (only with updated rules).airbnbTs: The Airbnb configuration with fully TypeScript support.personal: My personal rules that I usually apply over the Airbnb ones.typescript: The recommended typescript-eslint rules (with typed linting and stylistic type linting).
The recommended preset extends the rules in the following order: airbnbTs > eslint-recommended > typescript > personal.
TypeScript rules are only used in compatible files, so this configuration is perfectly safe for JavaScript projects.
In the recommended preset my personal rules takes precedence over the recommended ones. Likewise, those rules take priority over the Airbnb ones. This means that Airbnb settings serve as a base, the recommended settings build on top of them, and finally my personal preferences are applied last.
[!NOTE] Please note that some presets expect to be loaded after others.
For example,personalexpects thatairbnbTsandtypescriptwere loaded earlier.While the presets are independent, the rules themselves may not make sense separately.
📝 Changelog
Read the commits for a comprehensive list of changes.
👍 Acknowledgements
- Airbnb - Base config.
- Matt Turnbull - Base Airbnb TS.
- Charlie Laabs - Airbnb TS fork.
📜 License
Licensed under MIT License.
