@sergiogc9/eslint-config
v2.0.0
Published
Eslint personal config (flat config)
Maintainers
Readme
Personal ESLint config using the modern flat config format (ESLint 9+).
Table of contents
Configurations available
Every configuration is a flat-config array meant to be spread into your eslint.config.js. Always start with base.
base: TypeScript + JavaScript recommended rules,eslint-commentsrules, personal tweaks and Prettier compatibility (formatting rules are turned off so Prettier can own formatting).react: React and React Hooks rules plusjsx-a11y. Uses the new JSX transform (no need to import React in scope).jest: rules for projects that still use Jest. Scoped to test files.vitest: rules for projects using Vitest. Scoped to test files.
They are exposed both as named exports and as subpath exports:
import sergio from '@sergiogc9/eslint-config'; // { base, react, jest, vitest }
// or
import base from '@sergiogc9/eslint-config/base';
import react from '@sergiogc9/eslint-config/react';Installation
All plugins ship as dependencies of this package, so you only need this package and ESLint itself:
pnpm add -D @sergiogc9/eslint-config eslintUsage
Create an eslint.config.js file and compose the configurations you need.
Node / library project (with Vitest):
import sergio from '@sergiogc9/eslint-config';
export default [...sergio.base, ...sergio.vitest, { ignores: ['dist'] }];React project:
import sergio from '@sergiogc9/eslint-config';
export default [...sergio.base, ...sergio.react];Everything together:
import sergio from '@sergiogc9/eslint-config';
export default [...sergio.base, ...sergio.react, ...sergio.vitest];Prettier runs separately (this config only disables conflicting rules). Keep using
prettier --check ./prettier --write .in your scripts.
