Platform Help

ESLint

Prerequisites:

The styleguide needs to be installed as a development dependency:

pnpm i -D @kurocado-studio/styleguide

Install ESLint

This styleguide targets ESLint v9+ (flat config):

pnpm i -D eslint

Configure ESLint

Create an ESLint flat-config file at the repository root.

  • If your repo is ESM ("type": "module"), use eslint.config.js.

  • Otherwise, use eslint.config.mjs.

Node.js projects

import { defineBaseNodeEslintConfig } from '@kurocado-studio/styleguide'; export default defineBaseNodeEslintConfig(process.cwd());

React / browser projects

import { defineReactEslintConfig } from '@kurocado-studio/styleguide'; export default defineReactEslintConfig();

Options

Export

Type

Use when

Notes

defineBaseNodeEslintConfig(repoRoot?)

function

Node-only repos (backend, packages, scripts)

Canonical usage in our repos (e.g. formkit-public).

defineReactEslintConfig(repoRoot?)

function

React/Vite/Remix repos

Canonical usage in our repos.

defineESLintConfig

function

You want stronger typing for ESLint config

Re-export of eslint-define-config ’s defineConfig. Optional.

What these presets do (high level)

  • Ignore dist, build, node_modules, coverage.

  • For TypeScript files, set parserOptions.project to <repoRoot>/tsconfig.json (so type-aware rules can run).

  • Apply Prettier’s rule overrides via eslint-config-prettier to avoid formatter/linter conflicts.

Add scripts

{ "scripts": { "lint": "eslint --max-warnings=0 . --no-warn-ignored", "lint:fix": "eslint --max-warnings=0 . --fix --no-warn-ignored" } }

Troubleshooting

  • Type-aware linting is slow: ensure your tsconfig.json is not accidentally including huge globs (like dist/**).

  • Monorepo root issues: use defineBaseNodeEslintConfig(<rootPath>)/defineReactEslintConfig with an explicit repoRoot.

Last modified: 18 December 2025