@ethberry/eslint-config
v6.0.3
Published
This is sharable ESLint config which we use across of all our repositories. It is amazing.
Readme
ESLint config
This is sharable ESLint config which we use across of all our repositories. It is amazing.
Requirements
- ESLint 10 and Node.js supported by ESLint 10 (this package declares
engines.node>=22.13.0). - Flat config only —
.eslintrc/ESLINT_USE_FLAT_CONFIG=falseare not supported in ESLint 10.
Prettier at lint time
Presets include eslint-plugin-prettier (prettier/prettier as error) plus eslint-config-prettier so formatting rules do not fight Prettier. Run eslint --fix (this repo’s npm run lint) to apply Prettier’s output. Add a Prettier config in consuming projects when you need options beyond defaults.
ESLint 10 notes for consumers
- Config lookup starts from each linted file’s directory and walks up (not from the current working directory). In monorepos, put an
eslint.config.*in each package or pass--configexplicitly when needed. eslint:recommendedenablesno-unassigned-vars,no-useless-assignment, andpreserve-caught-error. Fix new findings or turn rules off in your overlay config if you need stricter control.- Remove
/* eslint-env … */comments; ESLint 10 reports them as errors. UselanguageOptions.globals(e.g. from theglobalspackage) instead. - Type-checked TypeScript (
recommendedTypeCheckedin this preset): merge a block that sets parser options, for example:
import {defineConfig} from "eslint/config";
import typescriptRules from "./presets/ts.mjs"; // or your path to this preset
export default defineConfig([
...typescriptRules,
{
files: ["**/*.{ts,mts,tsx,mtsx}"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
]);Usage
eslint.config.mjs
import {defineConfig} from "eslint/config";
import typescriptRules from "./presets/tsx.mjs";
export default defineConfig([...typescriptRules]);