A shared, ESLint config four our projects - simple, consistent and modern. Inspired by @antfu/eslint-config, tailored for real-world apps and libraries.
- One-line setup for a sensible, opinionated ESLint Flat config.
- Works with JavaScript and TypeScript (TS support is opt-in).
- Opt-in integrations: React, NextJS, Vue, Svelte, Astro, Solid.
- Fixable stylistic rules that play nicely with
eslint --fix, CI andlint-staged. - ESM-first and composable - easy to extend or override.
Note: This preset is opinionated. It aims to reduce bikeshedding and keep diffs small. If you need different choices - override rules locally or fork.
Install preset + eslint in your project:
# pnpm (recommended)
pnpm add -D eslint @maneko/eslint-config
# yarn
yarn add -D eslint @maneko/eslint-config
# npm
npm install -D eslint @maneko/eslint-configWhy install
eslintin the project? The VS Code ESLint extension resolveseslintfrom the project rootnode_modules. Install it in the host project so the editor finds the binary and plugins.
Create eslint.config.mjs in your project root:
import { eslint } from '@maneko/eslint-config';
export default eslint({
// A simple example
jsx: { a11y: true },
react: true
});Minimal preset:
import { eslint } from '@maneko/eslint-config';
export default eslint();import { eslint } from '@maneko/eslint-config';
export default eslint();import { eslint } from '@maneko/eslint-config';
export default eslint({
typescript: true,
react: { a11y: true }
});If you need to migrate legacy configs, use @eslint/eslintrc + FlatCompat:
import { FlatCompat } from '@eslint/eslintrc';
import { eslint } from '@maneko/eslint-config';
const compat = new FlatCompat();
export default eslint({}, ...compat.config({ extends: ['eslint:recommended'] }));Add scripts to package.json:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}Example lint-staged + husky:
{
"lint-staged": {
"**/*.{js,ts,jsx,tsx,mjs}": ["pnpm lint:fix"]
}
}Install the ESLint extension and use:
Ensure
eslintexists in the project rootnode_modules- the extension does not resolve nested copies reliably.
Use nvim-lspconfig or your favorite tooling. To run auto-fix on save:
-- call EslintFixAll on BufWritePre
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = {"*.js","*.ts","*.jsx","*.tsx"},
callback = function() vim.cmd("EslintFixAll") end
})Or use null-ls / conform.nvim as an alternative.
- JavaScript & TypeScript support (TS opt-in via factory option).
- React/Next/Vue/Svelte/Astro/Solid integrations (opt-in).
- Accessibility rules (a11y) for React/Vue when enabled.
- Opinionated stylistic rules (using
style/*) that are auto-fixable. - Composer API:
.prepend(),.override(),.renamePlugins()for advanced composition.
Pass options or extra flat-configs to the factory:
import { eslint } from '@maneko/eslint-config';
export default eslint(
{ typescript: true, react: true },
{
files: ['**/*.ts'],
rules: {
'no-console': 'warn'
}
}
);Advanced composer example:
export default eslint()
.prepend(/* config */)
.override('maneko/stylistic/rules', {
rules: { 'style/semi': ['error', 'never'] }
})
.renamePlugins({ ts: '@typescript-eslint' });- VS Code not linting - make sure
eslintis installed in the project root (not only globally). - Missing parser/plugin errors - install peer deps in the host project (e.g.
eslint-plugin-react). - Rules auto-fixed unexpectedly in the editor - check
.vscode/settings.json- some stylistic rules may be turned off in the editor and still be fixable on CLI runs. - Legacy
.eslintrc- convert usingFlatCompator maintain a small adapter file.
PRs welcome. Keep changes small and document any new opinionated rules.
Inspired by @antfu/eslint-config - thanks for the design & DX philosophy.
@maneko/eslint-config is licensed under the MIT License. See the LICENSE file in the repository.