Skip to content

Pragmatic ESLint config for robust collaboration

License

Notifications You must be signed in to change notification settings

kripod/eslint-config

Repository files navigation

@kripod/eslint-config

Pragmatic ESLint config for robust collaboration

npm version GitHub Sponsors

Principles

  • Exhaustive flat configs for ESLint v9+
  • Distinct severities
    • Error on potential bugs, ambiguities and unsafe/legacy constructs
    • Warn about incompletions and unification opportunities
  • Composable entry points

Usage

Install as a dev dependency:

pnpm add -D @kripod/eslint-config

Set up ESLint with predefined global variables:

// eslint.config.js
import baseConfig from "@kripod/eslint-config/base";
import typeCheckedConfig from "@kripod/eslint-config/type-checked";
import globals from "globals";

/** @type {import("eslint").Linter.Config[]} */
export default [
  { files: ["**/*.jsx", "**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"] },
  ...baseConfig,
  ...typeCheckedConfig,
  {
    languageOptions: {
      globals: {
        ...globals.node,
      },
    },
  },
];

If using TypeScript, enable strictNullChecks e.g. via @total-typescript/tsconfig or the strict compiler option.

Presets