# टीम सेटअप और Shared Configurations — ESLint और Prettier: Code Quality और Formatting

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

> Flat config arrays export करने वाले npm package के रूप में एक ESLint config कई projects में साझा करें।

## Configurations को scale करना

बड़ी टीमें centralized ESLint configs से benefit करती हैं। Shared rules को एक package (@org/eslint-config) में extract करें और सभी projects में इसका उपयोग करें।

## Shared config package

ऐसे reusable flat-config package की संरचना जो array export करता है।

```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
```

## Configs को version control करें

Shareable configs को अपने main repo में या separate npm packages के रूप में store करें। उन्हें version करें और teams को अपनी गति से update करने दें।

त्वरित जाँच

**Quiz:** एक shared ESLint config package क्यों बनाएँ?

- [ ] Development को slow down करने के लिए।
- [ ] कोड को reduce करने के लिए।
- [x] सुनिश्चित करने के लिए कि सभी team projects एक ही standards को follow करें।
- [ ] Branches का नाम बदलने के लिए

*Answer:* सुनिश्चित करने के लिए कि सभी team projects एक ही standards को follow करें।. Shared configs आपके organization में consistency बनाए रखते हैं और नए projects को onboard करना trivial बनाते हैं।
