ESLint Config Love

153.0.0 · active · verified Sun Apr 19

eslint-config-love is a highly opinionated and strict ESLint shareable configuration specifically designed for TypeScript projects, prioritizing code safety and explicit patterns over conciseness. It currently stands at version 153.0.0, indicative of its extremely rapid development cycle where even minor rule additions or dependency updates are considered breaking changes, leading to frequent major version bumps (often weekly or bi-weekly). This configuration differentiates itself by intentionally avoiding formatting rules, instead advocating for dedicated code formatters like Prettier. It also refrains from duplicating checks already enforced by TypeScript's strict mode and steers clear of library- or framework-specific rules, maintaining a focus on core JavaScript and TypeScript linting. It integrates rules from various sources including ESLint itself, `@typescript-eslint`, `@eslint-community/eslint-comments`, `n`, `promise`, and `import` plugins.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart shows how to configure ESLint in a CommonJS project using dynamic import and provides a basic tsconfig.json necessary for the configuration's type-aware rules.

// .eslintrc.cjs (for CommonJS projects)
module.exports = (async function config() {
  const { default: love } = await import('eslint-config-love')

  return [
    {
      ...love,
      files: ['**/*.js', '**/*.ts', '**/*.jsx', '**/*.tsx'],
    },
  ]
})()

// tsconfig.json (required for TypeScript rules utilizing type information)
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "lib": ["ESNext"],
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "isolatedModules": true,
    // ... other compiler options
  },
  "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"],
  "exclude": ["node_modules"]
}

view raw JSON →