@letumfalx/eslint-config
v0.2.0
Published
Shared ESLint configurations and rulesets.
Readme
@letumfalx/eslint-config
An opinionated ESLint configuration that I use across all @letumfalx repositories. It emphasizes modern TypeScript best practices, strict code quality rules, and consistent formatting while remaining easy to adopt.
Built for ESLint Flat Config (eslint.config.js).
📦 Installation
Install the package alongside ESLint in your project. Since this config bundles necessary plugins as dependencies or peer dependencies, you only need to run:
# npm
npm install -d eslint @letumfalx/eslint-config
# bun
bun add -d eslint @letumfalx/eslint-config
# pnpm
pnpm add -d eslint @letumfalx/eslint-config🚀 Usage
Create an eslint.config.js file on your project and import the configuration.
import { coreConfig, globalsConfig } from "@letumfalx/eslint-config";
import { globalIgnores } from "eslint/config";
export default [
globalIgnores(["**/node_modules/**", "**/dist/**"]),
...coreConfig({
// the `@eslint/js` config to use
js: "recommended", // default
// the `typescript-eslint` config to use
ts: "recommended", // default
// your opinionated rule overrides, if given, this will be used instead of the
// default overrides that I use
rules: {
"no-console": "warn",
},
// the additional paths to lint that is not implicitly included on the `tsconfig.json` file
// for more info, see https://typescript-eslint.io/packages/parser#allowdefaultproject
allowDefaultProjectPaths: ["eslint.config.mjs"], // no defaults, will not add if not given
// the absolute directory where the root `tsconfig.json` file is located, use this
// if the parser cannot find the right `tsconfig.json` file of your project
tsconfigRootDir: import.meta.dirname, // no defaults, will not add if not given
}),
// adds globals to your config
globalsConfig(["browser"]),
globalsConfig(["worker"], { files: ["workers/**/*.ts"] }),
// add your additional config overrides here
{
// add your additional rule overrides here if you want to use the default overrides + additional one
rules: {
"no-console": "error",
},
},
];For the default rules value, you can check CORE_CONFIG_RULE_OVERRIDES to what rules are overriden.
