Package detail

@peerigon/configs

peerigon443MIT7.1.0

Configs for ESLint, Prettier, TypeScript & friends

eslint, peerigon, configs, typescript

readme

configs

Best practice configs for ESLint, Prettier, TypeScript & friends. By Peerigon.

Version on NPM Version on JSR Semantically released Monthly downloads on NPM
License

Installation

npm install @peerigon/configs  --save-dev

Also checkout the instructions for each respective config:

AI

Furthermore, this package also contains rules and instructions for AI coding agents that are based on the configurations.

If you want your AI coding agent to stick to our configs and coding principles, put this in your project-specific rules file (like CLAUDE.md, .cursor/rules.mdc, etc.):

**Important**: You **must** follow [these rules](./node_modules/@peerigon/configs/ai/rules.mdc) and its language-specific rules referenced in that file.

Philosophy

Linting, formatting and type-checking rules are always a balance between:

  • ease of reading
  • ease of refactoring
  • ease of writing.

We think that:

  • code is read more often than refactored
  • and refactored more often than written from scratch.

Our configs have been designed with these assumptions in mind.

Formatting

Formatting should follow the community standard. Our config is therefore based on Prettier's default config. Besides that it also:

  • sorts import statements
  • formats JSDoc comments
  • formats and sorts package.json fields
  • formats and sorts CSS properties
  • sorts Tailwind CSS class names

This makes git diffs smaller and reviewing them more focussed.

Linting

Linting should mostly catch bugs in the control flow and prevent security issues. Furthermore, it should enforce a modern, idiomatic and consistent code style that is easy to read and to refactor.

However, it should not nit-pick on formatting or favor certain language features where other options are equally ok. Every rule must be legitimized by objective criteria. A simple “I find it easier to read” is not enough.

Our linting rules:

  • are mostly based on recommended sets
  • use type information to catch logic bugs
  • highlight a11y problems
  • are less strict in tests

Type-checking

Type-checking should be rather strict because it is the foundation for safe and sound refactorings. If type-checking is too loose, it may lull the developer into a false sense of security. It should also prevent out-of-bounds errors when accessing arrays or objects.

For highly dynamic code or incompatible types, local exceptions to type safety and escape hatches need to be possible.

License

MIT

Sponsors

changelog

7.1.0 (2025-08-20)

Features

7.0.2 (2025-08-05)

Bug Fixes

  • typescript: Add inlineSources: true for lib tsconfigs (d25c418)

7.0.1 (2025-07-29)

Bug Fixes

  • typescript: Exclude common build directories (cf1f657)

7.0.0 (2025-07-22)

Features

  • prettier: Use @prettier/plugin-oxc (ff3223f)
  • typescript: Add erasableSyntaxOnly to base tsconfig (f3d4468)
  • Update all dependencies (3880e58)

BREAKING CHANGES

  • typescript: We set erasableSyntaxOnly: true as tsconfig default. You might need to disable this in your existing project.
  • Updates eslint-plugin-unicorn@60.0.0 which introduces new eslint rules

6.10.0 (2025-07-14)

