<!--
title: Standardize monorepo linting
domain: app-frameworks
topic: Code Style
language: JavaScript
source: tanstack/query
updated: 2026-04-23
url: https://awesomereviewers.com/reviewers/query-standardize-monorepo-linting/
-->

Use shared root configuration for formatting and apply consistent ESLint rule severities across the monorepo, allowing only narrowly scoped exceptions.

- Formatting: avoid duplicating Prettier config in packages—inherit/extend the monorepo root Prettier settings.
- Linting: set intended rule severity (e.g., test-related rules) once in the root ESLint config so it applies across packages; if a package needs a deviation, disable the rule only for that package/files with an explicit override.

Example (root ESLint override pattern):

```js
export default [
  {
    files: ['**/*.spec.ts*', '**/*.test.ts*', '**/*.test-d.ts*'],
    // apply Vitest expectations consistently across packages
    rules: {
      'vitest/expect-expect': 'error',
    },
  },
  {
    // narrowly scoped exception, only where needed
    files: ['packages/query-codemods/**'],
    rules: {
      '@typescript-eslint/require-await': 'off',
    },
  },
];
```

Result: fewer configuration drifts between packages, predictable CI failures, and minimal “special case” behavior that’s easy to audit.
