# Team Setup & Shared Configurations — ESLint and Prettier: Code Quality and Formatting

Source: https://www.skillbyai.com/en/eslint-prettier/eslint-prettier-17

> Share one ESLint config across projects as an npm package that exports flat config arrays.

## Scaling configurations

Large teams benefit from centralized ESLint configs. Extract shared rules into a package (@org/eslint-config) and use it across all projects.

## Shared config package

Structure for a reusable flat-config package that exports an array.

```bash
# packages/eslint-config/package.json
{
  "name": "@myorg/eslint-config",
  "type": "module",
  "main": "index.js",
  "peerDependencies": { "eslint": "^9.0.0" }
}

// packages/eslint-config/index.js
import js from '@eslint/js';
export default [
  js.configs.recommended,
  { rules: { /* team rules */ } },
];

// a project's eslint.config.js
import team from '@myorg/eslint-config';
export default [...team];
```

Output:

```
Shared ESLint config package created
```

## Version control configs

Store shareable configs in your main repo or as separate npm packages. Version them and let teams update at their pace.

Quick check

**Quiz:** Why create a shared ESLint config package?

- [ ] To slow down development.
- [ ] To reduce code.
- [x] To ensure all team projects follow the same standards.
- [ ] To rename branches

*Answer:* To ensure all team projects follow the same standards.. Shared configs maintain consistency across your organization and make onboarding new projects trivial.