Features

  • eslint: bump @eslint-react/eslint-plugin from 1.52.2 to 1.52.3 (#121) (3d41d73)
  • prettier: bump prettier-plugin-tailwindcss from 0.6.13 to 0.6.14 (#123) (70bcdf8)

6.9.0 (2025-07-07)

Features

  • prettier: bump prettier-plugin-jsdoc from 1.3.2 to 1.3.3 (#118) (d14d847)
  • prettier: bump prettier-plugin-packagejson from 2.5.15 to 2.5.18 (#117) (c6c2af4)

6.8.0 (2025-06-30)

Features

  • eslint: bump @eslint/compat from 1.3.0 to 1.3.1 (#104) (7e6dcdb)
  • eslint: bump typescript-eslint from 8.34.1 to 8.35.0 (#103) (0076545)
  • prettier: bump prettier-plugin-tailwindcss from 0.6.12 to 0.6.13 (#106) (61765d7)

6.7.0 (2025-06-10)

Features

  • eslint: bump @eslint-react/eslint-plugin from 1.50.0 to 1.51.2 (#91) (d06b852)
  • prettier: bump prettier-plugin-tailwindcss from 0.6.11 to 0.6.12 (#90) (596e09e)
  • semantic-release: bump @sebbo2002/semantic-release-jsr from 2.0.5 to 3.0.0 (#92) (a6bd038)

6.6.0 (2025-06-10)

Features

  • prettier: bump @ianvs/prettier-plugin-sort-imports from 4.4.1 to 4.4.2 (#93) (219e289)

6.5.0 (2025-06-03)

Features

  • eslint: bump @eslint/js from 9.27.0 to 9.28.0 (#87) (566c18a)
  • eslint: bump @semantic-release/exec from 7.0.3 to 7.1.0 (#85) (1f53ebb)
  • eslint: bump globals from 16.0.0 to 16.2.0 (#88) (3a45c31)

6.4.0 (2025-05-26)

Features

  • eslint: bump @eslint-react/eslint-plugin from 1.48.1 to 1.49.0 (#69) (059b3e3)
  • prettier: bump prettier-plugin-packagejson from 2.5.10 to 2.5.14 (#82) (0d5be7d)

6.3.0 (2025-05-19)

Features

  • add linting rule to check for accidental test.only (#76) (25e8f17)

6.2.0 (2025-05-12)

Features

  • esint: bump eslint-plugin-unicorn from 59.0.0 to 59.0.1 (#75) (2d6bcd0)
  • eslint: bump eslint-plugin-react-refresh from 0.4.19 to 0.4.20 (#74) (a76f44c)

6.1.0 (2025-05-05)

Features

  • eslint: bump @eslint/compat from 1.2.8 to 1.2.9 (#70) (27aed65)
  • eslint: bump @eslint/js from 9.25.1 to 9.26.0 (#67) (4eb269d)
  • eslint: bump typescript-eslint from 8.30.1 to 8.31.1 (#68) (f5a4335)

6.0.1 (2025-05-02)

Bug Fixes

  • eslint: Allow await in loops in tests (5f7da87)

6.0.0 (2025-04-30)

Features

  • eslint: bump eslint-plugin-unicorn from 58.0.0 to 59.0.0 (#66) (ca94ee9)

BREAKING CHANGES

5.5.0 (2025-04-28)

Features

  • eslint: bump @eslint/js from 9.25.0 to 9.25.1 (#62) (1b4f297)

5.4.0 (2025-04-22)

Features

  • eslint: bump @eslint/compat from 1.2.7 to 1.2.8 (#56) (5cec583)
  • eslint: bump eslint-plugin-react from 7.37.4 to 7.37.5 (#60) (61b16e2)
  • eslint: bump typescript-eslint from 8.29.1 to 8.30.1 (#59) (a949c91)

5.3.0 (2025-04-16)

Features

  • eslint: bump @eslint-react/eslint-plugin from 1.40.4 to 1.47.2 (#51) (b138f19)

5.2.0 (2025-04-16)

Features

  • eslint: bump typescript-eslint from 8.26.0 to 8.29.1 (#55) (f37f2cf)

5.1.0 (2025-04-07)

Features

  • bump @eslint-react/eslint-plugin from 1.37.3 to 1.40.4 (#50) (4df7f60)

5.0.0 (2025-03-31)

Features

  • bump eslint-plugin-unicorn from 57.0.0 to 58.0.0 (#46) (199ebe8)

BREAKING CHANGES

  • See eslint-plugin-unicorn release notes

4.4.2 (2025-03-26)

Bug Fixes

  • eslint: Ignore noDefaultExport in config files (ae8c3ea)

4.4.1 (2025-03-24)

Bug Fixes

  • typescript: Turn lib configs into config partials (295e617)

4.4.0 (2025-03-24)

Features

  • eslint: bump @eslint-react/eslint-plugin from 1.31.0 to 1.37.3 (#41) (904b1cf)

4.3.0 (2025-03-24)

Bug Fixes

  • eslint: Turn of unicorn/consistent-function-scoping (6570db3)

Features

  • Compile JS code instead of just emitDeclarationOnly (c7d29f7)
  • typescript: Change base target to es2024 (58b217a)

4.3.0-beta.2 (2025-03-23)

Bug Fixes

  • eslint: Turn of unicorn/consistent-function-scoping (6570db3)

Features

  • typescript: Change base target to es2024 (58b217a)

4.3.0-beta.1 (2025-03-12)

Features

  • Compile JS code instead of just emitDeclarationOnly (c7d29f7)

4.2.0 (2025-03-10)

Features

  • eslint: bump @eslint-react/eslint-plugin from 1.30.2 to 1.31.0 (#30) (1008a87)
  • prettier: bump eslint-config-prettier from 10.0.2 to 10.1.1 (#27) (c27fc02)
  • react: bump eslint-plugin-react-compiler from 19.0.0-beta-e552027-20250112 to 19.0.0-beta-714736e-20250131 (#29) (042a398)

4.1.0 (2025-03-10)

Features

  • semantic-release: Add JSR as cross-publish registry (bd5d42d)

4.0.1 (2025-03-09)

Bug Fixes

  • typescript: Incorrect dist path in base config (4d06e5f)

4.0.0 (2025-03-06)

Features

BREAKING CHANGES

  • Updated some peerDependencies

3.2.0 (2025-03-06)

Bug Fixes

  • Incorrect types returned by presets (5744961)
  • Turn off consistent-return rule in TypeScript files (0830152)
  • Turn off no-new for tests (26bc778)

Features

3.1.0 (2025-03-03)

Features

  • bump eslint-plugin-react-compiler from 19.0.0-beta-e552027-20250112 to 19.0.0-beta-714736e-20250131 (c27c0e5)
  • bump eslint-plugin-react-hooks from 5.1.0 to 5.2.0 (9c2328f)
  • bump prettier-plugin-packagejson from 2.5.8 to 2.5.10 (157df20)

3.0.0 (2025-02-24)

Features

  • Update to eslint-plugin-unicorn@57.0.0 (f5521ee)

BREAKING CHANGES

2.0.2 (2025-02-11)

Bug Fixes

  • Refactor module settings in tsconfig (4bce2f2)

2.0.1 (2025-02-08)

Bug Fixes

2.0.0 (2025-02-08)

Bug Fixes

  • Add missing checkJs: true to TypeScript base config (6dbd0dc)

Features

  • Update TypeScript base config (60843de)

BREAKING CHANGES

  • Added noFallthroughCasesInSwitch: true
  • Switched skipLibCheck to false

1.1.0 (2025-02-08)

Bug Fixes

  • Do not complain about export default in config.ts files (1e8b762)

Features

  • Disable "max-nested-callbacks" in tests (1690ac4)

1.0.1 (2025-02-04)

Bug Fixes

  • Missing channel name in semantic-release config (6f669f1)

1.0.0 (2025-02-04)

Bug Fixes

  • Add rootDir to lib tsconfig (764e0c1)
  • Adjust release script (df43151)
  • Adjust release script (3668267)
  • Changelog not formatted correctly (cc12fa7)
  • CHANGELOG.md not being properly formatted (22720ea)
  • Downgrade ESLint (d09f208)
  • Improve error message for no-default-export (198c911)
  • Missing files in package.json files array (97111b6)
  • Missing packages write permission in Github action (ce0d482)
  • Move package types to regular dependencies (6d6c169)
  • noEmit setting in TypeScript configs (281334c)
  • Prettify CHANGELOG.md (f904e8d)
  • Relax switch-exhaustiveness-check rule (2f158a4)
  • Remove rootDir config from lib tsconfig again (84fe9dc)
  • Turn of TS's exactOptionalPropertyTypes (4069985)
  • Turn off unicorn/import-style (f3be043)
  • Turn off unicorn/no-single-promise-in-promise-methods (0557a83)
  • TypeScript configs (0c584e7)
  • Use cross-publish semantic release config (c079ce0)

Features

1.0.0-beta.22 (2025-02-04)

Features

1.0.0-beta.21 (2025-01-27)

Bug Fixes

  • Missing packages write permission in Github action (ce0d482)

1.0.0-beta.20 (2025-01-27)

Bug Fixes

  • Use cross-publish semantic release config (c079ce0)

1.0.0-beta.19 (2025-01-27)

Features

1.0.0-beta.18 (2025-01-26)

Features

1.0.0-beta.17 (2025-01-20)

Bug Fixes

  • Changelog not formatted correctly (cc12fa7)

1.0.0-beta.16 (2025-01-20)

Bug Fixes

  • CHANGELOG.md not being properly formatted (22720ea)

Features

  • Improve CSS property sorting (f9b9790)

1.0.0-beta.15 (2024-12-30)

Bug Fixes

  • Remove rootDir config from lib tsconfig again (84fe9dc)

1.0.0-beta.14 (2024-12-30)

Bug Fixes

  • Add rootDir to lib tsconfig (764e0c1)

1.0.0-beta.13 (2024-12-30)

Bug Fixes

  • Improve error message for no-default-export (198c911)

1.0.0-beta.12 (2024-12-30)

Bug Fixes

  • Turn off unicorn/import-style (f3be043)

1.0.0-beta.11 (2024-12-15)

Bug Fixes

  • Move package types to regular dependencies (6d6c169)
  • noEmit setting in TypeScript configs (281334c)
  • Relax switch-exhaustiveness-check rule (2f158a4)

1.0.0-beta.10 (2024-12-11)

Bug Fixes

  • Turn of TS's exactOptionalPropertyTypes (4069985)
  • Turn off unicorn/no-single-promise-in-promise-methods (0557a83)

1.0.0-beta.9 (2024-12-09)

Features

  • Improve TS configs and add library types (760a898)

1.0.0-beta.8 (2024-11-16)

Bug Fixes

Features

1.0.0-beta.7 (2024-11-15)

Bug Fixes

1.0.0-beta.6 (2024-11-14)

Bug Fixes

  • Missing files in package.json files array (97111b6)

1.0.0-beta.5 (2024-11-14)

Features

  • Add shareable semantic-release config (e0b585a)

1.0.0-beta.4 (2024-11-10)

Bug Fixes

1.0.0-beta.3 (2024-11-10)

Bug Fixes

1.0.0-beta.2 (2024-11-10)

Features

1.0.0-beta.1 (2024-11-05)

Features

1.0.0-beta.1 (2024-11-05)

Features

1.0.0-beta.1 (2024-11-05)

Features